Hi Biju, On Tue, Aug 15, 2023 at 3:16 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote: > Fix the below random NULL pointer crash during boot by serializing > groups and functions creation in rzv2m_dt_subnode_to_map() with > mutex lock. > > Crash logs: > pc : __pi_strcmp+0x20/0x140 > lr : pinmux_func_name_to_selector+0x68/0xa4 > Call trace: > __pi_strcmp+0x20/0x140 > pinmux_generic_add_function+0x34/0xcc > rzv2m_dt_subnode_to_map+0x2e4/0x418 > rzv2m_dt_node_to_map+0x15c/0x18c > pinctrl_dt_to_map+0x218/0x37c > create_pinctrl+0x70/0x3d8 > > While at it, add comment for lock. > > Fixes: 92a9b8252576 ("pinctrl: renesas: Add RZ/V2M pin and gpio controller driver") > Cc: stable@xxxxxxxxxx > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > --- > v2->v3: > * Added comment for lock. > * Moved map allocation down to reduce lock section. > * Added locks for maps and pinctrl group and function creation/remove > calls > * Added unlock_and_done label for lock error path. Thanks for the update! Upon closer look, I noticed that I had missed that the map allocation is not global, but local to a specific DT node, so it does not need protection by a lock. If no one objects, I will back out that change myself, queue this patch in renesas-pinctrl-for-v6.6, and send a PR tomorrow. Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds