<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/spi, branch v5.3.17</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>spi: Fix NULL pointer when setting SPI_CS_HIGH for GPIO CS</title>
<updated>2019-12-13T07:49:37+00:00</updated>
<author>
<name>Gregory CLEMENT</name>
<email>gregory.clement@bootlin.com</email>
</author>
<published>2019-10-24T14:13:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e081b64f18b420a12c9eff18c7e1e35753db249d'/>
<id>e081b64f18b420a12c9eff18c7e1e35753db249d</id>
<content type='text'>
commit 15f794bd977a0135328fbdd8a83cc64c1d267b39 upstream.

Even if the flag use_gpio_descriptors is set, it is possible that
cs_gpiods was not allocated, which leads to a kernel crash.

Reported-by: "kernelci.org bot" &lt;bot@kernelci.org&gt;
Fixes: 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH setting when using native and GPIO CS")
Signed-off-by: Gregory CLEMENT &lt;gregory.clement@bootlin.com&gt;
Link: https://lore.kernel.org/r/20191024141309.22434-1-gregory.clement@bootlin.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 15f794bd977a0135328fbdd8a83cc64c1d267b39 upstream.

Even if the flag use_gpio_descriptors is set, it is possible that
cs_gpiods was not allocated, which leads to a kernel crash.

Reported-by: "kernelci.org bot" &lt;bot@kernelci.org&gt;
Fixes: 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH setting when using native and GPIO CS")
Signed-off-by: Gregory CLEMENT &lt;gregory.clement@bootlin.com&gt;
Link: https://lore.kernel.org/r/20191024141309.22434-1-gregory.clement@bootlin.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>spi: Fix SPI_CS_HIGH setting when using native and GPIO CS</title>
<updated>2019-12-13T07:49:36+00:00</updated>
<author>
<name>Gregory CLEMENT</name>
<email>gregory.clement@bootlin.com</email>
</author>
<published>2019-10-18T15:29:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6639dc50f844c9ef0a13c86b13f3b5d64cbc926e'/>
<id>6639dc50f844c9ef0a13c86b13f3b5d64cbc926e</id>
<content type='text'>
commit 3e5ec1db8bfee845d9f8560d1c64aeaccd586398 upstream.

When improving the CS GPIO support at core level, the SPI_CS_HIGH
has been enabled for all the CS lines used for a given SPI controller.

However, the SPI framework allows to have on the same controller native
CS and GPIO CS. The native CS may not support the SPI_CS_HIGH, so they
should not be setup automatically.

With this patch the setting is done only for the CS that will use a
GPIO as CS

Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Gregory CLEMENT &lt;gregory.clement@bootlin.com&gt;
Link: https://lore.kernel.org/r/20191018152929.3287-1-gregory.clement@bootlin.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3e5ec1db8bfee845d9f8560d1c64aeaccd586398 upstream.

When improving the CS GPIO support at core level, the SPI_CS_HIGH
has been enabled for all the CS lines used for a given SPI controller.

However, the SPI framework allows to have on the same controller native
CS and GPIO CS. The native CS may not support the SPI_CS_HIGH, so they
should not be setup automatically.

With this patch the setting is done only for the CS that will use a
GPIO as CS

Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Gregory CLEMENT &lt;gregory.clement@bootlin.com&gt;
Link: https://lore.kernel.org/r/20191018152929.3287-1-gregory.clement@bootlin.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>spi: atmel: Fix CS high support</title>
<updated>2019-12-13T07:49:35+00:00</updated>
<author>
<name>Gregory CLEMENT</name>
<email>gregory.clement@bootlin.com</email>
</author>
<published>2019-10-17T14:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f857d1baef9e625cc5dd4e311e836f0ca0c5c4e6'/>
<id>f857d1baef9e625cc5dd4e311e836f0ca0c5c4e6</id>
<content type='text'>
commit 7cbb16b2122c09f2ae393a1542fed628505b9da6 upstream.

Until a few years ago, this driver was only used with CS GPIO. The
only exception is CS0 on AT91RM9200 which has to use internal CS. A
limitation of the internal CS is that they don't support CS High.

So by using the CS GPIO the CS high configuration was available except
for the particular case CS0 on RM9200.

When the support for the internal chip-select was added, the check of
the CS high support was not updated. Due to this the driver accepts
this configuration for all the SPI controller v2 (used by all SoCs
excepting the AT91RM9200) whereas the hardware doesn't support it for
infernal CS.

This patch fixes the test to match the hardware capabilities.

Fixes: 4820303480a1 ("spi: atmel: add support for the internal chip-select of the spi controller")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Gregory CLEMENT &lt;gregory.clement@bootlin.com&gt;
Link: https://lore.kernel.org/r/20191017141846.7523-3-gregory.clement@bootlin.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7cbb16b2122c09f2ae393a1542fed628505b9da6 upstream.

Until a few years ago, this driver was only used with CS GPIO. The
only exception is CS0 on AT91RM9200 which has to use internal CS. A
limitation of the internal CS is that they don't support CS High.

So by using the CS GPIO the CS high configuration was available except
for the particular case CS0 on RM9200.

