- 24 11月, 2017 1 次提交
-
-
由 Ricardo Ribalda 提交于
When the core is configured in C_SPI_MODE > 0, it integrates a lookup table that automatically configures the core in dual or quad mode based on the command (first byte on the tx fifo). Unfortunately, that list mode_?_memoy_*.mif does not contain all the supported commands by the flash. Since 4.14 spi-nor automatically tries to probe the flash using SFDP (command 0x5a), and that command is not part of the list_mode table. Whit the right combination of C_SPI_MODE and C_SPI_MEMORY this leads into a stall that can only be recovered with a soft rest. This patch detects this kind of stall and returns -EIO to the caller on those commands. spi-nor can handle this error properly: m25p80 spi0.0: Detected stall. Check C_SPI_MODE and C_SPI_MEMORY. 0x21 0x2404 m25p80 spi0.0: SPI transfer failed: -5 spi_master spi0: failed to transfer one message from queue m25p80 spi0.0: s25sl064p (8192 Kbytes) Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 15 7月, 2016 2 次提交
-
-
由 Lars-Peter Clausen 提交于
Return IRQ_NONE from the interrupt handler if the handler is running, but no interrupt was detected. This allows the system to recover in case of an interrupt storm due to an invalid interrupt configuration or faulty hardware. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Acked-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lars-Peter Clausen 提交于
The Xilinx SPI driver can operate without an IRQ, but not every error returned by platform_get_irq() means that no IRQ was specified. It will also return an error if the IRQ specification is invalid or the IRQ provider is not yet available (EPROBE_DEFER). So instead of ignoring all errors only ignore ENXIO, which means no IRQ was specified, and propagate all other errors to device driver core. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Acked-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 10月, 2015 1 次提交
-
-
由 Ricardo Ribalda Delgado 提交于
Some users have reported that in polled mode the driver fails randomly to read the last word of the transfer. The end condition used for the transmissions (in polled and irq mode) has been the TX_EMPTY flag. But Lars-Peter Clausen has identified a delay from the TX_EMPTY to the actual end of the data rx. I believe that this race condition has not been detected until now because of the latency added by the IRQ handler or the PCIe bridge. This bugs affects setups with low latency access to the spi core. This patch replaces the readout logic: For all the words, except the last one, the TX_EMPTY flag is used (and cached). If !TX_EMPY or is the last word. The status register is read and the RX_EMPTY flag is used. The performance is not affected: there is an extra read of the Status Register, but the readout can start as soon as there is a word in the buffer. Reported-by: NEdward Kigwana <ekigwana@scires.com> Initial-fix-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 14 8月, 2015 1 次提交
-
-
由 Ricardo Ribalda Delgado 提交于
The ACK of an inexistent IRQ can trigger an spurious IRQ that breaks the txrx logic. This has been observed on axi_quad_spi:3.2 core. This patch only ACKs IRQs that have not been Acknowledge jet. Reported-by: NEdward Kigwana <ekigwana@scires.com> Tested-by: NEdward Kigwana <ekigwana@scires.com> Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 13 8月, 2015 1 次提交
-
-
由 Ricardo Ribalda Delgado 提交于
Once the module process a transfer in irq mode, the next poll transfer will not work because the transmitter is left in inhibited state. Fixes: 22417352 (Use polling mode on small transfers) Reported-by: NEdward Kigwana <ekigwana@scires.com> Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 02 2月, 2015 1 次提交
-
-
由 Ricardo Ribalda Delgado 提交于
On 1 and 2 bytes per word, the transfer of the 3 last bytes will access memory outside tx_ptr. Although this has not trigger any error on real hardware, we should better fix this. Fixes: 24ba5e59 (Remove rx_fn and tx_fn pointer) Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 1月, 2015 1 次提交
-
-
由 Mark Brown 提交于
This reverts commit 99082eab since it breaks the build due to differing implementations of iowrite() and ioread(). Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 1月, 2015 15 次提交
-
-
由 Ricardo Ribalda 提交于
The core only supports up to 32 slaves, and the chipselect function expects the same. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Small transfers generally can be accomplished faster in polling mode. This patch select the transfer which size is bellow the buffer size to be done on polling mode Suggested-by: NMark Brown <broonie@kernel.org> Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
The variable never leaves the scope of txrx_bufs. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Save a stack level and cleanup code. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Simplify the code by using the unit used on most of the code logic. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Simplify the code by using the unit used on most of the code logic. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
spi_rx handles the case where the buffer is null. Nevertheless spi_tx did not handle it, and was handled by the caller function. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Simplify the code by removing the tx and and rx function pointers and substitute them by a single function. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
The core controls the chip select lines individually. By default, all the lines are consider active_low. After spi_setup_transfer, it has its real value. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
When no irq is used, there is no need to inhibit the transmission for every transaction. This inhibition was implemented to avoid a race condition with the irq handler. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
The core can run in polling mode. In fact, the performance of the core is similar (or even better), due to the fact most of the spi transactions are just a couple of bytes and there is one irq per transactions. When an mtd device is connected via spi, reading 8MB of data produces more than 80K interrupts (with irq disabling, context swith....) Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
The control register has not changed since the previous access. Therefore we can use the cached value and safe one bus access. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
On the transmission loop, check for remaining bytes at the loop condition. This way we can handle transmissions of 0 bytes and clean the code. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Instead of enabling the IRQ and disabling it for every transaction. Specially the small transactions (1,2 words) benefit from removing 3 bus accesses. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Instead of checking the TX_FULL flag for every transaction, find out the size of the buffer at probe time and use it. To avoid situations where the core had some data on the buffer before initialization, the core is reseted before the buffer size is detected Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 28 1月, 2015 1 次提交
-
-
由 Ricardo Ribalda Delgado 提交于
The number of words in the read buffer will be exactly the same as the number of words written on write buffer, once the transaction has finished. Instead of cheking the rx_empty flags for every word simply save the number of words written by fill_tx_fifo. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 27 1月, 2015 2 次提交
-
-
由 Ricardo Ribalda Delgado 提交于
Hardware supports LOOP mode. Support it also in the driver. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Hardware supports LSB_FIRST mode. Support it also in the driver. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 8月, 2014 1 次提交
-
-
由 Michal Simek 提交于
There is no need to init .owner field. Based on the patch from Peter Griffin <peter.griffin@linaro.org> "mmc: remove .owner field for drivers using module_platform_driver" This patch removes the superflous .owner field for drivers which use the module_platform_driver API, as this is overriden in platform_driver_register anyway." Signed-off-by: NMichal Simek <michal.simek@xilinx.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 10 7月, 2014 1 次提交
-
-
由 Lars-Peter Clausen 提交于
The Xilinx SPI driver initializes the bus_num field of the SPI master to pdev->dev.id. pdev->dev.id is always 0 for platform devices which causes bus number conflicts for the SPI controller when creating multiple device instances of the driver. Instead use pdev->id which will have the assignt platform device id. If the device is instantiated via devicetree pdev->id is -1 which will cause the SPI core to dynamically assign a id (or use the id defined via a alias in the devicetree). Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 27 2月, 2014 1 次提交
-
-
由 Jingoo Han 提交于
Remove unnecessary space in order to fix the following checkpatch issues. WARNING: Unnecessary space after function pointer name Signed-off-by: NJingoo Han <jg1.han@samsung.com> Reviewed-by: NMichal Simek <monstr@monstr.eu> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 23 2月, 2014 1 次提交
-
-
由 Axel Lin 提交于
Set bits_per_word_mask so spi core will reject transfers that attempt to use an unsupported bits_per_word value. spi_bitbang requires custom setup_transfer() to be defined if there is a custom txrx_bufs(). Thus keep the empty xilinx_spi_setup_transfer() function in the code. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Acked-by: NMichal Simek <michal.simek@xilinx.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 03 2月, 2014 1 次提交
-
-
由 Paul Gortmaker 提交于
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 15 11月, 2013 1 次提交
-
-
由 Wolfram Sang 提交于
Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 07 10月, 2013 1 次提交
-
-
由 Axel Lin 提交于
Many drivers that use bitbang library have a leak on probe error paths. This is because once a spi_master_get() call succeeds, we need an additional spi_master_put() call to free the memory. Fix this issue by moving the code taking a reference to master to spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on success. With this change, the caller is responsible for calling spi_bitbang_stop() to decrement the reference and spi_master_put() as counterpart of spi_alloc_master() to prevent a memory leak. So now we have below patten for drivers using bitbang library: probe: spi_alloc_master -> Init reference count to 1 spi_bitbang_start -> Increment reference count remove: spi_bitbang_stop -> Decrement reference count spi_master_put -> Decrement reference count (reference count reaches 0) Fixup all users accordingly. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Suggested-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Acked-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 17 9月, 2013 1 次提交
-
-
由 Axel Lin 提交于
Many drivers that use bitbang library have a leak on probe error paths. This is because once a spi_master_get() call succeeds, we need an additional spi_master_put() call to free the memory. Fix this issue by moving the code taking a reference to master to spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on success. With this change, the caller is responsible for calling spi_bitbang_stop() to decrement the reference and spi_master_put() as counterpart of spi_alloc_master() to prevent a memory leak. So now we have below patten for drivers using bitbang library: probe: spi_alloc_master -> Init reference count to 1 spi_bitbang_start -> Increment reference count remove: spi_bitbang_stop -> Decrement reference count spi_master_put -> Decrement reference count (reference count reaches 0) Fixup all users accordingly. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Suggested-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Acked-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 29 8月, 2013 1 次提交
-
-
由 Jingoo Han 提交于
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: NJingoo Han <jg1.han@samsung.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 10 8月, 2013 1 次提交
-
-
由 Mark Brown 提交于
Now that the bitbang core does not require a setup() function we can drop the check in the altera, nuc900 and xilinx drivers. Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 18 7月, 2013 1 次提交
-
-
由 Dan Carpenter 提交于
In xilinx_spi_probe() we use xspi->irq to store negative error codes so it has to be signed. We weren't going to use the upper bit any way so this is fine. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 15 7月, 2013 3 次提交
-
-
由 Michal Simek 提交于
Use devm_request_irq() for irq allocation which simplify driver code. Signed-off-by: NMichal Simek <michal.simek@xilinx.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
由 Michal Simek 提交于
It simplifies driver probing. Signed-off-by: NMichal Simek <michal.simek@xilinx.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
由 Michal Simek 提交于
devm_ioremap_resource() automatically checks that struct resource is initialized. Also group platform_get_resource() and devm_ioremap_resource() together. And remove mem resource from struct xilinx_spi. Signed-off-by: NMichal Simek <michal.simek@xilinx.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-