Re: Question: GPIO direction callbacks calling pinctrl in atomic paths

From: Linus Walleij

Date: Thu Jun 18 2026 - 09:26:12 EST


Hi Runyu,

thanks for your report!

On Thu, Jun 18, 2026 at 5:11 AM Runyu Xiao <runyu.xiao@xxxxxxxxxx> wrote:

> The class of path we looked at is:
>
> gpiod_direction_output_raw_commit()
> -> <driver>_gpio_direction_output()
> -> pinctrl_gpio_direction_output()
> -> pinctrl_get_device_gpio_range()
> -> mutex_lock(&pctldev->mutex)

Again that is mutex_lock(&pinctrldev_list_mutex); is it not?

If we go with my suggestion in the previous report to just
replace this mutex with a spinlock, I think this issue will
also be solved.

Am I right?

Yours,
Linus Walleij