<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/pinctrl/nxp, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-12-01T10:41:48+00:00</updated>
<entry>
<title>pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc()</title>
<updated>2025-12-01T10:41:48+00:00</updated>
<author>
<name>Jared Kangas</name>
<email>jkangas@redhat.com</email>
</author>
<published>2025-11-11T21:54:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6d9f0036d21e86d6500b7c3d264216854c7d12e6'/>
<id>urn:sha1:6d9f0036d21e86d6500b7c3d264216854c7d12e6</id>
<content type='text'>
[ Upstream commit 6010d4d8b55b5d3ae1efb5502c54312e15c14f21 ]

s32_pmx_gpio_request_enable() does not initialize the newly-allocated
gpio_pin_config::list before adding it to s32_pinctrl::gpio_configs.
This could result in a linked list corruption.

Initialize the new list_head with INIT_LIST_HEAD() to fix this.

Fixes: fd84aaa8173d ("pinctrl: add NXP S32 SoC family support")
Signed-off-by: Jared Kangas &lt;jkangas@redhat.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: s32cc: fix uninitialized memory in s32_pinctrl_desc</title>
<updated>2025-12-01T10:41:47+00:00</updated>
<author>
<name>Jared Kangas</name>
<email>jkangas@redhat.com</email>
</author>
<published>2025-11-11T21:54:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3b90bd8aaeb21b513ecc4ed03299e80ece44a333'/>
<id>urn:sha1:3b90bd8aaeb21b513ecc4ed03299e80ece44a333</id>
<content type='text'>
[ Upstream commit 97ea34defbb57bfaf71ce487b1b0865ffd186e81 ]

s32_pinctrl_desc is allocated with devm_kmalloc(), but not all of its
fields are initialized. Notably, num_custom_params is used in
pinconf_generic_parse_dt_config(), resulting in intermittent allocation
errors, such as the following splat when probing i2c-imx:

        WARNING: CPU: 0 PID: 176 at mm/page_alloc.c:4795 __alloc_pages_noprof+0x290/0x300
        [...]
        Hardware name: NXP S32G3 Reference Design Board 3 (S32G-VNP-RDB3) (DT)
        [...]
        Call trace:
         __alloc_pages_noprof+0x290/0x300 (P)
         ___kmalloc_large_node+0x84/0x168
         __kmalloc_large_node_noprof+0x34/0x120
         __kmalloc_noprof+0x2ac/0x378
         pinconf_generic_parse_dt_config+0x68/0x1a0
         s32_dt_node_to_map+0x104/0x248
         dt_to_map_one_config+0x154/0x1d8
         pinctrl_dt_to_map+0x12c/0x280
         create_pinctrl+0x6c/0x270
         pinctrl_get+0xc0/0x170
         devm_pinctrl_get+0x50/0xa0
         pinctrl_bind_pins+0x60/0x2a0
         really_probe+0x60/0x3a0
        [...]
         __platform_driver_register+0x2c/0x40
         i2c_adap_imx_init+0x28/0xff8 [i2c_imx]
        [...]

This results in later parse failures that can cause issues in dependent
drivers:

        s32g-siul2-pinctrl 4009c240.pinctrl: /soc@0/pinctrl@4009c240/i2c0-pins/i2c0-grp0: could not parse node property
        s32g-siul2-pinctrl 4009c240.pinctrl: /soc@0/pinctrl@4009c240/i2c0-pins/i2c0-grp0: could not parse node property
        [...]
        pca953x 0-0022: failed writing register: -6
        i2c i2c-0: IMX I2C adapter registered
        s32g-siul2-pinctrl 4009c240.pinctrl: /soc@0/pinctrl@4009c240/i2c2-pins/i2c2-grp0: could not parse node property
        s32g-siul2-pinctrl 4009c240.pinctrl: /soc@0/pinctrl@4009c240/i2c2-pins/i2c2-grp0: could not parse node property
        i2c i2c-1: IMX I2C adapter registered
        s32g-siul2-pinctrl 4009c240.pinctrl: /soc@0/pinctrl@4009c240/i2c4-pins/i2c4-grp0: could not parse node property
        s32g-siul2-pinctrl 4009c240.pinctrl: /soc@0/pinctrl@4009c240/i2c4-pins/i2c4-grp0: could not parse node property
        i2c i2c-2: IMX I2C adapter registered

Fix this by initializing s32_pinctrl_desc with devm_kzalloc() instead of
devm_kmalloc() in s32_pinctrl_probe(), which sets the previously
uninitialized fields to zero.

