<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/pinctrl/stm32, branch v5.10.258</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.258</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.258'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-01-19T12:11:29+00:00</updated>
<entry>
<title>pinctrl: stm32: fix hwspinlock resource leak in probe function</title>
<updated>2026-01-19T12:11:29+00:00</updated>
<author>
<name>Haotian Zhang</name>
<email>vulab@iscas.ac.cn</email>
</author>
<published>2025-10-29T01:42:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=923b81f0d50e24767b89974872b32e04289b1eba'/>
<id>urn:sha1:923b81f0d50e24767b89974872b32e04289b1eba</id>
<content type='text'>
[ Upstream commit 002679f79ed605e543fbace465557317cd307c9a ]

In stm32_pctl_probe(), hwspin_lock_request_specific() is called to
request a hwspinlock, but the acquired lock is not freed on multiple
error paths after this call. This causes resource leakage when the
function fails to initialize properly.

Use devm_hwspin_lock_request_specific() instead of
hwspin_lock_request_specific() to automatically manage the hwspinlock
resource lifecycle.

Fixes: 97cfb6cd34f2 ("pinctrl: stm32: protect configuration registers with a hwspinlock")
Signed-off-by: Haotian Zhang &lt;vulab@iscas.ac.cn&gt;
Reviewed-by: Antonio Borneo &lt;antonio.borneo@foss.st.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: Manage irq affinity settings</title>
<updated>2025-08-28T14:22:45+00:00</updated>
<author>
<name>Cheick Traore</name>
<email>cheick.traore@foss.st.com</email>
</author>
<published>2025-06-10T14:30:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ac018e3961b4c935ffac5da2f1240bfa56728348'/>
<id>urn:sha1:ac018e3961b4c935ffac5da2f1240bfa56728348</id>
<content type='text'>
[ Upstream commit 4c5cc2f65386e22166ce006efe515c667aa075e4 ]

Trying to set the affinity of the interrupts associated to stm32
pinctrl results in a write error.

Fill struct irq_chip::irq_set_affinity to use the default helper
function.

Signed-off-by: Cheick Traore &lt;cheick.traore@foss.st.com&gt;
Signed-off-by: Antonio Borneo &lt;antonio.borneo@foss.st.com&gt;
Link: https://lore.kernel.org/20250610143042.295376-3-antonio.borneo@foss.st.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: Fix refcount leak in stm32_pctrl_get_irq_domain</title>
<updated>2023-03-11T15:39:31+00:00</updated>
<author>
<name>Miaoqian Lin</name>
<email>linmq006@gmail.com</email>
</author>
<published>2023-01-02T08:24:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ab860dd8717a7e4a143988885fea0d7e5a9412e'/>
<id>urn:sha1:8ab860dd8717a7e4a143988885fea0d7e5a9412e</id>
<content type='text'>
[ Upstream commit dcef18c8ac40aa85bb339f64c1dd31dd458b06fb ]

of_irq_find_parent() returns a node pointer with refcount incremented,
We should use of_node_put() on it when not needed anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: d86f4d71e42a ("pinctrl: stm32: check irq controller availability at probe")
Signed-off-by: Miaoqian Lin &lt;linmq006@gmail.com&gt;
Link: https://lore.kernel.org/r/20230102082503.3944927-1-linmq006@gmail.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: fix optional IRQ support to gpios</title>
<updated>2022-07-29T15:19:06+00:00</updated>
<author>
<name>Fabien Dessenne</name>
<email>fabien.dessenne@foss.st.com</email>
</author>
<published>2022-06-27T14:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=31f3bb363a8972891b51747f27665663bce17a5b'/>
<id>urn:sha1:31f3bb363a8972891b51747f27665663bce17a5b</id>
<content type='text'>
commit a1d4ef1adf8bbd302067534ead671a94759687ed upstream.

To act as an interrupt controller, a gpio bank relies on the
"interrupt-parent" of the pin controller.
When this optional "interrupt-parent" misses, do not create any IRQ domain.