When the support for the internal chip-select was added, the check of
the CS high support was not updated. Due to this the driver accepts
this configuration for all the SPI controller v2 (used by all SoCs
excepting the AT91RM9200) whereas the hardware doesn't support it for
infernal CS.

This patch fixes the test to match the hardware capabilities.

Fixes: 4820303480a1 ("spi: atmel: add support for the internal chip-select of the spi controller")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Gregory CLEMENT &lt;gregory.clement@bootlin.com&gt;
Link: https://lore.kernel.org/r/20191017141846.7523-3-gregory.clement@bootlin.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>spi: stm32-qspi: Fix kernel oops when unbinding driver</title>
<updated>2019-12-13T07:49:35+00:00</updated>
<author>
<name>Patrice Chotard</name>
<email>patrice.chotard@st.com</email>
</author>
<published>2019-10-04T12:36:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=77916ba882737caa619fc01d80be1340c70a3968'/>
<id>77916ba882737caa619fc01d80be1340c70a3968</id>
<content type='text'>
commit 3c0af1dd2fe78adc02fe21f6cfe7d6cb8602573e upstream.

spi_master_put() must only be called in .probe() in case of error.

As devm_spi_register_master() is used during probe, spi_master_put()
mustn't be called in .remove() callback.

It fixes the following kernel WARNING/Oops when executing
echo "58003000.spi" &gt; /sys/bus/platform/drivers/stm32-qspi/unbind :