Fixes: fd84aaa8173d ("pinctrl: add NXP S32 SoC family support")
Signed-off-by: Jared Kangas &lt;jkangas@redhat.com&gt;
Tested-by: Jan Petrous (OSS) &lt;jan.petrous@oss.nxp.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>of: remove internal arguments from of_property_for_each_u32()</title>
<updated>2025-02-08T08:51:51+00:00</updated>
<author>
<name>Luca Ceresoli</name>
<email>luca.ceresoli@bootlin.com</email>
</author>
<published>2024-07-24T16:33:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=914ef7d1a702c510d0b59151a9623f9d20c69d2a'/>
<id>urn:sha1:914ef7d1a702c510d0b59151a9623f9d20c69d2a</id>
<content type='text'>
[ Upstream commit 9722c3b66e21ff08aec570d02a97d331087fd70f ]

The of_property_for_each_u32() macro needs five parameters, two of which
are primarily meant as internal variables for the macro itself (in the
for() clause). Yet these two parameters are used by a few drivers, and this
can be considered misuse or at least bad practice.

Now that the kernel uses C11 to build, these two parameters can be avoided
by declaring them internally, thus changing this pattern:

  struct property *prop;
  const __be32 *p;
  u32 val;

  of_property_for_each_u32(np, "xyz", prop, p, val) { ... }

to this:

  u32 val;

  of_property_for_each_u32(np, "xyz", val) { ... }

However two variables cannot be declared in the for clause even with C11,
so declare one struct that contain the two variables we actually need. As
the variables inside this struct are not meant to be used by users of this
macro, give the struct instance the noticeable name "_it" so it is visible
during code reviews, helping to avoid new code to use it directly.

Most usages are trivially converted as they do not use those two
parameters, as expected. The non-trivial cases are:

 - drivers/clk/clk.c, of_clk_get_parent_name(): easily doable anyway
 - drivers/clk/clk-si5351.c, si5351_dt_parse(): this is more complex as the
   checks had to be replicated in a different way, making code more verbose
   and somewhat uglier, but I refrained from a full rework to keep as much
   of the original code untouched having no hardware to test my changes

All the changes have been build tested. The few for which I have the
hardware have been runtime-tested too.

