[PATCH 03/12] pinctrl: single: Protect group and function updates with pctldev->mutex

Bartosz Golaszewski brgl at kernel.org
Wed Dec 2 06:08:04 PST 2026


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 at vger.kernel.org
> Signed-off-by: Lee Jones <lee at kernel.org>
> ---

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski at oss.qualcomm.com>



More information about the linux-arm-kernel mailing list