<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/drivers/gpio/gpio-eic-sprd.c, branch linux-7.2.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-7.2.y</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-7.2.y'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2026-06-18T08:02:13+00:00</updated>
<entry>
<title>gpio: eic-sprd: use raw_spinlock_t in the irq startup path</title>
<updated>2026-06-18T08:02:13+00:00</updated>
<author>
<name>Runyu Xiao</name>
<email>runyu.xiao@seu.edu.cn</email>
</author>
<published>2026-06-17T15:40:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=90f0109019e6817eb40a486671b7722d1544ae29'/>
<id>urn:sha1:90f0109019e6817eb40a486671b7722d1544ae29</id>
<content type='text'>
sprd_eic_irq_unmask() enables the GPIO IRQ and then updates controller
state through sprd_eic_update(), which takes sprd_eic-&gt;lock with
spin_lock_irqsave().  The callback can be reached from irq_startup()
while setting up a requested IRQ.  That path is not sleepable, but on
PREEMPT_RT a regular spinlock_t becomes a sleeping lock.

This issue was found by our static analysis tool and then manually
reviewed against the current tree.

The grounded PoC kept the request_threaded_irq() -&gt; __setup_irq() -&gt;
irq_startup() -&gt; sprd_eic_irq_unmask() -&gt; sprd_eic_update() carrier and
used the original spin_lock_irqsave(&amp;sprd_eic-&gt;lock) edge.  Lockdep
reported:

  BUG: sleeping function called from invalid context
  hardirqs last disabled at ... __setup_irq.constprop.0 ... [vuln_msv]
  sprd_rt_spin_lock_irqsave+0x1c/0x30 [vuln_msv]
  sprd_eic_update.constprop.0+0x48/0x90 [vuln_msv]
  sprd_eic_irq_unmask.constprop.0+0x35/0x50 [vuln_msv]
  __setup_irq.constprop.0+0xd/0x30 [vuln_msv]

Convert the Spreadtrum EIC controller lock to raw_spinlock_t.  The
locked section only serializes MMIO register updates and does not contain
sleepable operations, so keeping it non-sleeping is appropriate for the
irqchip callbacks.

Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support")
Cc: stable@vger.kernel.org
Signed-off-by: Runyu Xiao &lt;runyu.xiao@seu.edu.cn&gt;
Reviewed-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Link: https://patch.msgid.link/20260617154035.1199948-3-runyu.xiao@seu.edu.cn
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@oss.qualcomm.com&gt;
</content>
</entry>
<entry>
<title>treewide: rename GPIO set callbacks back to their original names</title>
<updated>2025-08-07T08:07:06+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@linaro.org</email>
</author>
<published>2025-07-17T13:21:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d9d87d90cc0b10cd56ae353f50b11417e7d21712'/>
<id>urn:sha1:d9d87d90cc0b10cd56ae353f50b11417e7d21712</id>
<content type='text'>
The conversion of all GPIO drivers to using the .set_rv() and
.set_multiple_rv() callbacks from struct gpio_chip (which - unlike their
predecessors - return an integer and allow the controller drivers to
indicate failures to users) is now complete and the legacy ones have
been removed. Rename the new callbacks back to their original names in
one sweeping change.

Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: eic-sprd: use new line value setter callbacks</title>
<updated>2025-04-16T15:52:42+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@linaro.org</email>
</author>
<published>2025-04-07T07:13:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=21d3c6531b113b1aaecd99ae90dddd55c20f372b'/>
<id>urn:sha1:21d3c6531b113b1aaecd99ae90dddd55c20f372b</id>
<content type='text'>
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-2-78399683ca38@linaro.org
Signed-off-by: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
</content>
</entry>
<entry>
<title>gpio: eic-sprd: use generic device_get_match_data()</title>
<updated>2024-10-14T08:28:56+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@linaro.org</email>
</author>
<published>2024-10-07T10:28:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1396470c11d4f30b4d4f444adf353848b48c74da'/>
<id>urn:sha1:1396470c11d4f30b4d4f444adf353848b48c74da</id>
<content type='text'>
There's no need to use the OF-specific variant to get the match data.
Switch to using device_get_match_data() instead.

Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Link: https://lore.kernel.org/r/20241007102859.35602-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v6.8-rc4' into gpio/for-next</title>
<updated>2024-02-12T09:12:41+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@linaro.org</email>
</author>
<published>2024-02-12T09:12:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=104e00bbc76fc2a0fe887649d01d9c15f0e08021'/>
<id>urn:sha1:104e00bbc76fc2a0fe887649d01d9c15f0e08021</id>
<content type='text'>
Linux 6.8-rc4