This fixes a "NULL pointer in stm32_gpio_domain_alloc()" kernel crash when
the interrupt-parent = &lt;exti&gt; property is not declared in the Device Tree.

Fixes: 0eb9f683336d ("pinctrl: Add IRQ support to STM32 gpios")
Signed-off-by: Fabien Dessenne &lt;fabien.dessenne@foss.st.com&gt;
Link: https://lore.kernel.org/r/20220627142350.742973-1-fabien.dessenne@foss.st.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: Keep pinctrl block clock enabled when LEVEL IRQ requested</title>
<updated>2022-05-09T07:05:03+00:00</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2022-04-21T14:08:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ce4c3f70878704e52d117f2b3d305d2e7c5d1439'/>
<id>urn:sha1:ce4c3f70878704e52d117f2b3d305d2e7c5d1439</id>
<content type='text'>
[ Upstream commit 05d8af449d93e04547b4c6b328e39c890bc803f4 ]

The current EOI handler for LEVEL triggered interrupts calls clk_enable(),
register IO, clk_disable(). The clock manipulation requires locking which
happens with IRQs disabled in clk_enable_lock(). Instead of turning the
clock on and off all the time, enable the clock in case LEVEL interrupt is
requested and keep the clock enabled until all LEVEL interrupts are freed.
The LEVEL interrupts are an exception on this platform and seldom used, so
this does not affect the common case.

This simplifies the LEVEL interrupt handling considerably and also fixes
the following splat found when using preempt-rt:
 ------------[ cut here ]------------
 WARNING: CPU: 0 PID: 0 at kernel/locking/rtmutex.c:2040 __rt_mutex_trylock+0x37/0x62
 Modules linked in:
 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.10.109-rt65-stable-standard-00068-g6a5afc4b1217 #85
 Hardware name: STM32 (Device Tree Support)
 [&lt;c010a45d&gt;] (unwind_backtrace) from [&lt;c010766f&gt;] (show_stack+0xb/0xc)
 [&lt;c010766f&gt;] (show_stack) from [&lt;c06353ab&gt;] (dump_stack+0x6f/0x84)
 [&lt;c06353ab&gt;] (dump_stack) from [&lt;c01145e3&gt;] (__warn+0x7f/0xa4)
 [&lt;c01145e3&gt;] (__warn) from [&lt;c063386f&gt;] (warn_slowpath_fmt+0x3b/0x74)
 [&lt;c063386f&gt;] (warn_slowpath_fmt) from [&lt;c063b43d&gt;] (__rt_mutex_trylock+0x37/0x62)
 [&lt;c063b43d&gt;] (__rt_mutex_trylock) from [&lt;c063c053&gt;] (rt_spin_trylock+0x7/0x16)
 [&lt;c063c053&gt;] (rt_spin_trylock) from [&lt;c036a2f3&gt;] (clk_enable_lock+0xb/0x80)
 [&lt;c036a2f3&gt;] (clk_enable_lock) from [&lt;c036ba69&gt;] (clk_core_enable_lock+0x9/0x18)
 [&lt;c036ba69&gt;] (clk_core_enable_lock) from [&lt;c034e9f3&gt;] (stm32_gpio_get+0x11/0x24)
 [&lt;c034e9f3&gt;] (stm32_gpio_get) from [&lt;c034ef43&gt;] (stm32_gpio_irq_trigger+0x1f/0x48)
 [&lt;c034ef43&gt;] (stm32_gpio_irq_trigger) from [&lt;c014aa53&gt;] (handle_fasteoi_irq+0x71/0xa8)
 [&lt;c014aa53&gt;] (handle_fasteoi_irq) from [&lt;c0147111&gt;] (generic_handle_irq+0x19/0x22)
 [&lt;c0147111&gt;] (generic_handle_irq) from [&lt;c014752d&gt;] (__handle_domain_irq+0x55/0x64)
 [&lt;c014752d&gt;] (__handle_domain_irq) from [&lt;c0346f13&gt;] (gic_handle_irq+0x53/0x64)
 [&lt;c0346f13&gt;] (gic_handle_irq) from [&lt;c0100ba5&gt;] (__irq_svc+0x65/0xc0)
 Exception stack(0xc0e01f18 to 0xc0e01f60)
 1f00:                                                       0000300c 00000000
 1f20: 0000300c c010ff01 00000000 00000000 c0e00000 c0e07714 00000001 c0e01f78
 1f40: c0e07758 00000000 ef7cd0ff c0e01f68 c010554b c0105542 40000033 ffffffff
 [&lt;c0100ba5&gt;] (__irq_svc) from [&lt;c0105542&gt;] (arch_cpu_idle+0xc/0x1e)
 [&lt;c0105542&gt;] (arch_cpu_idle) from [&lt;c063be95&gt;] (default_idle_call+0x21/0x3c)
 [&lt;c063be95&gt;] (default_idle_call) from [&lt;c01324f7&gt;] (do_idle+0xe3/0x1e4)
 [&lt;c01324f7&gt;] (do_idle) from [&lt;c01327b3&gt;] (cpu_startup_entry+0x13/0x14)
 [&lt;c01327b3&gt;] (cpu_startup_entry) from [&lt;c0a00c13&gt;] (start_kernel+0x397/0x3d4)
 [&lt;c0a00c13&gt;] (start_kernel) from [&lt;00000000&gt;] (0x0)
 ---[ end trace 0000000000000002 ]---