------------[ cut here ]------------
WARNING: CPU: 1 PID: 496 at fs/kernfs/dir.c:1504 kernfs_remove_by_name_ns+0x9c/0xa4
kernfs: can not remove 'uevent', no directory
Modules linked in:
CPU: 1 PID: 496 Comm: sh Not tainted 5.3.0-rc1-00219-ga0e07bb51a37 #62
Hardware name: STM32 (Device Tree Support)
[&lt;c0111570&gt;] (unwind_backtrace) from [&lt;c010d384&gt;] (show_stack+0x10/0x14)
[&lt;c010d384&gt;] (show_stack) from [&lt;c08db558&gt;] (dump_stack+0xb4/0xc8)
[&lt;c08db558&gt;] (dump_stack) from [&lt;c01209d8&gt;] (__warn.part.3+0xbc/0xd8)
[&lt;c01209d8&gt;] (__warn.part.3) from [&lt;c0120a5c&gt;] (warn_slowpath_fmt+0x68/0x8c)
[&lt;c0120a5c&gt;] (warn_slowpath_fmt) from [&lt;c02e5844&gt;] (kernfs_remove_by_name_ns+0x9c/0xa4)
[&lt;c02e5844&gt;] (kernfs_remove_by_name_ns) from [&lt;c05833a4&gt;] (device_del+0x128/0x358)
[&lt;c05833a4&gt;] (device_del) from [&lt;c05835f8&gt;] (device_unregister+0x24/0x64)
[&lt;c05835f8&gt;] (device_unregister) from [&lt;c0638dac&gt;] (spi_unregister_controller+0x88/0xe8)
[&lt;c0638dac&gt;] (spi_unregister_controller) from [&lt;c058c580&gt;] (release_nodes+0x1bc/0x200)
[&lt;c058c580&gt;] (release_nodes) from [&lt;c0588a44&gt;] (device_release_driver_internal+0xec/0x1ac)
[&lt;c0588a44&gt;] (device_release_driver_internal) from [&lt;c0586840&gt;] (unbind_store+0x60/0xd4)
[&lt;c0586840&gt;] (unbind_store) from [&lt;c02e64e8&gt;] (kernfs_fop_write+0xe8/0x1c4)
[&lt;c02e64e8&gt;] (kernfs_fop_write) from [&lt;c0266b44&gt;] (__vfs_write+0x2c/0x1c0)
[&lt;c0266b44&gt;] (__vfs_write) from [&lt;c02694c0&gt;] (vfs_write+0xa4/0x184)
[&lt;c02694c0&gt;] (vfs_write) from [&lt;c0269710&gt;] (ksys_write+0x58/0xd0)
[&lt;c0269710&gt;] (ksys_write) from [&lt;c0101000&gt;] (ret_fast_syscall+0x0/0x54)
Exception stack(0xdd289fa8 to 0xdd289ff0)
9fa0:                   0000006c 000e20e8 00000001 000e20e8 0000000d 00000000
9fc0: 0000006c 000e20e8 b6f87da0 00000004 0000000d 0000000d 00000000 00000000
9fe0: 00000004 bee639b0 b6f2286b b6eaf6c6
---[ end trace 1b15df8a02d76aef ]---
------------[ cut here ]------------
WARNING: CPU: 1 PID: 496 at fs/kernfs/dir.c:1504 kernfs_remove_by_name_ns+0x9c/0xa4
kernfs: can not remove 'online', no directory
Modules linked in:
CPU: 1 PID: 496 Comm: sh Tainted: G        W         5.3.0-rc1-00219-ga0e07bb51a37 #62
Hardware name: STM32 (Device Tree Support)
[&lt;c0111570&gt;] (unwind_backtrace) from [&lt;c010d384&gt;] (show_stack+0x10/0x14)
[&lt;c010d384&gt;] (show_stack) from [&lt;c08db558&gt;] (dump_stack+0xb4/0xc8)
[&lt;c08db558&gt;] (dump_stack) from [&lt;c01209d8&gt;] (__warn.part.3+0xbc/0xd8)
[&lt;c01209d8&gt;] (__warn.part.3) from [&lt;c0120a5c&gt;] (warn_slowpath_fmt+0x68/0x8c)
[&lt;c0120a5c&gt;] (warn_slowpath_fmt) from [&lt;c02e5844&gt;] (kernfs_remove_by_name_ns+0x9c/0xa4)
[&lt;c02e5844&gt;] (kernfs_remove_by_name_ns) from [&lt;c0582488&gt;] (device_remove_attrs+0x20/0x5c)
[&lt;c0582488&gt;] (device_remove_attrs) from [&lt;c05833b0&gt;] (device_del+0x134/0x358)
[&lt;c05833b0&gt;] (device_del) from [&lt;c05835f8&gt;] (device_unregister+0x24/0x64)
[&lt;c05835f8&gt;] (device_unregister) from [&lt;c0638dac&gt;] (spi_unregister_controller+0x88/0xe8)
[&lt;c0638dac&gt;] (spi_unregister_controller) from [&lt;c058c580&gt;] (release_nodes+0x1bc/0x200)
[&lt;c058c580&gt;] (release_nodes) from [&lt;c0588a44&gt;] (device_release_driver_internal+0xec/0x1ac)
[&lt;c0588a44&gt;] (device_release_driver_internal) from [&lt;c0586840&gt;] (unbind_store+0x60/0xd4)
[&lt;c0586840&gt;] (unbind_store) from [&lt;c02e64e8&gt;] (kernfs_fop_write+0xe8/0x1c4)
[&lt;c02e64e8&gt;] (kernfs_fop_write) from [&lt;c0266b44&gt;] (__vfs_write+0x2c/0x1c0)
[&lt;c0266b44&gt;] (__vfs_write) from [&lt;c02694c0&gt;] (vfs_write+0xa4/0x184)
[&lt;c02694c0&gt;] (vfs_write) from [&lt;c0269710&gt;] (ksys_write+0x58/0xd0)
[&lt;c0269710&gt;] (ksys_write) from [&lt;c0101000&gt;] (ret_fast_syscall+0x0/0x54)
Exception stack(0xdd289fa8 to 0xdd289ff0)
9fa0:                   0000006c 000e20e8 00000001 000e20e8 0000000d 00000000
9fc0: 0000006c 000e20e8 b6f87da0 00000004 0000000d 0000000d 00000000 00000000
9fe0: 00000004 bee639b0 b6f2286b b6eaf6c6
---[ end trace 1b15df8a02d76af0 ]---
8&lt;--- cut here ---
Unable to handle kernel NULL pointer dereference at virtual address 00000050
pgd = e612f14d
[00000050] *pgd=ff1f5835
Internal error: Oops: 17 [#1] SMP ARM
Modules linked in:
CPU: 1 PID: 496 Comm: sh Tainted: G        W         5.3.0-rc1-00219-ga0e07bb51a37 #62
Hardware name: STM32 (Device Tree Support)
PC is at kernfs_find_ns+0x8/0xfc
LR is at kernfs_find_and_get_ns+0x30/0x48
pc : [&lt;c02e49a4&gt;]    lr : [&lt;c02e4ac8&gt;]    psr: 40010013
sp : dd289dac  ip : 00000000  fp : 00000000
r10: 00000000  r9 : def6ec58  r8 : dd289e54
r7 : 00000000  r6 : c0abb234  r5 : 00000000  r4 : c0d26a30
r3 : ddab5080  r2 : 00000000  r1 : c0abb234  r0 : 00000000
Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c5387d  Table: dd11c06a  DAC: 00000051
Process sh (pid: 496, stack limit = 0xe13a592d)
Stack: (0xdd289dac to 0xdd28a000)
9da0:                            c0d26a30 00000000 c0abb234 00000000 c02e4ac8
9dc0: 00000000 c0976b44 def6ec00 dea53810 dd289e54 c02e864c c0a61a48 c0a4a5ec
9de0: c0d630a8 def6ec00 c0d04c48 c02e86e0 def6ec00 de909338 c0d04c48 c05833b0
9e00: 00000000 c0638144 dd289e54 def59900 00000000 475b3ee5 def6ec00 00000000
9e20: def6ec00 def59b80 dd289e54 def59900 00000000 c05835f8 def6ec00 c0638dac
9e40: 0000000a dea53810 c0d04c48 c058c580 dea53810 def59500 def59b80 475b3ee5
9e60: ddc63e00 dea53810 dea3fe10 c0d63a0c dea53810 ddc63e00 dd289f78 dd240d10
9e80: 00000000 c0588a44 c0d59a20 0000000d c0d63a0c c0586840 0000000d dd240d00
9ea0: 00000000 00000000 ddc63e00 c02e64e8 00000000 00000000 c0d04c48 dd9bbcc0
9ec0: c02e6400 dd289f78 00000000 000e20e8 0000000d c0266b44 00000055 00000cc0
9ee0: 000000e3 000e3000 dd11c000 dd11c000 00000000 00000000 00000000 00000000
9f00: ffeee38c dff99688 00000000 475b3ee5 00000001 dd289fb0 ddab5080 ddaa5800
9f20: 00000817 000e30ec dd9e7720 475b3ee5 ddaa583c 0000000d dd9bbcc0 000e20e8
9f40: dd289f78 00000000 000e20e8 0000000d 00000000 c02694c0 00000000 00000000
9f60: c0d04c48 dd9bbcc0 00000000 00000000 dd9bbcc0 c0269710 00000000 00000000
9f80: 000a91f4 475b3ee5 0000006c 000e20e8 b6f87da0 00000004 c0101204 dd288000
9fa0: 00000004 c0101000 0000006c 000e20e8 00000001 000e20e8 0000000d 00000000
9fc0: 0000006c 000e20e8 b6f87da0 00000004 0000000d 0000000d 00000000 00000000
9fe0: 00000004 bee639b0 b6f2286b b6eaf6c6 600e0030 00000001 00000000 00000000
[&lt;c02e49a4&gt;] (kernfs_find_ns) from [&lt;def6ec00&gt;] (0xdef6ec00)
Code: ebf8eeab c0dc50b8 e92d40f0 e292c000 (e1d035b0)
---[ end trace 1b15df8a02d76af1 ]---

Fixes: a88eceb17ac7 ("spi: stm32-qspi: add spi_master_put in release function")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Link: https://lore.kernel.org/r/20191004123606.17241-1-patrice.chotard@st.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3c0af1dd2fe78adc02fe21f6cfe7d6cb8602573e upstream.

spi_master_put() must only be called in .probe() in case of error.

As devm_spi_register_master() is used during probe, spi_master_put()
mustn't be called in .remove() callback.

It fixes the following kernel WARNING/Oops when executing
echo "58003000.spi" &gt; /sys/bus/platform/drivers/stm32-qspi/unbind :

------------[ cut here ]------------
WARNING: CPU: 1 PID: 496 at fs/kernfs/dir.c:1504 kernfs_remove_by_name_ns+0x9c/0xa4
kernfs: can not remove 'uevent', no directory
Modules linked in:
CPU: 1 PID: 496 Comm: sh Not tainted 5.3.0-rc1-00219-ga0e07bb51a37 #62
Hardware name: STM32 (Device Tree Support)
[&lt;c0111570&gt;] (unwind_backtrace) from [&lt;c010d384&gt;] (show_stack+0x10/0x14)
[&lt;c010d384&gt;] (show_stack) from [&lt;c08db558&gt;] (dump_stack+0xb4/0xc8)
[&lt;c08db558&gt;] (dump_stack) from [&lt;c01209d8&gt;] (__warn.part.3+0xbc/0xd8)
[&lt;c01209d8&gt;] (__warn.part.3) from [&lt;c0120a5c&gt;] (warn_slowpath_fmt+0x68/0x8c)
[&lt;c0120a5c&gt;] (warn_slowpath_fmt) from [&lt;c02e5844&gt;] (kernfs_remove_by_name_ns+0x9c/0xa4)
[&lt;c02e5844&gt;] (kernfs_remove_by_name_ns) from [&lt;c05833a4&gt;] (device_del+0x128/0x358)
[&lt;c05833a4&gt;] (device_del) from [&lt;c05835f8&gt;] (device_unregister+0x24/0x64)
[&lt;c05835f8&gt;] (device_unregister) from [&lt;c0638dac&gt;] (spi_unregister_controller+0x88/0xe8)
[&lt;c0638dac&gt;] (spi_unregister_controller) from [&lt;c058c580&gt;] (release_nodes+0x1bc/0x200)
[&lt;c058c580&gt;] (release_nodes) from [&lt;c0588a44&gt;] (device_release_driver_internal+0xec/0x1ac)
[&lt;c0588a44&gt;] (device_release_driver_internal) from [&lt;c0586840&gt;] (unbind_store+0x60/0xd4)
[&lt;c0586840&gt;] (unbind_store) from [&lt;c02e64e8&gt;] (kernfs_fop_write+0xe8/0x1c4)
[&lt;c02e64e8&gt;] (kernfs_fop_write) from [&lt;c0266b44&gt;] (__vfs_write+0x2c/0x1c0)
[&lt;c0266b44&gt;] (__vfs_write) from [&lt;c02694c0&gt;] (vfs_write+0xa4/0x184)
[&lt;c02694c0&gt;] (vfs_write) from [&lt;c0269710&gt;] (ksys_write+0x58/0xd0)
[&lt;c0269710&gt;] (ksys_write) from [&lt;c0101000&gt;] (ret_fast_syscall+0x0/0x54)
Exception stack(0xdd289fa8 to 0xdd289ff0)
9fa0:                   0000006c 000e20e8 00000001 000e20e8 0000000d 00000000
9fc0: 0000006c 000e20e8 b6f87da0 00000004 0000000d 0000000d 00000000 00000000
9fe0: 00000004 bee639b0 b6f2286b b6eaf6c6
---[ end trace 1b15df8a02d76aef ]---
------------[ cut here ]------------
WARNING: CPU: 1 PID: 496 at fs/kernfs/dir.c:1504 kernfs_remove_by_name_ns+0x9c/0xa4
kernfs: can not remove 'online', no directory
Modules linked in:
CPU: 1 PID: 496 Comm: sh Tainted: G        W         5.3.0-rc1-00219-ga0e07bb51a37 #62
Hardware name: STM32 (Device Tree Support)
[&lt;c0111570&gt;] (unwind_backtrace) from [&lt;c010d384&gt;] (show_stack+0x10/0x14)
[&lt;c010d384&gt;] (show_stack) from [&lt;c08db558&gt;] (dump_stack+0xb4/0xc8)
[&lt;c08db558&gt;] (dump_stack) from [&lt;c01209d8&gt;] (__warn.part.3+0xbc/0xd8)
[&lt;c01209d8&gt;] (__warn.part.3) from [&lt;c0120a5c&gt;] (warn_slowpath_fmt+0x68/0x8c)
[&lt;c0120a5c&gt;] (warn_slowpath_fmt) from [&lt;c02e5844&gt;] (kernfs_remove_by_name_ns+0x9c/0xa4)
[&lt;c02e5844&gt;] (kernfs_remove_by_name_ns) from [&lt;c0582488&gt;] (device_remove_attrs+0x20/0x5c)
[&lt;c0582488&gt;] (device_remove_attrs) from [&lt;c05833b0&gt;] (device_del+0x134/0x358)
[&lt;c05833b0&gt;] (device_del) from [&lt;c05835f8&gt;] (device_unregister+0x24/0x64)
[&lt;c05835f8&gt;] (device_unregister) from [&lt;c0638dac&gt;] (spi_unregister_controller+0x88/0xe8)
[&lt;c0638dac&gt;] (spi_unregister_controller) from [&lt;c058c580&gt;] (release_nodes+0x1bc/0x200)
[&lt;c058c580&gt;] (release_nodes) from [&lt;c0588a44&gt;] (device_release_driver_internal+0xec/0x1ac)
[&lt;c0588a44&gt;] (device_release_driver_internal) from [&lt;c0586840&gt;] (unbind_store+0x60/0xd4)
[&lt;c0586840&gt;] (unbind_store) from [&lt;c02e64e8&gt;] (kernfs_fop_write+0xe8/0x1c4)
[&lt;c02e64e8&gt;] (kernfs_fop_write) from [&lt;c0266b44&gt;] (__vfs_write+0x2c/0x1c0)
[&lt;c0266b44&gt;] (__vfs_write) from [&lt;c02694c0&gt;] (vfs_write+0xa4/0x184)
[&lt;c02694c0&gt;] (vfs_write) from [&lt;c0269710&gt;] (ksys_write+0x58/0xd0)
[&lt;c0269710&gt;] (ksys_write) from [&lt;c0101000&gt;] (ret_fast_syscall+0x0/0x54)
Exception stack(0xdd289fa8 to 0xdd289ff0)
9fa0:                   0000006c 000e20e8 00000001 000e20e8 0000000d 00000000
9fc0: 0000006c 000e20e8 b6f87da0 00000004 0000000d 0000000d 00000000 00000000
9fe0: 00000004 bee639b0 b6f2286b b6eaf6c6
---[ end trace 1b15df8a02d76af0 ]---
8&lt;--- cut here ---
Unable to handle kernel NULL pointer dereference at virtual address 00000050
pgd = e612f14d
[00000050] *pgd=ff1f5835
Internal error: Oops: 17 [#1] SMP ARM
Modules linked in:
CPU: 1 PID: 496 Comm: sh Tainted: G        W         5.3.0-rc1-00219-ga0e07bb51a37 #62
Hardware name: STM32 (Device Tree Support)
PC is at kernfs_find_ns+0x8/0xfc
LR is at kernfs_find_and_get_ns+0x30/0x48
pc : [&lt;c02e49a4&gt;]    lr : [&lt;c02e4ac8&gt;]    psr: 40010013
sp : dd289dac  ip : 00000000  fp : 00000000
r10: 00000000  r9 : def6ec58  r8 : dd289e54
r7 : 00000000  r6 : c0abb234  r5 : 00000000  r4 : c0d26a30
r3 : ddab5080  r2 : 00000000  r1 : c0abb234  r0 : 00000000
Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c5387d  Table: dd11c06a  DAC: 00000051
Process sh (pid: 496, stack limit = 0xe13a592d)
Stack: (0xdd289dac to 0xdd28a000)
9da0:                            c0d26a30 00000000 c0abb234 00000000 c02e4ac8
9dc0: 00000000 c0976b44 def6ec00 dea53810 dd289e54 c02e864c c0a61a48 c0a4a5ec
9de0: c0d630a8 def6ec00 c0d04c48 c02e86e0 def6ec00 de909338 c0d04c48 c05833b0
9e00: 00000000 c0638144 dd289e54 def59900 00000000 475b3ee5 def6ec00 00000000
9e20: def6ec00 def59b80 dd289e54 def59900 00000000 c05835f8 def6ec00 c0638dac
9e40: 0000000a dea53810 c0d04c48 c058c580 dea53810 def59500 def59b80 475b3ee5
9e60: ddc63e00 dea53810 dea3fe10 c0d63a0c dea53810 ddc63e00 dd289f78 dd240d10
9e80: 00000000 c0588a44 c0d59a20 0000000d c0d63a0c c0586840 0000000d dd240d00
9ea0: 00000000 00000000 ddc63e00 c02e64e8 00000000 00000000 c0d04c48 dd9bbcc0
9ec0: c02e6400 dd289f78 00000000 000e20e8 0000000d c0266b44 00000055 00000cc0
9ee0: 000000e3 000e3000 dd11c000 dd11c000 00000000 00000000 00000000 00000000
9f00: ffeee38c dff99688 00000000 475b3ee5 00000001 dd289fb0 ddab5080 ddaa5800
9f20: 00000817 000e30ec dd9e7720 475b3ee5 ddaa583c 0000000d dd9bbcc0 000e20e8
9f40: dd289f78 00000000 000e20e8 0000000d 00000000 c02694c0 00000000 00000000
9f60: c0d04c48 dd9bbcc0 00000000 00000000 dd9bbcc0 c0269710 00000000 00000000
9f80: 000a91f4 475b3ee5 0000006c 000e20e8 b6f87da0 00000004 c0101204 dd288000
9fa0: 00000004 c0101000 0000006c 000e20e8 00000001 000e20e8 0000000d 00000000
9fc0: 0000006c 000e20e8 b6f87da0 00000004 0000000d 0000000d 00000000 00000000
9fe0: 00000004 bee639b0 b6f2286b b6eaf6c6 600e0030 00000001 00000000 00000000
[&lt;c02e49a4&gt;] (kernfs_find_ns) from [&lt;def6ec00&gt;] (0xdef6ec00)
Code: ebf8eeab c0dc50b8 e92d40f0 e292c000 (e1d035b0)
---[ end trace 1b15df8a02d76af1 ]---

Fixes: a88eceb17ac7 ("spi: stm32-qspi: add spi_master_put in release function")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Link: https://lore.kernel.org/r/20191004123606.17241-1-patrice.chotard@st.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spi-fsl-qspi: Clear TDH bits in FLSHCR register</title>
<updated>2019-12-13T07:49:34+00:00</updated>
<author>
<name>Frieder Schrempf</name>
<email>frieder.schrempf@kontron.de</email>
</author>
<published>2019-10-07T07:23:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3db45180dcc141015415bc1af88c8e9590d21e7d'/>
<id>3db45180dcc141015415bc1af88c8e9590d21e7d</id>
<content type='text'>
commit f6910679e17ad4915f008bd2c614d38052426f7c upstream.

Later versions of the QSPI controller (e.g. in i.MX6UL/ULL and i.MX7)
seem to have an additional TDH setting in the FLSHCR register, that
needs to be set in accordance with the access mode that is used (DDR
or SDR).

Previous bootstages such as BootROM or bootloader might have used the
DDR mode to access the flash. As we currently only use SDR mode, we
need to make sure the TDH bits are cleared upon initialization.

Fixes: 84d043185dbe ("spi: Add a driver for the Freescale/NXP QuadSPI controller")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Frieder Schrempf &lt;frieder.schrempf@kontron.de&gt;
Acked-by: Han Xu &lt;han.xu@nxp.com&gt;
Link: https://lore.kernel.org/r/20191007071933.26786-1-frieder.schrempf@kontron.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f6910679e17ad4915f008bd2c614d38052426f7c upstream.

Later versions of the QSPI controller (e.g. in i.MX6UL/ULL and i.MX7)
seem to have an additional TDH setting in the FLSHCR register, that
needs to be set in accordance with the access mode that is used (DDR
or SDR).

Previous bootstages such as BootROM or bootloader might have used the
DDR mode to access the flash. As we currently only use SDR mode, we
need to make sure the TDH bits are cleared upon initialization.

Fixes: 84d043185dbe ("spi: Add a driver for the Freescale/NXP QuadSPI controller")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Frieder Schrempf &lt;frieder.schrempf@kontron.de&gt;
Acked-by: Han Xu &lt;han.xu@nxp.com&gt;
Link: https://lore.kernel.org/r/20191007071933.26786-1-frieder.schrempf@kontron.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours</title>
<updated>2019-10-05T13:12:21+00:00</updated>
<author>
<name>Vladimir Oltean</name>
<email>olteanv@gmail.com</email>
</author>
<published>2019-08-22T21:24:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8d2c9ff537f9ceedae3506fdc0bf43116c61e8cb'/>
<id>8d2c9ff537f9ceedae3506fdc0bf43116c61e8cb</id>
<content type='text'>
commit d41f36a6464a85c06ad920703d878e4491d2c023 upstream.

The DSPI interrupt can be shared between two controllers at least on the
LX2160A. In that case, the driver for one controller might misbehave and
consume the other's interrupt. Fix this by actually checking if any of
the bits in the status register have been asserted.

Fixes: 13aed2392741 ("spi: spi-fsl-dspi: use IRQF_SHARED mode to request IRQ")
Signed-off-by: Vladimir Oltean &lt;olteanv@gmail.com&gt;
Link: https://lore.kernel.org/r/20190822212450.21420-2-olteanv@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d41f36a6464a85c06ad920703d878e4491d2c023 upstream.

The DSPI interrupt can be shared between two controllers at least on the
LX2160A. In that case, the driver for one controller might misbehave and
consume the other's interrupt. Fix this by actually checking if any of
the bits in the status register have been asserted.

Fixes: 13aed2392741 ("spi: spi-fsl-dspi: use IRQF_SHARED mode to request IRQ")
Signed-off-by: Vladimir Oltean &lt;olteanv@gmail.com&gt;
Link: https://lore.kernel.org/r/20190822212450.21420-2-olteanv@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>spi: bcm2835: Work around DONE bit erratum</title>
<updated>2019-10-05T13:12:06+00:00</updated>
<author>
<name>Lukas Wunner</name>
<email>lukas@wunner.de</email>
</author>
<published>2019-08-03T10:10:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=664acfa7199a4625627faee9aa6ddde20a23ab35'/>
<id>664acfa7199a4625627faee9aa6ddde20a23ab35</id>
<content type='text'>
[ Upstream commit 4c524191c0a21d758b519087c64f84348095e940 ]

Commit 3bd7f6589f67 ("spi: bcm2835: Overcome sglist entry length
limitation") amended the BCM2835 SPI driver with support for DMA
transfers whose buffers are not aligned to 4 bytes and require more than
one sglist entry.

When testing this feature with upcoming commits to speed up TX-only and
RX-only transfers, I noticed that SPI transmission sometimes breaks.
A function introduced by the commit, bcm2835_spi_transfer_prologue(),
performs one or two PIO transmissions as a prologue to the actual DMA
transmission.  It turns out that the breakage goes away if the DONE bit
in the CS register is set when ending such a PIO transmission.

The DONE bit signifies emptiness of the TX FIFO.  According to the spec,
the bit is of type RO, so writing it should never have any effect.
Perhaps the spec is wrong and the bit is actually of type RW1C.
E.g. the I2C controller on the BCM2835 does have an RW1C DONE bit which
needs to be cleared by the driver.  Another, possibly more likely
explanation is that it's a hardware erratum since the issue does not
occur consistently.

Either way, amend bcm2835_spi_transfer_prologue() to always write the
DONE bit.

Usually a transmission is ended by bcm2835_spi_reset_hw().  If the
transmission was successful, the TX FIFO is empty and thus the DONE bit
is set when bcm2835_spi_reset_hw() reads the CS register.  The bit is
then written back to the register, so we happen to do the right thing.

However if DONE is not set, e.g. because transmission is aborted with
a non-empty TX FIFO, the bit won't be written by bcm2835_spi_reset_hw()
and it seems possible that transmission might subsequently break.  To be
on the safe side, likewise amend bcm2835_spi_reset_hw() to always write
the bit.

Tested-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Signed-off-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Acked-by: Stefan Wahren &lt;wahrenst@gmx.net&gt;
Acked-by: Martin Sperl &lt;kernel@martin.sperl.org&gt;
Link: https://lore.kernel.org/r/edb004dff4af6106f6bfcb89e1a96391e96eb857.1564825752.git.lukas@wunner.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 4c524191c0a21d758b519087c64f84348095e940 ]

Commit 3bd7f6589f67 ("spi: bcm2835: Overcome sglist entry length
limitation") amended the BCM2835 SPI driver with support for DMA
transfers whose buffers are not aligned to 4 bytes and require more than
one sglist entry.

When testing this feature with upcoming commits to speed up TX-only and
RX-only transfers, I noticed that SPI transmission sometimes breaks.
A function introduced by the commit, bcm2835_spi_transfer_prologue(),
performs one or two PIO transmissions as a prologue to the actual DMA
transmission.  It turns out that the breakage goes away if the DONE bit
in the CS register is set when ending such a PIO transmission.

The DONE bit signifies emptiness of the TX FIFO.  According to the spec,
the bit is of type RO, so writing it should never have any effect.
Perhaps the spec is wrong and the bit is actually of type RW1C.
E.g. the I2C controller on the BCM2835 does have an RW1C DONE bit which
needs to be cleared by the driver.  Another, possibly more likely
explanation is that it's a hardware erratum since the issue does not
occur consistently.

Either way, amend bcm2835_spi_transfer_prologue() to always write the
DONE bit.

Usually a transmission is ended by bcm2835_spi_reset_hw().  If the
transmission was successful, the TX FIFO is empty and thus the DONE bit
is set when bcm2835_spi_reset_hw() reads the CS register.  The bit is
then written back to the register, so we happen to do the right thing.

However if DONE is not set, e.g. because transmission is aborted with
a non-empty TX FIFO, the bit won't be written by bcm2835_spi_reset_hw()
and it seems possible that transmission might subsequently break.  To be
on the safe side, likewise amend bcm2835_spi_reset_hw() to always write
the bit.

Tested-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Signed-off-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Acked-by: Stefan Wahren &lt;wahrenst@gmx.net&gt;
Acked-by: Martin Sperl &lt;kernel@martin.sperl.org&gt;
Link: https://lore.kernel.org/r/edb004dff4af6106f6bfcb89e1a96391e96eb857.1564825752.git.lukas@wunner.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: dw-mmio: Clock should be shut when error occurs</title>
<updated>2019-10-05T13:11:25+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2019-07-10T11:42:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dc1db1791d36ebc1ba140f5dc15cc5c7fe63986b'/>
<id>dc1db1791d36ebc1ba140f5dc15cc5c7fe63986b</id>
<content type='text'>
[ Upstream commit 3da9834d9381dd99273f2ad4e6d096c9187dc4f2 ]

When optional clock requesting fails, the main clock is still up and running,
we should shut it down in such caee.

Fixes: 560ee7e91009 ("spi: dw: Add support for an optional interface clock")
Cc: Phil Edworthy &lt;phil.edworthy@renesas.com&gt;
Cc: Gareth Williams &lt;gareth.williams.jx@renesas.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Gareth Williams &lt;gareth.williams.jx@renesas.com&gt;
Link: https://lore.kernel.org/r/20190710114243.30101-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 3da9834d9381dd99273f2ad4e6d096c9187dc4f2 ]

When optional clock requesting fails, the main clock is still up and running,
we should shut it down in such caee.

Fixes: 560ee7e91009 ("spi: dw: Add support for an optional interface clock")
Cc: Phil Edworthy &lt;phil.edworthy@renesas.com&gt;
Cc: Gareth Williams &lt;gareth.williams.jx@renesas.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Gareth Williams &lt;gareth.williams.jx@renesas.com&gt;
Link: https://lore.kernel.org/r/20190710114243.30101-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'spi-fix-v5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi</title>
<updated>2019-08-05T18:49:02+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-08-05T18:49:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0eb0ce0a78e1f57082bca6cbdea6fd04feedb876'/>
<id>0eb0ce0a78e1f57082bca6cbdea6fd04feedb876</id>
<content type='text'>
Pull spi fixes from Mark Brown:
 "A bunch of small, device specific things here plus a DT bindings fix
  for the new validatable YAML binding format.

  The most notable thing is the fix for GPIO chip selects which fixes a
  corner case in updates of that code to modern APIs, unfortunately due
  to a historical mess the code around GPIO support is obscure, fragile
  and an ABI which makes and attempt to improve the situation painful"

* tag 'spi-fix-v5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: pxa2xx: Add support for Intel Tiger Lake
  spi: bcm2835: Fix 3-wire mode if DMA is enabled
  spi: pxa2xx: Balance runtime PM enable/disable on error
  spi: gpio: Add SPI_MASTER_GPIO_SS flag
  spi: spi-fsl-qspi: change i.MX7D RX FIFO size
  spi: dt-bindings: spi-controller: remove unnecessary 'maxItems: 1' from reg
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull spi fixes from Mark Brown:
 "A bunch of small, device specific things here plus a DT bindings fix
  for the new validatable YAML binding format.

  The most notable thing is the fix for GPIO chip selects which fixes a
  corner case in updates of that code to modern APIs, unfortunately due
  to a historical mess the code around GPIO support is obscure, fragile
  and an ABI which makes and attempt to improve the situation painful"

* tag 'spi-fix-v5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: pxa2xx: Add support for Intel Tiger Lake
  spi: bcm2835: Fix 3-wire mode if DMA is enabled
  spi: pxa2xx: Balance runtime PM enable/disable on error
  spi: gpio: Add SPI_MASTER_GPIO_SS flag
  spi: spi-fsl-qspi: change i.MX7D RX FIFO size
  spi: dt-bindings: spi-controller: remove unnecessary 'maxItems: 1' from reg
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: pxa2xx: Add support for Intel Tiger Lake</title>
<updated>2019-08-02T11:14:23+00:00</updated>
<author>
<name>Jarkko Nikula</name>
<email>jarkko.nikula@linux.intel.com</email>
</author>
<published>2019-08-01T13:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a4127952859a869cf3fc5a49547dbe2ffa2eac89'/>
<id>a4127952859a869cf3fc5a49547dbe2ffa2eac89</id>
<content type='text'>
Intel Tiger Lake -LP LPSS SPI controller is otherwise similar than
Cannon Lake but has more controllers and up to two chip selects per
controller.

Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20190801134901.12635-1-jarkko.nikula@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Intel Tiger Lake -LP LPSS SPI controller is otherwise similar than
Cannon Lake but has more controllers and up to two chip selects per
controller.

Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20190801134901.12635-1-jarkko.nikula@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
