<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/pinctrl, branch v5.19</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=v5.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-07-18T22:57:38Z</updated>
<entry>
<title>pinctrl: armada-37xx: use raw spinlocks for regmap to avoid invalid wait context</title>
<updated>2022-07-18T22:57:38Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2022-07-16T23:37:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4546760619cfa9b718fe2059ceb07101cf9ff61e'/>
<id>urn:sha1:4546760619cfa9b718fe2059ceb07101cf9ff61e</id>
<content type='text'>
The irqchip-&gt;irq_set_type method is called by __irq_set_trigger() under
the desc-&gt;lock raw spinlock.

The armada-37xx implementation, armada_37xx_irq_set_type(), uses an MMIO
regmap created by of_syscon_register(), which uses plain spinlocks
(the kind that are sleepable on RT).

Therefore, this is an invalid locking scheme for which we get a kernel
splat stating just that ("[ BUG: Invalid wait context ]"), because the
context in which the plain spinlock may sleep is atomic due to the raw
spinlock. We need to go raw spinlocks all the way.

Make this driver create its own MMIO regmap, with use_raw_spinlock=true,
and stop relying on syscon to provide it.

This patch depends on commit 67021f25d952 ("regmap: teach regmap to use
raw spinlocks if requested in the config").

Cc: &lt;stable@vger.kernel.org&gt; # 5.15+
Fixes: 2f227605394b ("pinctrl: armada-37xx: Add irqchip support")
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Link: https://lore.kernel.org/r/20220716233745.1704677-3-vladimir.oltean@nxp.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: armada-37xx: make irq_lock a raw spinlock to avoid invalid wait context</title>
<updated>2022-07-18T22:56:01Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2022-07-16T23:37:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=984245b66cf32c494b1e4f95f5ed6ba16b8771eb'/>
<id>urn:sha1:984245b66cf32c494b1e4f95f5ed6ba16b8771eb</id>
<content type='text'>
The irqchip-&gt;irq_set_type method is called by __irq_set_trigger() under
the desc-&gt;lock raw spinlock.

The armada-37xx implementation, armada_37xx_irq_set_type(), takes a
plain spinlock, the kind that becomes sleepable on RT.

Therefore, this is an invalid locking scheme for which we get a kernel
splat stating just that ("[ BUG: Invalid wait context ]"), because the
context in which the plain spinlock may sleep is atomic due to the raw
spinlock. We need to go raw spinlocks all the way.

Replace the driver's irq_lock with a raw spinlock, to disable preemption
even on RT.

Cc: &lt;stable@vger.kernel.org&gt; # 5.15+
Fixes: 2f227605394b ("pinctrl: armada-37xx: Add irqchip support")
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Link: https://lore.kernel.org/r/20220716233745.1704677-2-vladimir.oltean@nxp.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: Don't allow PINCTRL_AMD to be a module</title>
<updated>2022-07-18T10:47:28Z</updated>
<author>
<name>Mario Limonciello</name>
<email>mario.limonciello@amd.com</email>
</author>
<published>2022-07-13T17:59:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=41ef3c1a6bb0fd4a3f81170dd17de3adbff80783'/>
<id>urn:sha1:41ef3c1a6bb0fd4a3f81170dd17de3adbff80783</id>
<content type='text'>
It was observed that by allowing pinctrl_amd to be loaded
later in the boot process that interrupts sent to the GPIO
controller early in the boot are not serviced.  The kernel treats
these as a spurious IRQ and disables the IRQ.

This problem was exacerbated because it happened on a system with
an encrypted partition so the kernel object was not accesssible for
an extended period of time while waiting for a passphrase.

To avoid this situation from occurring, stop allowing pinctrl-amd
from being built as a module and instead require it to be built-in
or disabled.

Reported-by: madcatx@atlas.cz
Suggested-by: jwrdegoede@fedoraproject.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216230
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20220713175950.964-1-mario.limonciello@amd.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: ocelot: Fix pincfg</title>
<updated>2022-07-18T09:22:43Z</updated>
<author>
<name>Horatiu Vultur</name>
<email>horatiu.vultur@microchip.com</email>
</author>
<published>2022-07-13T19:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ba9c4745fca70bf773b2d5c602dcd85d1a40b07a'/>
<id>urn:sha1:ba9c4745fca70bf773b2d5c602dcd85d1a40b07a</id>
<content type='text'>
The blamed commit changed to use regmaps instead of __iomem. But it
didn't update the register offsets to be at word offset, so it uses byte
offset.
Another issue with the same commit is that it has a limit of 32 registers
which is incorrect. The sparx5 has 64 while lan966x has 77.

Fixes: 076d9e71bcf8 ("pinctrl: ocelot: convert pinctrl to regmap")
Acked-by: Colin Foster &lt;colin.foster@in-advantage.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Horatiu Vultur &lt;horatiu.vultur@microchip.com&gt;
Link: https://lore.kernel.org/r/20220713193750.4079621-3-horatiu.vultur@microchip.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: ocelot: Fix pincfg for lan966x</title>
<updated>2022-07-18T09:22:43Z</updated>
<author>
<name>Horatiu Vultur</name>
<email>horatiu.vultur@microchip.com</email>
</author>
<published>2022-07-13T19:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dc62db7138aa9365480254dda4c3e1316b1b1bbc'/>
<id>urn:sha1:dc62db7138aa9365480254dda4c3e1316b1b1bbc</id>
<content type='text'>
The blamed commit introduce support for lan966x which use the same
pinconf_ops as sparx5. The problem is that pinconf_ops is specific to
sparx5. More precisely the offset of the bits in the pincfg register are
different and also lan966x doesn't have support for
PIN_CONFIG_INPUT_SCHMITT_ENABLE.

Fix this by making pinconf_ops more generic such that it can be also
used by lan966x. This is done by introducing 'ocelot_pincfg_data' which
contains the offset and what is supported for each SOC.

Fixes: 531d6ab36571 ("pinctrl: ocelot: Extend support for lan966x")
Signed-off-by: Horatiu Vultur &lt;horatiu.vultur@microchip.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20220713193750.4079621-2-horatiu.vultur@microchip.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: sunplus: Add check for kcalloc</title>
<updated>2022-07-11T13:04:19Z</updated>
<author>
<name>William Dean</name>
<email>williamsukatube@gmail.com</email>
</author>
<published>2022-07-10T15:48:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=acf50233fc979b566e3b87d329191dcd01e2a72c'/>
<id>urn:sha1:acf50233fc979b566e3b87d329191dcd01e2a72c</id>
<content type='text'>
As the potential failure of the kcalloc(),
it should be better to check it in order to
avoid the dereference of the NULL pointer.

Fixes: aa74c44be19c8 ("pinctrl: Add driver for Sunplus SP7021")
Reported-by: Hacash Robot &lt;hacashRobot@santino.com&gt;
Signed-off-by: William Dean &lt;williamsukatube@gmail.com&gt;
Link: https://lore.kernel.org/r/20220710154822.2610801-1-williamsukatube@163.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: ralink: Check for null return of devm_kcalloc</title>
<updated>2022-07-11T12:40:17Z</updated>
<author>
<name>William Dean</name>
<email>williamsukatube@gmail.com</email>
</author>
<published>2022-07-10T15:49:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3b821e8e406d5650e587b7ac624ac24e9b780a8'/>
<id>urn:sha1:c3b821e8e406d5650e587b7ac624ac24e9b780a8</id>
<content type='text'>
Because of the possible failure of the allocation, data-&gt;domains might
be NULL pointer and will cause the dereference of the NULL pointer
later.
Therefore, it might be better to check it and directly return -ENOMEM
without releasing data manually if fails, because the comment of the
devm_kmalloc() says "Memory allocated with this function is
automatically freed on driver detach.".

Fixes: a86854d0c599b ("treewide: devm_kzalloc() -&gt; devm_kcalloc()")
Reported-by: Hacash Robot &lt;hacashRobot@santino.com&gt;
Signed-off-by: William Dean &lt;williamsukatube@gmail.com&gt;
Link: https://lore.kernel.org/r/20220710154922.2610876-1-williamsukatube@163.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: stm32: fix optional IRQ support to gpios</title>
<updated>2022-06-28T14:12:40Z</updated>
<author>
<name>Fabien Dessenne</name>
<email>fabien.dessenne@foss.st.com</email>
</author>
<published>2022-06-27T14:23:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a1d4ef1adf8bbd302067534ead671a94759687ed'/>
<id>urn:sha1:a1d4ef1adf8bbd302067534ead671a94759687ed</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>pinctrl: imx: Add the zero base flag for imx93</title>
<updated>2022-06-28T13:15:03Z</updated>
<author>
<name>Jacky Bai</name>
<email>ping.bai@nxp.com</email>
</author>
<published>2022-06-13T03:18:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fbc24ebc65507feb9728dc38197f90486148dda0'/>
<id>urn:sha1:fbc24ebc65507feb9728dc38197f90486148dda0</id>
<content type='text'>
On i.MX93, the pin mux reg offset is from 0x0,
so need to add the 'ZERO_OFFSET_VALID' flag to make
sure the pin at mux offset 0 can be found.

Signed-off-by: Jacky Bai &lt;ping.bai@nxp.com&gt;
Link: https://lore.kernel.org/r/20220613031854.1571357-1-ping.bai@nxp.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: sunxi: sunxi_pconf_set: use correct offset</title>
<updated>2022-06-27T09:27:10Z</updated>
<author>
<name>Andrei Lalaev</name>
<email>andrey.lalaev@gmail.com</email>
</author>
<published>2022-05-25T19:04:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cd4c1e65a32afd003b08ad4aafe1e4d3e4e8e61b'/>
<id>urn:sha1:cd4c1e65a32afd003b08ad4aafe1e4d3e4e8e61b</id>
<content type='text'>
Some Allwinner SoCs have 2 pinctrls (PIO and R_PIO).
Previous implementation used absolute pin numbering and it was incorrect
for R_PIO pinctrl.
It's necessary to take into account the base pin number.

Fixes: 90be64e27621 ("pinctrl: sunxi: implement pin_config_set")
Signed-off-by: Andrei Lalaev &lt;andrey.lalaev@gmail.com&gt;
Reviewed-by: Samuel Holland &lt;samuel@sholland.org&gt;
Link: https://lore.kernel.org/r/20220525190423.410609-1-andrey.lalaev@gmail.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