Power consumption measured on STM32MP157C DHCOM SoM is not increased or
is below noise threshold.

Fixes: 47beed513a85b ("pinctrl: stm32: Add level interrupt support to gpio irq chip")
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Cc: Alexandre Torgue &lt;alexandre.torgue@foss.st.com&gt;
Cc: Fabien Dessenne &lt;fabien.dessenne@foss.st.com&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Marc Zyngier &lt;maz@kernel.org&gt;
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
To: linux-gpio@vger.kernel.org
Reviewed-by: Fabien Dessenne &lt;fabien.dessenne@foss.st.com&gt;
Link: https://lore.kernel.org/r/20220421140827.214088-1-marex@denx.de
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: Do not call stm32_gpio_get() for edge triggered IRQs in EOI</title>
<updated>2022-05-09T07:05:02+00:00</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2022-04-15T21:54:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=690c1bc4bfcfc26d67402a6d6d308b975b2b4cd4'/>
<id>urn:sha1:690c1bc4bfcfc26d67402a6d6d308b975b2b4cd4</id>
<content type='text'>
[ Upstream commit e74200ebf7c4f6a7a7d1be9f63833ddba251effa ]

The stm32_gpio_get() should only be called for LEVEL triggered interrupts,
skip calling it for EDGE triggered interrupts altogether to avoid wasting
CPU cycles in EOI handler. On this platform, EDGE triggered interrupts are
the majority and LEVEL triggered interrupts are the exception no less, and
the CPU cycles are not abundant.

Fixes: 47beed513a85b ("pinctrl: stm32: Add level interrupt support to gpio irq chip")
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Cc: Alexandre Torgue &lt;alexandre.torgue@foss.st.com&gt;
Cc: Fabien Dessenne &lt;fabien.dessenne@foss.st.com&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Marc Zyngier &lt;maz@kernel.org&gt;
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
To: linux-gpio@vger.kernel.org
Link: https://lore.kernel.org/r/20220415215410.498349-1-marex@denx.de
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines</title>
<updated>2021-12-29T11:26:03+00:00</updated>
<author>
<name>Fabien Dessenne</name>
<email>fabien.dessenne@foss.st.com</email>
</author>
<published>2021-12-15T09:58:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f5b02912e2dd89fe2386c19edd2c6f3e1296fc2b'/>
<id>urn:sha1:f5b02912e2dd89fe2386c19edd2c6f3e1296fc2b</id>
<content type='text'>
commit b67210cc217f9ca1c576909454d846970c13dfd4 upstream.

Consider the GPIO controller offset (from "gpio-ranges") to compute the
maximum GPIO line number.
This fixes an issue where gpio-ranges uses a non-null offset.
  e.g.: gpio-ranges = &lt;&amp;pinctrl 6 86 10&gt;
        In that case the last valid GPIO line is not 9 but 15 (6 + 10 - 1)

