<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/gpio, branch linux-4.15.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>gpio: thunderx: fix error return code in thunderx_gpio_probe()</title>
<updated>2018-04-12T10:31:12+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyongjun1@huawei.com</email>
</author>
<published>2018-01-10T14:37:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6a68ef47bea6ff33ff60719cb1f24d4849358469'/>
<id>6a68ef47bea6ff33ff60719cb1f24d4849358469</id>
<content type='text'>
[ Upstream commit 76e28f5ffed82b1e81a86c4eb8d0420515765620 ]

Fix to return error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 5a2a30024d8c ("gpio: Add gpio driver support for ThunderX and OCTEON-TX")
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Acked-by: David Daney &lt;david.daney@cavium.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&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>
[ Upstream commit 76e28f5ffed82b1e81a86c4eb8d0420515765620 ]

Fix to return error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 5a2a30024d8c ("gpio: Add gpio driver support for ThunderX and OCTEON-TX")
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Acked-by: David Daney &lt;david.daney@cavium.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: label descriptors using the device name</title>
<updated>2018-04-12T10:31:06+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2018-01-04T21:31:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a257594a30d3bf1faa3fba80d4e3484c0ce0d35d'/>
<id>a257594a30d3bf1faa3fba80d4e3484c0ce0d35d</id>
<content type='text'>
[ Upstream commit 24e78079bf2250874e33da2e7cfbb6db72d3caf4 ]

Some GPIO lines appear named "?" in the lsgpio dump due to their
requesting drivers not passing a reasonable label.

Most typically this happens if a device tree node just defines
gpios = &lt;...&gt; and not foo-gpios = &lt;...&gt;, the former gets named
"foo" and the latter gets named "?".

However the struct device passed in is always valid so let's
just label the GPIO with dev_name() on the device if no proper
label was passed.

Cc: Reported-by: Jason Kridner &lt;jkridner@beagleboard.org&gt;
Reported-by: Jason Kridner &lt;jkridner@beagleboard.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&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>
[ Upstream commit 24e78079bf2250874e33da2e7cfbb6db72d3caf4 ]

Some GPIO lines appear named "?" in the lsgpio dump due to their
requesting drivers not passing a reasonable label.

Most typically this happens if a device tree node just defines
gpios = &lt;...&gt; and not foo-gpios = &lt;...&gt;, the former gets named
"foo" and the latter gets named "?".

However the struct device passed in is always valid so let's
just label the GPIO with dev_name() on the device if no proper
label was passed.

Cc: Reported-by: Jason Kridner &lt;jkridner@beagleboard.org&gt;
Reported-by: Jason Kridner &lt;jkridner@beagleboard.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpiolib: don't dereference a desc before validation</title>
<updated>2018-04-12T10:31:04+00:00</updated>
<author>
<name>Vladimir Zapolskiy</name>
<email>vz@mleia.com</email>
</author>
<published>2017-12-21T16:37:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ffc544a91a0f9040a79fda8c2cb051fefa43212b'/>
<id>ffc544a91a0f9040a79fda8c2cb051fefa43212b</id>
<content type='text'>
[ Upstream commit 30322bcf82d74cad0d6e1cf9ba7fa7fa48c7a026 ]

The fix restores a proper validation of an input gpio desc, which
might be needed to deal with optional GPIOs correctly.

Fixes: 02e479808b5d ("gpio: Alter semantics of *raw* operations to actually be raw")
Signed-off-by: Vladimir Zapolskiy &lt;vz@mleia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&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>
[ Upstream commit 30322bcf82d74cad0d6e1cf9ba7fa7fa48c7a026 ]

The fix restores a proper validation of an input gpio desc, which
might be needed to deal with optional GPIOs correctly.

Fixes: 02e479808b5d ("gpio: Alter semantics of *raw* operations to actually be raw")
Signed-off-by: Vladimir Zapolskiy &lt;vz@mleia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpiolib: don't allow OPEN_DRAIN &amp; OPEN_SOURCE flags simultaneously</title>
<updated>2018-03-19T08:09:52+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>brgl@bgdev.pl</email>
</author>
<published>2017-11-15T15:47:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=71dc53969aa944e91131e65abf140110868d3897'/>
<id>71dc53969aa944e91131e65abf140110868d3897</id>
<content type='text'>
[ Upstream commit 588fc3bceaf81bbd62e18af6f7bd475e01c2b7e8 ]

