- 27 Jun, 2022 1 commit
-
-
David Jander authored
This enables the possibility to transfer a message that is not at the current tip of the async message queue. This is in preparation of the next patch(es) which enable spi_sync messages to skip the queue altogether. Signed-off-by: David Jander <david@protonic.nl> Link: https://lore.kernel.org/r/20220621061234.3626638-2-david@protonic.nlSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 23 Jun, 2022 1 commit
-
-
Eddie James authored
Only timeout after at least one iteration of checking the status registers. In addition, increase the transfer timeout to 1 second. Signed-off-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20220623140547.71762-1-eajames@linux.ibm.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 20 Jun, 2022 1 commit
-
-
Mark Brown authored
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
-
- 16 Jun, 2022 1 commit
-
-
Conor Dooley authored
It is possible that the error case for devm_clk_get() returns NULL, in which case zero will be passed to PTR_ERR() as shown by the Smatch static checker warning: drivers/spi/spi-microchip-core.c:557 mchp_corespi_probe() warn: passing zero to 'PTR_ERR' Remove the NULL check and carry on with a dummy clock in case of an error. To avoid a potential div zero, abort calculating clkgen if clk_get_rate(spi->clk) is zero. Fixes: 9ac8d176 ("spi: add support for microchip fpga spi controllers") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/linux-spi/20220615091633.GI2168@kadam/Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20220615142028.2991915-1-conor.dooley@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 14 Jun, 2022 2 commits
-
-
Dan Carpenter authored
Return -ENOMEM if the allocation fails. Don't return success. Fixes: 6598b91b ("spi: spi.c: Convert statistics to per-cpu u64_stats_t") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/Yqh6bdNYO2XNhPBa@kiliSigned-off-by: Mark Brown <broonie@kernel.org>
-
Conor Dooley authored
If platform_get_irqi() returns 0, the error case will be triggered but probe() will return 0 rather than an error. Ape the other drivers using this pattern and return -ENXIO. Reported-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Fixes: 9ac8d176 ("spi: add support for microchip fpga spi controllers") Link: https://lore.kernel.org/r/20220614065809.1969177-1-conor.dooley@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 13 Jun, 2022 7 commits
-
-
Mark Brown authored
Merge series from Krishna Yarlagadda <kyarlagadda@nvidia.com>: Add multiple chip select lines supported on Tegra 241
-
David Fries authored
Print a warning if the device mode doesn't match the requested mode. The user doesn't enter the mode in hex so it isn't obvious when setting the mode succeeds that the mode isn't the requested mode. The kernel logs a message, it will be more visible if the test also prints a warning. I was testing --quad, which is unsupported, but doesn't cause the mode request to fail. Signed-off-by: David Fries <David@Fries.net> Link: https://lore.kernel.org/r/YqbNnSGtWHe/GG7w@spacedout.fries.netSigned-off-by: Mark Brown <broonie@kernel.org>
-
Colin Ian King authored
There are pointers being set to null using use. Use NULL instead. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Link: https://lore.kernel.org/r/20220612203428.2754823-1-colin.i.king@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Peng Wu authored
Fix the unreasonable clk_prepare_enable() with clk_disable_unprepare() before return from mchp_corespi_probe() in the error handling case. Signed-off-by: Peng Wu <wupeng58@huawei.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20220611021117.40494-1-wupeng58@huawei.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krishna Yarlagadda authored
Add new compatible for Tegra241 QSPI controller which has multiple chip select lines. Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com> Link: https://lore.kernel.org/r/20220607114659.54314-4-kyarlagadda@nvidia.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krishna Yarlagadda authored
Move peripheral properties for Tegra QSPI controller to nvidia,tegra210-quad-peripheral-props.yaml and add reference to spi-peripheral-props.yaml file. Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com> Link: https://lore.kernel.org/r/20220607114659.54314-3-kyarlagadda@nvidia.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krishna Yarlagadda authored
Tegra Grace and later chips can support upto 4 chip select lines for QUAD SPI. Added new compatible for Tegra Grace. Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com> Link: https://lore.kernel.org/r/20220607114659.54314-2-kyarlagadda@nvidia.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 10 Jun, 2022 3 commits
-
-
Mark Brown authored
Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>: The following series adds runtime PM support for atmel-quadspi driver. clk_disable()/clk_enable() is called on proper runtime_suspend()/runtime_resume() ops. Along with it 2 minor cleanups were added (patches 2/3, 3/3).
-
David Jander authored
On 32 bit systems, the following kernel BUG is hit: BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 caller is debug_smp_processor_id+0x18/0x24 CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc1-00001-g6ae0aec8a366 #181 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) Backtrace: dump_backtrace from show_stack+0x20/0x24 r7:81024ffd r6:00000000 r5:81024ffd r4:60000013 show_stack from dump_stack_lvl+0x60/0x78 dump_stack_lvl from dump_stack+0x14/0x1c r7:81024ffd r6:80f652de r5:80bec180 r4:819a2500 dump_stack from check_preemption_disabled+0xc8/0xf0 check_preemption_disabled from debug_smp_processor_id+0x18/0x24 r8:8119b7e0 r7:81205534 r6:819f5c00 r5:819f4c00 r4:c083d724 debug_smp_processor_id from __spi_sync+0x78/0x220 __spi_sync from spi_sync+0x34/0x4c r10:bb7bf4e0 r9:c083d724 r8:00000007 r7:81a068c0 r6:822a83c0 r5:c083d724 r4:819f4c00 spi_sync from spi_mem_exec_op+0x338/0x370 r5:000000b4 r4:c083d910 spi_mem_exec_op from spi_nor_read_id+0x98/0xdc r10:bb7bf4e0 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:82358040 r4:819f7c40 spi_nor_read_id from spi_nor_detect+0x38/0x114 r7:82358040 r6:00000000 r5:819f7c40 r4:819f7c40 spi_nor_detect from spi_nor_scan+0x11c/0xbec r10:bb7bf4e0 r9:00000000 r8:00000000 r7:c083da4c r6:00000000 r5:00010101 r4:819f7c40 spi_nor_scan from spi_nor_probe+0x10c/0x2d0 r10:bb7bf4e0 r9:bb7bf4d0 r8:00000000 r7:819f4c00 r6:00000000 r5:00000000 r4:819f7c40 per-cpu access needs to be guarded against preemption. Fixes: 6598b91b ("spi: spi.c: Convert statistics to per-cpu u64_stats_t") Reported-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David Jander <david@protonic.nl> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Link: https://lore.kernel.org/r/20220609121334.2984808-1-david@protonic.nlSigned-off-by: Mark Brown <broonie@kernel.org>
-
Andy Chiu authored
The patch has been tested on Unmatched using pm_test. The Unmatched board uses SD over SPI and it was tested by initiating S2RAM cycles for all devices while reading/writing files at the same time. We found no dropped connection to the card or corrupted filesystem during test cycles. Signed-off-by: Andy Chiu <andy.chiu@sifive.com> Reviewed-by: Greentime Hu <greentime.hu@sifive.com> Link: https://lore.kernel.org/r/20220610074459.3261383-2-andy.chiu@sifive.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 09 Jun, 2022 5 commits
-
-
Claudiu Beznea authored
Align condition to parenthesis. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220609084246.1795419-4-claudiu.beznea@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Claudiu Beznea authored
Use pm_ptr() for atmel_quadspi_pm_ops. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220609084246.1795419-3-claudiu.beznea@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Claudiu Beznea authored
Add runtime PM support for atmel-quadspi which will disable/enable QSPI clocks on proper runtime_suspend/runtime_resume ops. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220609084246.1795419-2-claudiu.beznea@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Yang Li authored
Return boolean values ("true" or "false") instead of 1 or 0 from bool function. As reported by coccicheck: ./drivers/spi/spi-s3c64xx.c:385:9-10: WARNING: return of 0/1 in function 's3c64xx_spi_can_dma' with return type bool Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220609071250.59509-1-yang.lee@linux.alibaba.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Yang Li authored
Remove .owner field if calls are used which set it automatically. Eliminate the following coccicheck warning: ./drivers/spi/spi-microchip-core.c:624:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20220609055533.95866-1-yang.lee@linux.alibaba.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 08 Jun, 2022 2 commits
-
-
David Jander authored
Fixes these "make htmldocs" warnings: include/linux/spi/spi.h:82: warning: Function parameter or member 'syncp' not described in 'spi_statistics' include/linux/spi/spi.h:213: warning: Function parameter or member 'pcpu_statistics' not described in 'spi_device' include/linux/spi/spi.h:676: warning: Function parameter or member 'pcpu_statistics' not described in 'spi_controller' Fixes: 6598b91b ("spi: spi.c: Convert statistics to per-cpu u64_stats_t") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David Jander <david@protonic.nl> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220608153309.2899565-1-david@protonic.nlSigned-off-by: Mark Brown <broonie@kernel.org>
-
Colin Ian King authored
There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Link: https://lore.kernel.org/r/20220608081912.2083086-1-colin.i.king@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 07 Jun, 2022 5 commits
-
-
Mark Brown authored
Merge series from Conor Dooley <conor.dooley@microchip.com>: Add support for the PolatFire SoC SPI controller, the DT binding was added previously.
-
Biju Das authored
Document RZ/G2U2L SSI bindings. RZ/G2UL SSI is identical to one found on the RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rz-ssi" will be used as a fallback. While at it add a '.' at the end of dmas description for the first cell. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20220607124231.3248-1-biju.das.jz@bp.renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Conor Dooley authored
Add the newly introduced spi driver to the existing PolarFire SoC entry. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20220607073833.2331539-3-conor.dooley@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Conor Dooley authored
Add a driver for Microchip FPGA SPI controllers, specifically supporting the "hard" controllers on PolarFire SoC. Co-developed-by: Daire McNamara <daire.mcnamara@microchip.com> Signed-off-by: Daire McNamara <daire.mcnamara@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20220607073833.2331539-2-conor.dooley@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mark Brown authored
Merge series from patrice.chotard@foss.st.com <patrice.chotard@foss.st.com>: This series cleans up spi-stm32-qspi driver by removing unused parameters
-
- 06 Jun, 2022 12 commits
-
-
Atsushi Nemoto authored
The spi-ti-qspi driver initializes its spi clock by the spi-max-frequency property from the controller node, and ignores per-transfer (and per-slave) speed_hz settings. Isolate clock settings out from ti_qspi_setup() and call it from ti_qspi_start_transfer_one() and ti_qspi_exec_mem_op(), using per-transfer speed_hz and per-slave max_speed_hz settings. Also drop spi_max_frequency from struct ti_qspi and use spi_master's max_speed_hz. Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp> Link: https://lore.kernel.org/r/20220519.084604.966119051165023533.atsushi.nemoto@sord.co.jpSigned-off-by: Mark Brown <broonie@kernel.org>
-
David Jander authored
This change gives a dramatic performance improvement in the hot path, since many costly spin_lock_irqsave() calls can be avoided. On an i.MX8MM system with a MCP2518FD CAN controller connected via SPI, the time the driver takes to handle interrupts, or in other words the time the IRQ line of the CAN controller stays low is mainly dominated by the time it takes to do 3 relatively short sync SPI transfers. The effect of this patch is a reduction of this time from 136us down to only 98us. Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David Jander <david@protonic.nl> Link: https://lore.kernel.org/r/20220524091808.2269898-1-david@protonic.nlSigned-off-by: Mark Brown <broonie@kernel.org>
-
Rob Herring authored
SPI bus per device properties must be defined in spi-peripheral-props.yaml for unevaluatedProperties checks to work correctly on device nodes. This has the side effect of promoting 'rx-sample-delay-ns' to be a common property, but functionally it's no different if it was defined in a Synopsys specific schema file. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220525210053.2488756-1-robh@kernel.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Christophe JAILLET authored
We should have 'n', then 'size', not the opposite. This is harmless because the 2 values are just multiplied, but having the correct order silence a (unpublished yet) smatch warning. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/d114558dd0351b863ced8cc01b31754a5a4b960d.1653116362.git.christophe.jaillet@wanadoo.frSigned-off-by: Mark Brown <broonie@kernel.org>
-
Amit Kumar Mahapatra authored
ZynqMP GQSPI controller can support up to two chip selects but the current GQSPI driver only support CS0. With this update and num-cs DT property set to 2 GQSPI driver can now support two slave devices each connected to one chip select. GQSPI driver configures the Lower CS and Upper CS based on the reg DT property. Changes tested on ZynqMP board with two SPI-NOR flashes each connected to a different CS. Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com> Link: https://lore.kernel.org/r/20220512145820.20425-1-amit.kumar-mahapatra@xilinx.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Julia Lawall authored
Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Link: https://lore.kernel.org/r/20220521111145.81697-13-Julia.Lawall@inria.frSigned-off-by: Mark Brown <broonie@kernel.org>
-
Fabien Parent authored
Add binding documentation for the MT8365 SoC. Signed-off-by: Fabien Parent <fparent@baylibre.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220531135026.238475-10-fparent@baylibre.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Vaishnav Achath authored
Currently the spi_master is allocated by devm_spi_alloc_master() and devres core manages the deallocation, but in probe failure path spi_master_put() is being handled manually which causes "refcount underflow use-after-free" warning when probe failure happens after allocating spi_master. Trimmed backtrace during failure: refcount_t: underflow; use-after-free. pc : refcount_warn_saturate+0xf4/0x144 Call trace: refcount_warn_saturate kobject_put put_device devm_spi_release_controller devres_release_all This commit makes relevant changes to remove spi_master_put() from probe failure path. Fixes: 606e5d40 ("spi: cadence-quadspi: Handle spi_unregister_master() in remove()") Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com> Link: https://lore.kernel.org/r/20220601071611.11853-1-vaishnav.a@ti.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Adithya K V authored
Current s3c64xx SPI driver acquires DMA channel during driver probe and holds on it even when channels are not used (no DMA transfer). This is a problem especially when all the DMA channels are exhausted (as other IPs on the same DMA controller also acquires DMA channel) and if a new IP/Device requests for a DMA channel (on the same DMA controller), it won’t get DMA channel allocated. The said issue can be avoided if s3c64xx driver request and release DMA channel before and after data transfer. Let’s modify the driver to request and release DMA channel before and after DMA mode data transfer. Signed-off-by: Adithya K V <adithya.kv@samsung.com> Link: https://lore.kernel.org/r/20220524140132.59300-1-adithya.kv@samsung.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Christophe JAILLET authored
The spi_alloc_master() call is not undone in all error handling paths. Moreover, there is no .remove function to release the allocated memory. In order to fix both this issues, switch to devm_spi_alloc_master(). This allows further simplification of the probe. Fixes: ba2fc167 ("spi: altera: Add DFL bus driver for Altera API Controller") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/0607bb59f4073f86abe5c585d35245aef0b045c6.1653805901.git.christophe.jaillet@wanadoo.frSigned-off-by: Mark Brown <broonie@kernel.org>
-
Patrice Chotard authored
op parameter is not used, remove it. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Link: https://lore.kernel.org/r/20220602092540.369604-4-patrice.chotard@foss.st.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Patrice Chotard authored
struct spi_mem_op *op parameter is no more used, remove it. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Link: https://lore.kernel.org/r/20220602092540.369604-3-patrice.chotard@foss.st.comSigned-off-by: Mark Brown <broonie@kernel.org>
-