Cc: stable@vger.kernel.org
Fixes: 67e2996f72c7 ("pinctrl: stm32: fix the reported number of GPIO lines per bank")
Reported-by: Christoph Fritz &lt;chf.fritz@googlemail.com&gt;
Signed-off-by: Fabien Dessenne &lt;fabien.dessenne@foss.st.com&gt;
Link: https://lore.kernel.org/r/20211215095808.621716-1-fabien.dessenne@foss.st.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: use valid pin identifier in stm32_pinctrl_resume()</title>
<updated>2021-10-27T07:56:56+00:00</updated>
<author>
<name>Fabien Dessenne</name>
<email>fabien.dessenne@foss.st.com</email>
</author>
<published>2021-10-08T12:25:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cfa79faf7e1ffa93e76461c7716864377bff76bd'/>
<id>urn:sha1:cfa79faf7e1ffa93e76461c7716864377bff76bd</id>
<content type='text'>
commit c370bb474016ab9edfdabd7c08a88dd13a71ddbd upstream.

When resuming from low power, the driver attempts to restore the
configuration of some pins. This is done by a call to:
  stm32_pinctrl_restore_gpio_regs(struct stm32_pinctrl *pctl, u32 pin)
where 'pin' must be a valid pin value (i.e. matching some 'groups-&gt;pin').
Fix the current implementation which uses some wrong 'pin' value.

Fixes: e2f3cf18c3e2 ("pinctrl: stm32: add suspend/resume management")
Signed-off-by: Fabien Dessenne &lt;fabien.dessenne@foss.st.com&gt;
Link: https://lore.kernel.org/r/20211008122517.617633-1-fabien.dessenne@foss.st.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: fix the reported number of GPIO lines per bank</title>
<updated>2021-06-30T12:47:24+00:00</updated>
<author>
<name>Fabien Dessenne</name>
<email>fabien.dessenne@foss.st.com</email>
</author>
<published>2021-06-17T14:46:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=018d03fcf77a7e6a37503397f871095f7fd909ec'/>
<id>urn:sha1:018d03fcf77a7e6a37503397f871095f7fd909ec</id>
<content type='text'>
[ Upstream commit 67e2996f72c71ebe4ac2fcbcf77e54479bb7aa11 ]

Each GPIO bank supports a variable number of lines which is usually 16, but
is less in some cases : this is specified by the last argument of the
"gpio-ranges" bank node property.
Report to the framework, the actual number of lines, so the libgpiod
gpioinfo command lists the actually existing GPIO lines.

Fixes: 1dc9d289154b ("pinctrl: stm32: add possibility to use gpio-ranges to declare bank range")
Signed-off-by: Fabien Dessenne &lt;fabien.dessenne@foss.st.com&gt;
Link: https://lore.kernel.org/r/20210617144629.2557693-1-fabien.dessenne@foss.st.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: use the hwspin_lock_timeout_in_atomic() API</title>
<updated>2020-07-23T13:19:28+00:00</updated>
<author>
<name>Fabien Dessenne</name>
<email>fabien.dessenne@st.com</email>
</author>
<published>2020-06-15T12:44:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=290a9f937e5a8b4eb41f7e48237816dc6ba0c783'/>
<id>urn:sha1:290a9f937e5a8b4eb41f7e48237816dc6ba0c783</id>
<content type='text'>
Use the hwspin_lock_timeout_in_atomic() API which is the most appropriated
here. Indeed:
- hwspin_lock_() is called after spin_lock_irqsave()
- the hwspin_lock_timeout() API relies on jiffies count which won't work
  if IRQs are disabled which is the case here.

Signed-off-by: Fabien Dessenne &lt;fabien.dessenne@st.com&gt;
Signed-off-by: Alexandre Torgue &lt;alexandre.torgue@st.com&gt;
Link: https://lore.kernel.org/r/20200615124456.27328-1-alexandre.torgue@st.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