Do not allow OPEN_SOURCE &amp; OPEN_DRAIN flags in a single request. If
the hardware actually supports enabling both at the same time the
electrical result would be disastrous.

Suggested-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&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>
[ Upstream commit 588fc3bceaf81bbd62e18af6f7bd475e01c2b7e8 ]

Do not allow OPEN_SOURCE &amp; OPEN_DRAIN flags in a single request. If
the hardware actually supports enabling both at the same time the
electrical result would be disastrous.

Suggested-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: uniphier: fix mismatch between license text and MODULE_LICENSE</title>
<updated>2018-02-12T06:07:22+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2017-11-23T10:01:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=65a4a2157f0be4d4a30689ae6757ff67486b03ec'/>
<id>65a4a2157f0be4d4a30689ae6757ff67486b03ec</id>
<content type='text'>
commit 13f9d59cef91a027bb338fc79b564fafa7680cd8 upstream.

The comment block of this file indicates GPL-2.0 "only", while the
MODULE_LICENSE is GPL-2.0 "or later", as include/linux/module.h
describes as follows:

  "GPL"                           [GNU Public License v2 or later]
  "GPL v2"                        [GNU Public License v2]

I am the author of this driver, and my intention is GPL-2.0 "only".

Fixes: dbe776c2ca54 ("gpio: uniphier: add UniPhier GPIO controller driver")
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.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 13f9d59cef91a027bb338fc79b564fafa7680cd8 upstream.

The comment block of this file indicates GPL-2.0 "only", while the
MODULE_LICENSE is GPL-2.0 "or later", as include/linux/module.h
describes as follows:

  "GPL"                           [GNU Public License v2 or later]
  "GPL v2"                        [GNU Public License v2]

I am the author of this driver, and my intention is GPL-2.0 "only".

Fixes: dbe776c2ca54 ("gpio: uniphier: add UniPhier GPIO controller driver")
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: ath79: add missing MODULE_DESCRIPTION/LICENSE</title>
<updated>2018-02-03T16:58:35+00:00</updated>
<author>
<name>Jesse Chan</name>
<email>jc@linux.com</email>
</author>
<published>2017-11-20T20:54:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2db691195247e906503bfa14df17bff43f0eb5e0'/>
<id>2db691195247e906503bfa14df17bff43f0eb5e0</id>
<content type='text'>
commit 539340f37e6d6ed4cd93e8e18c9b2e4eafd4b842 upstream.

This change resolves a new compile-time warning
when built as a loadable module:

WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
see include/linux/module.h for more information

This adds the license as "GPL v2", which matches the header of the file.

MODULE_DESCRIPTION is also added.

Signed-off-by: Jesse Chan &lt;jc@linux.com&gt;
Acked-by: Alban Bedel &lt;albeu@free.fr&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.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 539340f37e6d6ed4cd93e8e18c9b2e4eafd4b842 upstream.

This change resolves a new compile-time warning
when built as a loadable module:

WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
see include/linux/module.h for more information

This adds the license as "GPL v2", which matches the header of the file.

MODULE_DESCRIPTION is also added.

Signed-off-by: Jesse Chan &lt;jc@linux.com&gt;
Acked-by: Alban Bedel &lt;albeu@free.fr&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: iop: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE</title>
<updated>2018-02-03T16:58:34+00:00</updated>
<author>
<name>Jesse Chan</name>
<email>jc@linux.com</email>
</author>
<published>2017-11-20T20:54:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=397b9b19bfbd9471dfa5b8be9952cd0f218dee9f'/>
<id>397b9b19bfbd9471dfa5b8be9952cd0f218dee9f</id>
<content type='text'>
commit 97b03136e1b637d7a9d2274c099e44ecf23f1103 upstream.

This change resolves a new compile-time warning
when built as a loadable module:

WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o
see include/linux/module.h for more information

This adds the license as "GPL", which matches the header of the file.

MODULE_DESCRIPTION and MODULE_AUTHOR are also added.

Signed-off-by: Jesse Chan &lt;jc@linux.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.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 97b03136e1b637d7a9d2274c099e44ecf23f1103 upstream.

This change resolves a new compile-time warning
when built as a loadable module:

WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o
see include/linux/module.h for more information

This adds the license as "GPL", which matches the header of the file.

MODULE_DESCRIPTION and MODULE_AUTHOR are also added.

Signed-off-by: Jesse Chan &lt;jc@linux.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: Fix kernel stack leak to userspace</title>
<updated>2018-02-03T16:58:30+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2018-01-22T12:19:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5e5a8be023706da797db5cd7c05b7918275f3435'/>
<id>5e5a8be023706da797db5cd7c05b7918275f3435</id>
<content type='text'>
commit 24bd3efc9d1efb5f756a7c6f807a36ddb6adc671 upstream.

The GPIO event descriptor was leaking kernel stack to
userspace because we don't zero the variable before
use. Ooops. Fix this.

Reported-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.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 24bd3efc9d1efb5f756a7c6f807a36ddb6adc671 upstream.

The GPIO event descriptor was leaking kernel stack to
userspace because we don't zero the variable before
use. Ooops. Fix this.

Reported-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: stmpe: i2c transfer are forbiden in atomic context</title>
<updated>2018-02-03T16:58:30+00:00</updated>
<author>
<name>Patrice Chotard</name>
<email>patrice.chotard@st.com</email>
</author>
<published>2018-01-12T12:16:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b98fe1634c13270d989dbe01e3768ea952b8494c'/>
<id>b98fe1634c13270d989dbe01e3768ea952b8494c</id>
<content type='text'>
commit b888fb6f2a278442933e3bfab70262e9a5365fb3 upstream.

Move the workaround from stmpe_gpio_irq_unmask() which is executed
in atomic context to stmpe_gpio_irq_sync_unlock() which is not.

It fixes the following issue:

