History log of /linux/drivers/spi/spi-topcliff-pch.c (Results 1 – 25 of 72)
Revision Date Author Comments
# 40daed14 28-Nov-2023 Yang Yingliang <yangyingliang@huawei.com>

spi: topcliff-pch: switch to use modern name

Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: http

spi: topcliff-pch: switch to use modern name

Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://msgid.link/r/20231128093031.3707034-18-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 9e264f3f 10-Mar-2023 Amit Kumar Mahapatra via Alsa-devel <alsa-devel@alsa-project.org>

spi: Replace all spi->chip_select and spi->cs_gpiod references with function call

Supporting multi-cs in spi drivers would require the chip_select & cs_gpiod
members of struct spi_device to be an ar

spi: Replace all spi->chip_select and spi->cs_gpiod references with function call

Supporting multi-cs in spi drivers would require the chip_select & cs_gpiod
members of struct spi_device to be an array. But changing the type of these
members to array would break the spi driver functionality. To make the
transition smoother introduced four new APIs to get/set the
spi->chip_select & spi->cs_gpiod and replaced all spi->chip_select and
spi->cs_gpiod references with get or set API calls.
While adding multi-cs support in further patches the chip_select & cs_gpiod
members of the spi_device structure would be converted to arrays & the
"idx" parameter of the APIs would be used as array index i.e.,
spi->chip_select[idx] & spi->cs_gpiod[idx] respectively.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Acked-by: Heiko Stuebner <heiko@sntech.de> # Rockchip drivers
Reviewed-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org> # Aspeed driver
Reviewed-by: Dhruva Gole <d-gole@ti.com> # SPI Cadence QSPI
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> # spi-stm32-qspi
Acked-by: William Zhang <william.zhang@broadcom.com> # bcm63xx-hsspi driver
Reviewed-by: Serge Semin <fancer.lancer@gmail.com> # DW SSI part
Link: https://lore.kernel.org/r/167847070432.26.15076794204368669839@mailman-core.alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# b082694f 03-Mar-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

spi: topcliff-pch: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do e

spi: topcliff-pch: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230303172041.2103336-83-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 26f30e3e 15-Jun-2022 Mark Brown <broonie@kernel.org>

spi: topcliff-pch: Use core message validation

The topcliff-pch driver requires TX and RX buffers on all transfers, open
coding checks for this. Remove those open coded checks and instead rely on
th

spi: topcliff-pch: Use core message validation

The topcliff-pch driver requires TX and RX buffers on all transfers, open
coding checks for this. Remove those open coded checks and instead rely on
the core functionality, which has the added bonus that it will fix up any
transfers submitted by drivers as needed rather than erroring out.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220615174138.4060912-1-broonie@kernel.org

show more ...


# 80ab9012 07-Mar-2022 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

spi: topcliff-pch: Prevent usage of potentially stale DMA device

DMA device is expected to be available while SPI transfer is ongoing.

Prevent usage of potentially stale DMA device by keeping refer

spi: topcliff-pch: Prevent usage of potentially stale DMA device

DMA device is expected to be available while SPI transfer is ongoing.

Prevent usage of potentially stale DMA device by keeping reference
count till the end of the transfer.

Fixes: 4d986ffa036a ("spi: add missing pci_dev_put() before return")
Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220307173740.80996-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 4d986ffa 15-Feb-2022 Wang Qing <wangqing@vivo.com>

spi: add missing pci_dev_put() before return

pci_get_slot() increases its reference count, the caller must
decrement the reference count by calling pci_dev_put()

Signed-off-by: Wang Qing <wangqing@

spi: add missing pci_dev_put() before return

pci_get_slot() increases its reference count, the caller must
decrement the reference count by calling pci_dev_put()

Signed-off-by: Wang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1644890407-65167-1-git-send-email-wangqing@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 026a1dc1 06-May-2021 Jay Fang <f.fangjian@huawei.com>

spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages()

pch_spi_set_tx() frees data->pkt_tx_buff on failure of kzalloc() for
data->pkt_rx_buff, but its caller, pch_spi_process

spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages()

pch_spi_set_tx() frees data->pkt_tx_buff on failure of kzalloc() for
data->pkt_rx_buff, but its caller, pch_spi_process_messages(), will
free data->pkt_tx_buff again. Set data->pkt_tx_buff to NULL after
kfree() to avoid double free.

Signed-off-by: Jay Fang <f.fangjian@huawei.com>
Link: https://lore.kernel.org/r/1620284888-65215-1-git-send-email-f.fangjian@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# c9831087 24-Mar-2021 Jay Fang <f.fangjian@huawei.com>

spi: spi-topcliff-pch: Fix checkpatch spacing error

Fix checkpatch error:

ERROR: space prohibited before that '++' (ctx:WxB)
#1204: FILE: spi-topcliff-pch.c:1204:
+ for (i = 0; i < cnt; i +

spi: spi-topcliff-pch: Fix checkpatch spacing error

Fix checkpatch error:

ERROR: space prohibited before that '++' (ctx:WxB)
#1204: FILE: spi-topcliff-pch.c:1204:
+ for (i = 0; i < cnt; i ++) {
^

Signed-off-by: Jay Fang <f.fangjian@huawei.com>
Link: https://lore.kernel.org/r/1616566602-13894-2-git-send-email-f.fangjian@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# ca03dba3 20-Sep-2020 Julia Lawall <Julia.Lawall@inria.fr>

spi/topcliff-pch: drop double zeroing

sg_init_table zeroes its first argument, so the allocation of that argument
doesn't have to.

the semantic patch that makes this change is as follows:
(http://c

spi/topcliff-pch: drop double zeroing

sg_init_table zeroes its first argument, so the allocation of that argument
doesn't have to.

the semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,n,flags;
@@

x =
- kcalloc
+ kmalloc_array
(n,sizeof(*x),flags)
...
sg_init_table(x,n)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/1600601186-7420-12-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 15b413d9 27-Jul-2020 Vaibhav Gupta <vaibhavgupta40@gmail.com>

spi: spi-topcliff-pch: drop call to wakeup-disable

Before generic upgrade, both .suspend() and .resume() were invoking
pci_enable_wake(pci_dev, PCI_D3hot, 0). Hence, disabling wakeup in both
states.

spi: spi-topcliff-pch: drop call to wakeup-disable

Before generic upgrade, both .suspend() and .resume() were invoking
pci_enable_wake(pci_dev, PCI_D3hot, 0). Hence, disabling wakeup in both
states. (Normal trend is .suspend() enables and .resume() disables the
wakeup.)

This was ambiguous and may be buggy. Instead of replicating the legacy
behavior, drop the wakeup-disable call.

Fixes: f185bcc77980 ("spi: spi-topcliff-pch: use generic power management")
Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200727172936.661567-1-vaibhavgupta40@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# f185bcc7 20-Jul-2020 Vaibhav Gupta <vaibhavgupta40@gmail.com>

spi: spi-topcliff-pch: use generic power management

Drivers using legacy PM have to manage PCI states and device's PM states
themselves. They also need to take care of configuration registers.

With

spi: spi-topcliff-pch: use generic power management

Drivers using legacy PM have to manage PCI states and device's PM states
themselves. They also need to take care of configuration registers.

With improved and powerful support of generic PM, PCI Core takes care of
above mentioned, device-independent, jobs.

This driver makes use of PCI helper functions like
pci_save/restore_state(), pci_enable/disable_device(), pci_enable_wake()
and pci_set_power_state() to do required operations. In generic mode, they
are no longer needed.

Change function parameter in both .suspend() and .resume() to
"struct device*" type. Use dev_get_drvdata() to get drv data.

Compile-tested only.

Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Link: https://lore.kernel.org/r/20200720155714.714114-1-vaibhavgupta40@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# decf5326 17-Jul-2020 Lee Jones <lee.jones@linaro.org>

spi: spi-topcliff-pch: Add missing descriptions to 'struct pch_spi_data'

Fixes the following W=1 kernel build warning(s):

drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member

spi: spi-topcliff-pch: Add missing descriptions to 'struct pch_spi_data'

Fixes the following W=1 kernel build warning(s):

drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'io_base_addr' not described in 'pch_spi_data'
drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'pkt_tx_buff' not described in 'pch_spi_data'
drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'pkt_rx_buff' not described in 'pch_spi_data'
drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'dma' not described in 'pch_spi_data'
drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'use_dma' not described in 'pch_spi_data'
drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'save_total_len' not described in 'pch_spi_data'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200717135424.2442271-12-lee.jones@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 10e413fa 28-Nov-2019 zhengbin <zhengbin13@huawei.com>

spi/topcliff-pch: Remove unneeded semicolon

Fixes coccicheck warning:

drivers/spi/spi-topcliff-pch.c:866:47-48: Unneeded semicolon
drivers/spi/spi-topcliff-pch.c:881:53-54: Unneeded semicolon

Repo

spi/topcliff-pch: Remove unneeded semicolon

Fixes coccicheck warning:

drivers/spi/spi-topcliff-pch.c:866:47-48: Unneeded semicolon
drivers/spi/spi-topcliff-pch.c:881:53-54: Unneeded semicolon

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1574909512-24260-1-git-send-email-zhengbin13@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# e74dc5c7 26-Sep-2019 Alexandru Ardelean <alexandru.ardelean@analog.com>

spi: use new `spi_transfer_delay_exec` helper where straightforward

For many places in the spi drivers, using the new `spi_transfer_delay`
helper is straightforward.
It's just replacing:
```
if (t

spi: use new `spi_transfer_delay_exec` helper where straightforward

For many places in the spi drivers, using the new `spi_transfer_delay`
helper is straightforward.
It's just replacing:
```
if (t->delay_usecs)
udelay(t->delay_usecs);
```
with `spi_transfer_delay(t)` which handles both `delay_usecs` and the new
`delay` field.

This change replaces in all places (in the spi drivers) where this change
is simple.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20190926105147.7839-10-alexandru.ardelean@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 8e8e69d6 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of th

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation version 2 of the license this program
is distributed in the hope that it will be useful but without any
warranty without even the implied warranty of merchantability or
fitness for a particular purpose see the gnu general public license
for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 100 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141900.918357685@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

show more ...


# f37d8e67 13-Mar-2019 Aditya Pakki <pakki001@umn.edu>

spi : spi-topcliff-pch: Fix to handle empty DMA buffers

pch_alloc_dma_buf allocated tx, rx DMA buffers which can fail. Further,
these buffers are used without a check. The patch checks for these
fai

spi : spi-topcliff-pch: Fix to handle empty DMA buffers

pch_alloc_dma_buf allocated tx, rx DMA buffers which can fail. Further,
these buffers are used without a check. The patch checks for these
failures and sends the error upstream.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 0ce26a1c 01-Feb-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

PCI: Move Rohm Vendor ID to generic list

Move the Rohm Vendor ID to pci_ids.h instead of defining it in several
drivers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-of

PCI: Move Rohm Vendor ID to generic list

Move the Rohm Vendor ID to pci_ids.h instead of defining it in several
drivers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>

show more ...


# e902cdcb 23-Jan-2019 YueHaibing <yuehaibing@huawei.com>

spi/topcliff_pch: Fix potential NULL dereference on allocation error

In pch_spi_handle_dma, it doesn't check for NULL returns of kcalloc
so it would result in an Oops.

Fixes: c37f3c2749b5 ("spi/top

spi/topcliff_pch: Fix potential NULL dereference on allocation error

In pch_spi_handle_dma, it doesn't check for NULL returns of kcalloc
so it would result in an Oops.

Fixes: c37f3c2749b5 ("spi/topcliff_pch: DMA support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 45e861a1 13-Jan-2017 Markus Elfring <elfring@users.sourceforge.net>

spi/topcliff-pch: Delete an error message for a failed memory allocation in pch_spi_set_tx()

Omit an extra message for a memory allocation failure in this function.

Link: http://events.linuxfoundat

spi/topcliff-pch: Delete an error message for a failed memory allocation in pch_spi_set_tx()

Omit an extra message for a memory allocation failure in this function.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# b996356d 13-Jan-2017 Markus Elfring <elfring@users.sourceforge.net>

spi/topcliff-pch: Combine substrings for four messages

The script "checkpatch.pl" pointed information out like the following.

WARNING: quoted string split across lines

Thus fix the affected source

spi/topcliff-pch: Combine substrings for four messages

The script "checkpatch.pl" pointed information out like the following.

WARNING: quoted string split across lines

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# baa35f57 13-Jan-2017 Markus Elfring <elfring@users.sourceforge.net>

spi/topcliff-pch: Improve size determinations in pch_spi_probe()

Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the correspon

spi/topcliff-pch: Improve size determinations in pch_spi_probe()

Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 84aa0ba1 13-Jan-2017 Markus Elfring <elfring@users.sourceforge.net>

spi/topcliff-pch: Use kcalloc() in pch_spi_handle_dma()

* Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the

spi/topcliff-pch: Use kcalloc() in pch_spi_handle_dma()

* Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "kcalloc".

This issue was detected by using the Coccinelle software.

* Replace the specification of a data structure by pointer dereferences
to make the corresponding size determination a bit safer according to
the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 6ceb3b27 13-Jan-2017 Markus Elfring <elfring@users.sourceforge.net>

spi/topcliff-pch: Delete an unnecessary return statement in two functions

The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not gen

spi/topcliff-pch: Delete an unnecessary return statement in two functions

The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not generally useful

Thus remove such statements here.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 9677e7dd 18-Nov-2016 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

spi: spi-topcliff-pch: Remove some dead code

Since commit 0d35773979b9 ("spi: spi-topcliff-pch: Remove deprecated
create_singlethread_workqueue"), 'retval' is no more used in this function.

So some

spi: spi-topcliff-pch: Remove some dead code

Since commit 0d35773979b9 ("spi: spi-topcliff-pch: Remove deprecated
create_singlethread_workqueue"), 'retval' is no more used in this function.

So some now dead code can be removed.
Also axe a debug message which looks useless now.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 0d357739 10-Jul-2016 Bhaktipriya Shridhar <bhaktipriya96@gmail.com>

spi: spi-topcliff-pch: Remove deprecated create_singlethread_workqueue

The workqueue "wk" serves as a queue for carrying out execution
of requests. It has a single work item(&drv_data->work) and hen

spi: spi-topcliff-pch: Remove deprecated create_singlethread_workqueue

The workqueue "wk" serves as a queue for carrying out execution
of requests. It has a single work item(&drv_data->work) and hence doesn't
require ordering. Also, it is not being used on a memory reclaim path.
Hence, the singlethreaded workqueue has been replaced with the use of
system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

Work item has been flushed in pch_spi_free_resources() to ensure that
there are no pending tasks while disconnecting the driver.

Also dropped the label 'err_return' since it's not being used anymore.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


123