mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: linux-amlogic@lists.infradead.org
Subject: Re: [PATCH] pinctrl: meson: amlogic-a4: fix deadlock issue
Date: Fri, 24 Apr 2026 11:54:50 +0200	[thread overview]
Message-ID: <bab0f4be-31e1-4fe7-8e90-5131b1ae44b2@linaro.org> (raw)
In-Reply-To: <20260422-fix-pinconf-v1-1-abb4d2e0da55@amlogic.com>

On 4/22/26 13:44, Xianwei Zhao via B4 Relay wrote:
> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
> 
> Accessing the pinconf-pins sysfs node may deadlock.
> 
> pinconf_pins_show() holds pctldev->mutex, and the platform driver
> calls pinctrl_find_gpio_range_from_pin(), which tries to acquire
> the same mutex again, leading to a deadlock.
> 
> Use pinctrl_find_gpio_range_from_pin_nolock() to fix this issue.
> 
> Fixes: 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs")
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
> Fix deadlock issue.
> ---
>   drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> index e2293a872dcb..35d27626a336 100644
> --- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> +++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> @@ -292,7 +292,7 @@ static int aml_calc_reg_and_bit(struct pinctrl_gpio_range *range,
>   static int aml_pinconf_get_pull(struct aml_pinctrl *info, unsigned int pin)
>   {
>   	struct pinctrl_gpio_range *range =
> -			 pinctrl_find_gpio_range_from_pin(info->pctl, pin);
> +			 pinctrl_find_gpio_range_from_pin_nolock(info->pctl, pin);
>   	struct aml_gpio_bank *bank = gpio_chip_to_bank(range->gc);
>   	unsigned int reg, bit, val;
>   	int ret, conf;
> @@ -326,7 +326,7 @@ static int aml_pinconf_get_drive_strength(struct aml_pinctrl *info,
>   					  u16 *drive_strength_ua)
>   {
>   	struct pinctrl_gpio_range *range =
> -			 pinctrl_find_gpio_range_from_pin(info->pctl, pin);
> +			 pinctrl_find_gpio_range_from_pin_nolock(info->pctl, pin);
>   	struct aml_gpio_bank *bank = gpio_chip_to_bank(range->gc);
>   	unsigned int reg, bit;
>   	unsigned int val;
> @@ -365,7 +365,7 @@ static int aml_pinconf_get_gpio_bit(struct aml_pinctrl *info,
>   				    unsigned int reg_type)
>   {
>   	struct pinctrl_gpio_range *range =
> -			 pinctrl_find_gpio_range_from_pin(info->pctl, pin);
> +			 pinctrl_find_gpio_range_from_pin_nolock(info->pctl, pin);
>   	struct aml_gpio_bank *bank = gpio_chip_to_bank(range->gc);
>   	unsigned int reg, bit, val;
>   	int ret;
> 
> ---
> base-commit: bd7fd288490c64835a74c05e631c102ce056d5e1
> change-id: 20260422-fix-pinconf-42be1cc2f5af
> 
> Best regards,

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-04-24  9:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 11:44 Xianwei Zhao via B4 Relay
2026-04-24  9:54 ` Neil Armstrong [this message]
2026-04-28  9:50 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bab0f4be-31e1-4fe7-8e90-5131b1ae44b2@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®