Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Xianwei Zhao" <xianwei.zhao@amlogic.com>
Cc: neil.armstrong@linaro.org, linux-amlogic@lists.infradead.org
Subject: Re: [PATCH] pinctrl: meson: sync some modify from A4
Date: Wed, 12 Aug 2026 10:30:49 +0000	[thread overview]
Message-ID: <20260812103049.EBFF51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812-sync_a4-v1-1-b7279c26e2bc@amlogic.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Returning 0 with arg=0 for disabled PIN_CONFIG_OUTPUT_ENABLE violates the pinctrl generic API and breaks debugfs dumps.
--

--- Patch [1]: [PATCH] pinctrl: meson: sync some modify from A4 ---
commit 9cd4cd52945d3531f8a1944d79a8d453a832ce33
Author: Xianwei Zhao <xianwei.zhao@amlogic.com>

pinctrl: meson: sync some modify from A4

This commit syncs fixes from A4, setting the drive strength before
enabling the output to prevent unintended drive strengths. It also modifies
PIN_CONFIG_OUTPUT_ENABLE to report the actual output enable state.

> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
> index 18295b15ecd9d..9fc30aee96a56 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson.c

[ ... ]

> @@ -498,9 +498,9 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
>  		break;
>  	case PIN_CONFIG_OUTPUT_ENABLE:
>  		ret = meson_pinconf_get_output(pc, pin);
> -		if (ret <= 0)
> +		if (ret < 0)
>  			return -EINVAL;
> -		arg = 1;
> +		arg = ret;

[Severity: Medium]
The generic pinctrl API defines PIN_CONFIG_OUTPUT_ENABLE as a boolean
parameter without an argument.

When a feature is inactive or disabled, drivers are expected to return 
-EINVAL from the get callback. Because the parameter has no argument, the 
core pinctrl debugfs logic ignores the returned arg value.

By returning 0 with arg = 0 when the output is disabled, won't debugfs 
falsely report all disabled pins as having their output enabled?

Should this code still return -EINVAL when ret is 0 to avoid breaking 
debugfs output?

>  		break;
>  	case PIN_CONFIG_LEVEL:

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-sync_a4-v1-1-b7279c26e2bc@amlogic.com?part=1

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

      reply	other threads:[~2026-08-12 10:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 10:22 [PATCH] pinctrl: meson: sync some modify from A4 Xianwei Zhao via B4 Relay
2026-08-12 10:30 ` sashiko-bot [this message]

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=20260812103049.EBFF51F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xianwei.zhao@amlogic.com \
    /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