Re: [PATCH 03/12] pinctrl: single: Protect group and function updates with pctldev->mutex
From: Bartosz Golaszewski
Date: Wed Dec 02 2026 - 09:08:17 EST
On Wed, Dec 02, 2026 at 09:29:57AM +0000, Lee Jones wrote:
> pcs_parse_one_pinctrl_entry() and pcs_parse_bits_in_pinctrl_entry()
> mutate pcs->pctl->pin_function_tree and pcs->pctl->pin_group_tree via
> pcs_add_function(), pinctrl_generic_add_group(), and their removal
> helpers while holding only the driver-private pcs->mutex. However, the
> pinctrl core debugfs readers and teardown paths traverse and modify
> those radix trees under pctldev->mutex, leaving concurrent readers and
> writers racing without a shared lock.
>
> Acquire pcs->pctl->mutex instead of pcs->mutex in both parsing
> functions so all generic group and function tree operations are
> serialised against the pinctrl core.
>
> Fixes: a4ab10860723 ("pinctrl: single: Fix group and function selector use")
> Closes: https://sashiko.dev/#/bug/linux-e32b7426-4575-4354-a2fe-409cde3480ce
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
> ---
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>