<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/spi, branch v4.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-03-24T17:38:44Z</updated>
<entry>
<title>Merge remote-tracking branches 'spi/fix/dw', 'spi/fix/queue' and 'spi/fix/qup' into spi-linus</title>
<updated>2015-03-24T17:38:44Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2015-03-24T17:38:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=072ac04d31b14647e9835b1a699ebe3413e5d222'/>
<id>urn:sha1:072ac04d31b14647e9835b1a699ebe3413e5d222</id>
<content type='text'>
</content>
</entry>
<entry>
<title>spi: trigger trace event for message-done before mesg-&gt;complete</title>
<updated>2015-03-18T11:34:10Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2015-03-18T10:27:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=391949b6f02121371e3d7d9082c6d17fd9853034'/>
<id>urn:sha1:391949b6f02121371e3d7d9082c6d17fd9853034</id>
<content type='text'>
With spidev the mesg-&gt;complete callback points to spidev_complete.
Calling this unblocks spidev_sync and so spidev_sync_write finishes. As
the struct spi_message just read is a local variable in
spidev_sync_write and recording the trace event accesses this message
the recording is better done first. The same can happen for
spidev_sync_read.

This fixes an oops observed on a 3.14-rt system with spidev activity
after

	echo 1 &gt; /sys/kernel/debug/tracing/events/spi/enable

.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>spi: dw-mid: clear BUSY flag fist and test other one</title>
<updated>2015-03-07T11:22:02Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2015-03-06T12:42:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=854d2f241d71f6ca08ccde30e6c7c2e403363e52'/>
<id>urn:sha1:854d2f241d71f6ca08ccde30e6c7c2e403363e52</id>
<content type='text'>
The logic of DMA completion is broken now since test_and_clear_bit() never
returns the other bit is set. It means condition are always false and we have
spi_finalize_current_transfer() called per each DMA completion which is wrong.

The patch fixes logic by clearing BUSY bit first and then check for the other
one.

Fixes: 30c8eb52cc4a (spi: dw-mid: split rx and tx callbacks when DMA)
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>spi: qup: Fix cs-num DT property parsing</title>
<updated>2015-03-07T11:00:51Z</updated>
<author>
<name>Ivan T. Ivanov</name>
<email>iivanov@mm-sol.com</email>
</author>
<published>2015-03-06T15:26:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12cb89e37a0c25fae7a0f1d2e4985558db9d0b13'/>
<id>urn:sha1:12cb89e37a0c25fae7a0f1d2e4985558db9d0b13</id>
<content type='text'>
num-cs is 32 bit property, don't read just upper 16 bits.

Fixes: 4a8573abe965 (spi: qup: Remove chip select function)
Signed-off-by: Ivan T. Ivanov &lt;iivanov@mm-sol.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>Merge remote-tracking branches 'spi/fix/atmel', 'spi/fix/doc', 'spi/fix/dw', 'spi/fix/img-spfi', 'spi/fix/pl022' and 'spi/fix/ti-qspi' into spi-linus</title>
<updated>2015-03-06T21:10:56Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2015-03-06T21:10:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=60c1beeff40b04097298e10640580f62420a55ca'/>
<id>urn:sha1:60c1beeff40b04097298e10640580f62420a55ca</id>
<content type='text'>
</content>
</entry>
<entry>
<title>spi: pl022: Fix race in giveback() leading to driver lock-up</title>
<updated>2015-03-06T19:45:55Z</updated>
<author>
<name>Alexander Sverdlin</name>
<email>alexander.sverdlin@nokia.com</email>
</author>
<published>2015-02-27T15:30:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cd6fa8d2ca53cac3226fdcffcf763be390abae32'/>
<id>urn:sha1:cd6fa8d2ca53cac3226fdcffcf763be390abae32</id>
<content type='text'>
Commit fd316941c ("spi/pl022: disable port when unused") introduced a race,
which leads to possible driver lock up (easily reproducible on SMP).

The problem happens in giveback() function where the completion of the transfer
is signalled to SPI subsystem and then the HW SPI controller is disabled. Another
transfer might be setup in between, which brings driver in locked-up state.

Exact event sequence on SMP:

core0                                   core1

                                        =&gt; pump_transfers()
                                        /* message-&gt;state == STATE_DONE */
                                          =&gt; giveback()
                                            =&gt; spi_finalize_current_message()