Pulling this for a bugfix upstream with which the gpio/for-next branch
conflicts.
</content>
</entry>
<entry>
<title>gpio: eic-sprd: Clear interrupt after set the interrupt type</title>
<updated>2024-01-22T10:38:08+00:00</updated>
<author>
<name>Wenhua Lin</name>
<email>Wenhua.Lin@unisoc.com</email>
</author>
<published>2024-01-09T07:38:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=84aef4ed59705585d629e81d633a83b7d416f5fb'/>
<id>urn:sha1:84aef4ed59705585d629e81d633a83b7d416f5fb</id>
<content type='text'>
The raw interrupt status of eic maybe set before the interrupt is enabled,
since the eic interrupt has a latch function, which would trigger the
interrupt event once enabled it from user side. To solve this problem,
interrupts generated before setting the interrupt trigger type are ignored.

Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support")
Acked-by: Chunyan Zhang &lt;zhang.lyra@gmail.com&gt;
Signed-off-by: Wenhua Lin &lt;Wenhua.Lin@unisoc.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: eic-sprd: Optimize the calculation method of eic number</title>
<updated>2024-01-22T10:37:59+00:00</updated>
<author>
<name>Wenhua Lin</name>
<email>Wenhua.Lin@unisoc.com</email>
</author>
<published>2024-01-09T07:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=44a0d880b91dcaf3bb62a1ffa7253fe5373cd296'/>
<id>urn:sha1:44a0d880b91dcaf3bb62a1ffa7253fe5373cd296</id>
<content type='text'>
The num_eics is a default value, but some SoCs support more than 8.
In order to adapt to all projects, the total number of eics is
automatically calculated through dts.

Signed-off-by: Wenhua Lin &lt;Wenhua.Lin@unisoc.com&gt;
Acked-by: Chunyan Zhang &lt;zhang.lyra@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: eic-sprd: use a helper variable for &amp;pdev-&gt;dev</title>
<updated>2023-09-13T12:13:32+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@linaro.org</email>
</author>
<published>2023-09-12T09:45:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7777fa924754f69f9748d6fe730b1e6f38adf252'/>
<id>urn:sha1:7777fa924754f69f9748d6fe730b1e6f38adf252</id>
<content type='text'>
Instead of dereferencing pdev everywhere, just store the address of the
underlying struct device in a local variable.

Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>gpio: eic-sprd: unregister from the irq notifier on remove()</title>
<updated>2023-09-13T12:13:06+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@linaro.org</email>
</author>
<published>2023-09-12T09:45:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dbd31c71c5b2cc6dd7acd853e52fb6e7a37fdf61'/>
<id>urn:sha1:dbd31c71c5b2cc6dd7acd853e52fb6e7a37fdf61</id>
<content type='text'>
This is a tristate module, it can be unloaded. We need to cleanup properly
and unregister from the interrupt notifier on driver detach.

Fixes: b32415652a4d ("gpio: eic-sprd: use atomic notifiers to notify all chips about irqs")
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>gpio: eic-sprd: use atomic notifiers to notify all chips about irqs</title>
<updated>2023-09-11T09:17:06+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@linaro.org</email>
</author>
<published>2023-09-04T12:33:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b32415652a4d250c51c1f1cc59a02c58e7141417'/>
<id>urn:sha1:b32415652a4d250c51c1f1cc59a02c58e7141417</id>
<content type='text'>
Calling gpiochip_find() from interrupt handler in this driver is an
abuse of the GPIO API. It only happens to work because nobody added a
might_sleep() to it and the lock used by GPIOLIB is a spinlock.

Both will soon be changed as we're limiting both the number of
interfaces allowed to be called from atomic context as well as making
struct gpio_chip private to the GPIO code that owns it. We'll also
switch to protecting the global GPIO device list with a mutex as there
is no reason to allow changes to it from interrupt handlers.

Instead of iterating over all SPRD chips and looking up each
corresponding GPIO chip, let's make each SPRD GPIO controller register
with a notifier chain. The chain will be called at interrupt so that
every chip that already probed will be notified. The rest of the
interrupt handling remains the same. This should result in faster code as
we're avoiding iterating over the list of all GPIO devices.

Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
Reviewed-by: Chunyan Zhang &lt;zhang.lyra@gmail.com&gt;
Tested-by: Wenhua Lin &lt;wenhua.lin@unisoc.com&gt;
</content>
</entry>
</feed>