[    1.500000] BUG: scheduling while atomic: swapper/1/0x00000002
[    1.500000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0-rc2-00020-gbd4301f-dirty #28
[    1.520000] Hardware name: STM32 (Device Tree Support)
[    1.520000] [&lt;0000bfc9&gt;] (unwind_backtrace) from [&lt;0000b347&gt;] (show_stack+0xb/0xc)
[    1.530000] [&lt;0000b347&gt;] (show_stack) from [&lt;0001fc49&gt;] (__schedule_bug+0x39/0x58)
[    1.530000] [&lt;0001fc49&gt;] (__schedule_bug) from [&lt;00168211&gt;] (__schedule+0x23/0x2b2)
[    1.550000] [&lt;00168211&gt;] (__schedule) from [&lt;001684f7&gt;] (schedule+0x57/0x64)
[    1.550000] [&lt;001684f7&gt;] (schedule) from [&lt;0016a513&gt;] (schedule_timeout+0x137/0x164)
[    1.550000] [&lt;0016a513&gt;] (schedule_timeout) from [&lt;00168b91&gt;] (wait_for_common+0x8d/0xfc)
[    1.570000] [&lt;00168b91&gt;] (wait_for_common) from [&lt;00139753&gt;] (stm32f4_i2c_xfer+0xe9/0xfe)
[    1.580000] [&lt;00139753&gt;] (stm32f4_i2c_xfer) from [&lt;00138545&gt;] (__i2c_transfer+0x111/0x148)
[    1.590000] [&lt;00138545&gt;] (__i2c_transfer) from [&lt;001385cf&gt;] (i2c_transfer+0x53/0x70)
[    1.590000] [&lt;001385cf&gt;] (i2c_transfer) from [&lt;001388a5&gt;] (i2c_smbus_xfer+0x12f/0x36e)
[    1.600000] [&lt;001388a5&gt;] (i2c_smbus_xfer) from [&lt;00138b49&gt;] (i2c_smbus_read_byte_data+0x1f/0x2a)
[    1.610000] [&lt;00138b49&gt;] (i2c_smbus_read_byte_data) from [&lt;00124fdd&gt;] (__stmpe_reg_read+0xd/0x24)
[    1.620000] [&lt;00124fdd&gt;] (__stmpe_reg_read) from [&lt;001252b3&gt;] (stmpe_reg_read+0x19/0x24)
[    1.630000] [&lt;001252b3&gt;] (stmpe_reg_read) from [&lt;0002c4d1&gt;] (unmask_irq+0x17/0x22)
[    1.640000] [&lt;0002c4d1&gt;] (unmask_irq) from [&lt;0002c57f&gt;] (irq_startup+0x6f/0x78)
[    1.650000] [&lt;0002c57f&gt;] (irq_startup) from [&lt;0002b7a1&gt;] (__setup_irq+0x319/0x47c)
[    1.650000] [&lt;0002b7a1&gt;] (__setup_irq) from [&lt;0002bad3&gt;] (request_threaded_irq+0x6b/0xe8)
[    1.660000] [&lt;0002bad3&gt;] (request_threaded_irq) from [&lt;0002d0b9&gt;] (devm_request_threaded_irq+0x3b/0x6a)
[    1.670000] [&lt;0002d0b9&gt;] (devm_request_threaded_irq) from [&lt;001446e7&gt;] (mmc_gpiod_request_cd_irq+0x49/0x8a)
[    1.680000] [&lt;001446e7&gt;] (mmc_gpiod_request_cd_irq) from [&lt;0013d45d&gt;] (mmc_start_host+0x49/0x60)
[    1.690000] [&lt;0013d45d&gt;] (mmc_start_host) from [&lt;0013e40b&gt;] (mmc_add_host+0x3b/0x54)
[    1.700000] [&lt;0013e40b&gt;] (mmc_add_host) from [&lt;00148119&gt;] (mmci_probe+0x4d1/0x60c)
[    1.710000] [&lt;00148119&gt;] (mmci_probe) from [&lt;000f903b&gt;] (amba_probe+0x7b/0xbe)
[    1.720000] [&lt;000f903b&gt;] (amba_probe) from [&lt;001170e5&gt;] (driver_probe_device+0x169/0x1f8)
[    1.730000] [&lt;001170e5&gt;] (driver_probe_device) from [&lt;001171b7&gt;] (__driver_attach+0x43/0x5c)
[    1.740000] [&lt;001171b7&gt;] (__driver_attach) from [&lt;0011618d&gt;] (bus_for_each_dev+0x3d/0x46)
[    1.740000] [&lt;0011618d&gt;] (bus_for_each_dev) from [&lt;001165cd&gt;] (bus_add_driver+0xcd/0x124)
[    1.740000] [&lt;001165cd&gt;] (bus_add_driver) from [&lt;00117713&gt;] (driver_register+0x4d/0x7a)
[    1.760000] [&lt;00117713&gt;] (driver_register) from [&lt;001fc765&gt;] (do_one_initcall+0xbd/0xe8)
[    1.770000] [&lt;001fc765&gt;] (do_one_initcall) from [&lt;001fc88b&gt;] (kernel_init_freeable+0xfb/0x134)
[    1.780000] [&lt;001fc88b&gt;] (kernel_init_freeable) from [&lt;00167ee3&gt;] (kernel_init+0x7/0x9c)
[    1.790000] [&lt;00167ee3&gt;] (kernel_init) from [&lt;00009b65&gt;] (ret_from_fork+0x11/0x2c)

Signed-off-by: Alexandre TORGUE &lt;alexandre.torgue@st.com&gt;
Signed-off-by: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.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 b888fb6f2a278442933e3bfab70262e9a5365fb3 upstream.

Move the workaround from stmpe_gpio_irq_unmask() which is executed
in atomic context to stmpe_gpio_irq_sync_unlock() which is not.

It fixes the following issue:

[    1.500000] BUG: scheduling while atomic: swapper/1/0x00000002
[    1.500000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0-rc2-00020-gbd4301f-dirty #28
[    1.520000] Hardware name: STM32 (Device Tree Support)
[    1.520000] [&lt;0000bfc9&gt;] (unwind_backtrace) from [&lt;0000b347&gt;] (show_stack+0xb/0xc)
[    1.530000] [&lt;0000b347&gt;] (show_stack) from [&lt;0001fc49&gt;] (__schedule_bug+0x39/0x58)
[    1.530000] [&lt;0001fc49&gt;] (__schedule_bug) from [&lt;00168211&gt;] (__schedule+0x23/0x2b2)
[    1.550000] [&lt;00168211&gt;] (__schedule) from [&lt;001684f7&gt;] (schedule+0x57/0x64)
[    1.550000] [&lt;001684f7&gt;] (schedule) from [&lt;0016a513&gt;] (schedule_timeout+0x137/0x164)
[    1.550000] [&lt;0016a513&gt;] (schedule_timeout) from [&lt;00168b91&gt;] (wait_for_common+0x8d/0xfc)
[    1.570000] [&lt;00168b91&gt;] (wait_for_common) from [&lt;00139753&gt;] (stm32f4_i2c_xfer+0xe9/0xfe)
[    1.580000] [&lt;00139753&gt;] (stm32f4_i2c_xfer) from [&lt;00138545&gt;] (__i2c_transfer+0x111/0x148)
[    1.590000] [&lt;00138545&gt;] (__i2c_transfer) from [&lt;001385cf&gt;] (i2c_transfer+0x53/0x70)
[    1.590000] [&lt;001385cf&gt;] (i2c_transfer) from [&lt;001388a5&gt;] (i2c_smbus_xfer+0x12f/0x36e)
[    1.600000] [&lt;001388a5&gt;] (i2c_smbus_xfer) from [&lt;00138b49&gt;] (i2c_smbus_read_byte_data+0x1f/0x2a)
[    1.610000] [&lt;00138b49&gt;] (i2c_smbus_read_byte_data) from [&lt;00124fdd&gt;] (__stmpe_reg_read+0xd/0x24)
[    1.620000] [&lt;00124fdd&gt;] (__stmpe_reg_read) from [&lt;001252b3&gt;] (stmpe_reg_read+0x19/0x24)
[    1.630000] [&lt;001252b3&gt;] (stmpe_reg_read) from [&lt;0002c4d1&gt;] (unmask_irq+0x17/0x22)
[    1.640000] [&lt;0002c4d1&gt;] (unmask_irq) from [&lt;0002c57f&gt;] (irq_startup+0x6f/0x78)
[    1.650000] [&lt;0002c57f&gt;] (irq_startup) from [&lt;0002b7a1&gt;] (__setup_irq+0x319/0x47c)
[    1.650000] [&lt;0002b7a1&gt;] (__setup_irq) from [&lt;0002bad3&gt;] (request_threaded_irq+0x6b/0xe8)
[    1.660000] [&lt;0002bad3&gt;] (request_threaded_irq) from [&lt;0002d0b9&gt;] (devm_request_threaded_irq+0x3b/0x6a)
[    1.670000] [&lt;0002d0b9&gt;] (devm_request_threaded_irq) from [&lt;001446e7&gt;] (mmc_gpiod_request_cd_irq+0x49/0x8a)
[    1.680000] [&lt;001446e7&gt;] (mmc_gpiod_request_cd_irq) from [&lt;0013d45d&gt;] (mmc_start_host+0x49/0x60)
[    1.690000] [&lt;0013d45d&gt;] (mmc_start_host) from [&lt;0013e40b&gt;] (mmc_add_host+0x3b/0x54)
[    1.700000] [&lt;0013e40b&gt;] (mmc_add_host) from [&lt;00148119&gt;] (mmci_probe+0x4d1/0x60c)
[    1.710000] [&lt;00148119&gt;] (mmci_probe) from [&lt;000f903b&gt;] (amba_probe+0x7b/0xbe)
[    1.720000] [&lt;000f903b&gt;] (amba_probe) from [&lt;001170e5&gt;] (driver_probe_device+0x169/0x1f8)
[    1.730000] [&lt;001170e5&gt;] (driver_probe_device) from [&lt;001171b7&gt;] (__driver_attach+0x43/0x5c)
[    1.740000] [&lt;001171b7&gt;] (__driver_attach) from [&lt;0011618d&gt;] (bus_for_each_dev+0x3d/0x46)
[    1.740000] [&lt;0011618d&gt;] (bus_for_each_dev) from [&lt;001165cd&gt;] (bus_add_driver+0xcd/0x124)
[    1.740000] [&lt;001165cd&gt;] (bus_add_driver) from [&lt;00117713&gt;] (driver_register+0x4d/0x7a)
[    1.760000] [&lt;00117713&gt;] (driver_register) from [&lt;001fc765&gt;] (do_one_initcall+0xbd/0xe8)
[    1.770000] [&lt;001fc765&gt;] (do_one_initcall) from [&lt;001fc88b&gt;] (kernel_init_freeable+0xfb/0x134)
[    1.780000] [&lt;001fc88b&gt;] (kernel_init_freeable) from [&lt;00167ee3&gt;] (kernel_init+0x7/0x9c)
[    1.790000] [&lt;00167ee3&gt;] (kernel_init) from [&lt;00009b65&gt;] (ret_from_fork+0x11/0x2c)

Signed-off-by: Alexandre TORGUE &lt;alexandre.torgue@st.com&gt;
Signed-off-by: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: mmio: Also read bits that are zero</title>
<updated>2018-01-16T22:42:36+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2018-01-16T08:51:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=07c7b6a52503ac13ae357a8b3ef3456590a64b65'/>
<id>07c7b6a52503ac13ae357a8b3ef3456590a64b65</id>
<content type='text'>
The code for .get_multiple() has bugs:

1. The simple .get_multiple() just reads a register, masks it
and sets the return value. This is not correct: we only want to
assign values (whether 0 or 1) to the bits that are set in the
mask. Fix this by using &amp;= ~mask to clear all bits in the mask
and then |= val &amp; mask to set the corresponding bits from the
read.

2. The bgpio_get_multiple_be() call has a similar problem: it
uses the |= operator to set the bits, so only the bits in the
mask are affected, but it misses to clear all returned bits
from the mask initially, so some bits will be returned
erroneously set to 1.

3. The bgpio_get_set_multiple() again fails to clear the bits
from the mask.

4. find_next_bit() wasn't handled correctly, use a totally
different approach for one function and change the other
function to follow the design pattern of assigning the first
bit to -1, then use bit + 1 in the for loop and &lt; num_iterations
as break condition.

Fixes: 80057cb417b2 ("gpio-mmio: Use the new .get_multiple() callback")
Cc: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
Reported-by: Clemens Gruber &lt;clemens.gruber@pqgruber.com&gt;
Tested-by: Clemens Gruber &lt;clemens.gruber@pqgruber.com&gt;
Reported-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code for .get_multiple() has bugs:

1. The simple .get_multiple() just reads a register, masks it
and sets the return value. This is not correct: we only want to
assign values (whether 0 or 1) to the bits that are set in the
mask. Fix this by using &amp;= ~mask to clear all bits in the mask
and then |= val &amp; mask to set the corresponding bits from the
read.

2. The bgpio_get_multiple_be() call has a similar problem: it
uses the |= operator to set the bits, so only the bits in the
mask are affected, but it misses to clear all returned bits
from the mask initially, so some bits will be returned
erroneously set to 1.

3. The bgpio_get_set_multiple() again fails to clear the bits
from the mask.

4. find_next_bit() wasn't handled correctly, use a totally
different approach for one function and change the other
function to follow the design pattern of assigning the first
bit to -1, then use bit + 1 in the for loop and &lt; num_iterations
as break condition.

Fixes: 80057cb417b2 ("gpio-mmio: Use the new .get_multiple() callback")
Cc: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
Reported-by: Clemens Gruber &lt;clemens.gruber@pqgruber.com&gt;
Tested-by: Clemens Gruber &lt;clemens.gruber@pqgruber.com&gt;
Reported-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