Reviewed-by: Andre Przywara &lt;andre.przywara@arm.com&gt; # drivers/clk/sunxi/clk-simple-gates.c, drivers/clk/sunxi/clk-sun8i-bus-gates.c
Acked-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt; # drivers/gpio/gpio-brcmstb.c
Acked-by: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt; # drivers/irqchip/irq-atmel-aic-common.c
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt; # drivers/iio/adc/ti_am335x_adc.c
Acked-by: Uwe Kleine-König &lt;u.kleine-koenig@baylibre.com&gt; # drivers/pwm/pwm-samsung.c
Acked-by: Richard Leitner &lt;richard.leitner@linux.dev&gt; # drivers/usb/misc/usb251xb.c
Acked-by: Mark Brown &lt;broonie@kernel.org&gt; # sound/soc/codecs/arizona.c
Reviewed-by: Richard Fitzgerald &lt;rf@opensource.cirrus.com&gt; # sound/soc/codecs/arizona.c
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; # arch/powerpc/sysdev/xive/spapr.c
Acked-by: Stephen Boyd &lt;sboyd@kernel.org&gt; # clk
Signed-off-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Link: https://lore.kernel.org/r/20240724-of_property_for_each_u32-v3-1-bea82ce429e2@bootlin.com
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Stable-dep-of: 28fa3291cad1 ("clk: fix an OF node reference leak in of_clk_get_parent_name()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: s32cc: Avoid possible string truncation</title>
<updated>2024-01-20T10:51:37+00:00</updated>
<author>
<name>Chester Lin</name>
<email>clin@suse.com</email>
</author>
<published>2023-11-07T14:10:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f88c602fd0ab289d03e0e279ce83ddf01c24ec22'/>
<id>urn:sha1:f88c602fd0ab289d03e0e279ce83ddf01c24ec22</id>
<content type='text'>
[ Upstream commit 08e8734d877a9a0fb8af1254a4ce58734fbef296 ]

With "W=1" and "-Wformat-truncation" build options, the kernel test robot
found a possible string truncation warning in pinctrl-s32cc.c, which uses
an 8-byte char array to hold a memory region name "map%u". Since the
maximum number of digits that a u32 value can present is 10, and the "map"
string occupies 3 bytes with a termination '\0', which means the rest 4
bytes cannot fully present the integer "X" that exceeds 4 digits.

Here we check if the number &gt;= 10000, which is the lowest value that
contains more than 4 digits.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202311030159.iyUGjNGF-lkp@intel.com/
Signed-off-by: Chester Lin &lt;clin@suse.com&gt;
Link: https://lore.kernel.org/r/20231107141044.24058-1-clin@suse.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: Explicitly include correct DT includes</title>
<updated>2023-07-20T19:41:24+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-07-14T17:48:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=060f03e95454a0f4a1deff3e5f912e461ae0f0c5'/>
<id>urn:sha1:060f03e95454a0f4a1deff3e5f912e461ae0f0c5</id>
<content type='text'>
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Acked-by: Emil Renner Berthing &lt;emil.renner.berthing@canonical.com&gt;
Acked-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://lore.kernel.org/r/20230714174901.4062397-1-robh@kernel.org
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: nxp: Fix resource leaks in for_each_child_of_node() loops</title>
<updated>2023-06-09T07:24:51+00:00</updated>
<author>
<name>Lu Hongfei</name>
<email>luhongfei@vivo.com</email>
</author>
<published>2023-06-06T07:02:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b2132afec09772f1f2f0ddbe223be41431e46924'/>
<id>urn:sha1:b2132afec09772f1f2f0ddbe223be41431e46924</id>
<content type='text'>
Ensure child node references are decremented properly in the error path.

Signed-off-by: Lu Hongfei &lt;luhongfei@vivo.com&gt;
Link: https://lore.kernel.org/r/20230606070201.14249-1-luhongfei@vivo.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: s32: separate const device data from struct s32_pinctrl_soc_info</title>
<updated>2023-06-02T07:36:25+00:00</updated>
<author>
<name>Chester Lin</name>
<email>clin@suse.com</email>
</author>
<published>2023-03-29T04:16:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0da4cebebc37b0f68c1ad991a1c6e4ecdb1bbc41'/>
<id>urn:sha1:0da4cebebc37b0f68c1ad991a1c6e4ecdb1bbc41</id>
<content type='text'>
The .data field in struct of_device_id is used as a const member so it's
inappropriate to attach struct s32_pinctrl_soc_info with of_device_id
because some members in s32_pinctrl_soc_info need to be filled by
pinctrl-s32cc at runtime.

For this reason, struct s32_pinctrl_soc_info must be allocated in
pinctrl-s32cc and then create a new struct s32_pinctrl_soc_data in order
to represent const .data in of_device_id. To combine these two structures,
a s32_pinctrl_soc_data pointer is introduced in s32_pinctrl_soc_info.

Besides, use of_device_get_match_data() instead of of_match_device() since
the driver only needs to retrieve the .data from of_device_id.

Link: https://lore.kernel.org/r/20230329041630.8011-1-clin@suse.com/
Suggested-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Chester Lin &lt;clin@suse.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: s32cc: Use generic struct data to describe pin function</title>
<updated>2023-03-27T21:36:18+00:00</updated>
<author>
<name>Chester Lin</name>
<email>clin@suse.com</email>
</author>
<published>2023-03-27T06:27:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=966b0e64b6891aa785d9e44abad069d515f6cb8f'/>
<id>urn:sha1:966b0e64b6891aa785d9e44abad069d515f6cb8f</id>
<content type='text'>
Replace struct s32_pmx_func with generic struct pinfunction since they
have the same data fields.

Suggested-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Chester Lin &lt;clin@suse.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20230327062754.3326-5-clin@suse.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: s32cc: embed generic struct pingroup</title>
<updated>2023-03-27T21:35:35+00:00</updated>
<author>
<name>Chester Lin</name>
<email>clin@suse.com</email>
</author>
<published>2023-03-27T06:27:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ff169e8448ccbc569f2cc8767a4f34f3dbbc160'/>
<id>urn:sha1:8ff169e8448ccbc569f2cc8767a4f34f3dbbc160</id>
<content type='text'>
Use generic data structure to describe pin control groups in S32 SoC family
and drop duplicated struct members.

Suggested-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Chester Lin &lt;clin@suse.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20230327062754.3326-4-clin@suse.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: s32cc: refactor pin config parsing</title>
<updated>2023-03-27T21:35:00+00:00</updated>
<author>
<name>Chester Lin</name>
<email>clin@suse.com</email>
</author>
<published>2023-03-27T06:27:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=48b016cbb2f48ce4cbefd91f63a0d0dded975932'/>
<id>urn:sha1:48b016cbb2f48ce4cbefd91f63a0d0dded975932</id>
<content type='text'>
Move common codes into smaller inline functions and remove argument checks
that are not actually used by pull up/down bits in the S32 MSCR register.

Signed-off-by: Chester Lin &lt;clin@suse.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20230327062754.3326-3-clin@suse.com
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