=&gt; pl022_unprepare_transfer_hardware()
=&gt; pl022_transfer_one_message
  =&gt; flush()
  =&gt; do_interrupt_dma_transfer()
    =&gt; set_up_next_transfer()
    /* Enable SSP, turn on interrupts */
    writew((readw(SSP_CR1(pl022-&gt;virtbase)) |
           SSP_CR1_MASK_SSE), SSP_CR1(pl022-&gt;virtbase));

...

=&gt; pl022_interrupt_handler()
  =&gt; readwriter()

                                        /* disable the SPI/SSP operation */
                                        =&gt; writew((readw(SSP_CR1(pl022-&gt;virtbase)) &amp;
                                                  (~SSP_CR1_MASK_SSE)), SSP_CR1(pl022-&gt;virtbase));

Lockup! SPI controller is disabled and the data will never be received. Whole
SPI subsystem is waiting for transfer ACK and blocked.

So, only signal transfer completion after disabling the controller.

Fixes: fd316941c (spi/pl022: disable port when unused)
Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@nokia.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>spi: dw-mid: avoid potential NULL dereference</title>
<updated>2015-03-06T11:23:26Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2015-03-02T18:15:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c9dafb27c84412fe4b17c3b94cc4ffeef5df1833'/>
<id>urn:sha1:c9dafb27c84412fe4b17c3b94cc4ffeef5df1833</id>
<content type='text'>
When DMA descriptor allocation fails we should not try to assign any fields in
the bad descriptor. The patch adds the necessary checks for that.

Fixes: 7063c0d942a1 (spi/dw_spi: add DMA support)
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>spi: img-spfi: Verify max spfi transfer length</title>
<updated>2015-03-03T14:26:34Z</updated>
<author>
<name>Sifan Naeem</name>
<email>sifan.naeem@imgtec.com</email>
</author>
<published>2015-03-02T16:06:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f165ed63370cfcc3a459cbd855822559f375a538'/>
<id>urn:sha1:f165ed63370cfcc3a459cbd855822559f375a538</id>
<content type='text'>
Maximum transfer length supported by SPFI is 65535, this is limited
by the number of bits available in SPFI TSize register to represent
the transfer size.
For transfer requests larger than the maximum supported the driver
will return an invalid argument error.

Signed-off-by: Sifan Naeem &lt;sifan.naeem@imgtec.com&gt;
Reviewed-by: Andrew Bresticker &lt;abrestic@chromium.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: atmel: Fix interrupt setup for PDC transfers</title>
<updated>2015-02-26T02:34:23Z</updated>
<author>
<name>Torsten Fleischer</name>
<email>torfl6749@gmail.com</email>
</author>
<published>2015-02-24T15:32:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=76e1d14b316d6f501ebc001e7a5d86b24ce5b615'/>
<id>urn:sha1:76e1d14b316d6f501ebc001e7a5d86b24ce5b615</id>
<content type='text'>
Additionally to the current DMA transfer the PDC allows to set up a next DMA
transfer. This is useful for larger SPI transfers.

The driver currently waits for ENDRX as end of the transfer. But ENDRX is set
when the current DMA transfer is done (RCR = 0), i.e. it doesn't include the
next DMA transfer.
Thus a subsequent SPI transfer could be started although there is currently a
transfer in progress. This can cause invalid accesses to the SPI slave devices
and to SPI transfer errors.

This issue has been observed on a hardware with a M25P128 SPI NOR flash.

So instead of ENDRX we should wait for RXBUFF. This flag is set if there is
no more DMA transfer in progress (RCR = RNCR = 0).

Signed-off-by: Torsten Fleischer &lt;torfl6749@gmail.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>spi: dw: revisit FIFO size detection again</title>
<updated>2015-02-26T02:09:51Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2015-02-25T09:39:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9d239d353c319f9ff884c287ce47feb7cdf60ddc'/>
<id>urn:sha1:9d239d353c319f9ff884c287ce47feb7cdf60ddc</id>
<content type='text'>
The commit d297933cc7fc (spi: dw: Fix detecting FIFO depth) tries to fix the
logic of the FIFO detection based on the description on the comments. However,
there is a slight difference between numbers in TX Level and TX FIFO size.

So, by specification the FIFO size would be in a range 2-256 bytes. From TX
Level prospective it means we can set threshold in the range 0-(FIFO size - 1)
bytes. Hence there are currently two issues:
  a) FIFO size 2 bytes is actually skipped since TX Level is 1 bit and could be
     either 0 or 1 byte;
  b) FIFO size is incorrectly decreased by 1 which already done by meaning of
     TX Level register.

This patch fixes it eventually right.

Fixes: d297933cc7fc (spi: dw: Fix detecting FIFO depth)
Reviewed-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
</feed>
