Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Billy Tsai" <billy_tsai@aspeedtech.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 3/3] pinctrl: aspeed: Add AST2700 SoC1 support
Date: Thu, 21 May 2026 10:07:59 +0000	[thread overview]
Message-ID: <20260521100759.AD2181F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260521-pinctrl-single-bit-v5-3-308be2c160fc@aspeedtech.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] pin_config_get() and pin_config_set() return -EINVAL instead of -ENOTSUPP for virtual pins, causing fatal probe failures for groups containing these pins.
--

commit d4d214b81bd3876c9753372b7321c3f7575490ed
Author: Billy Tsai <billy_tsai@aspeedtech.com>

pinctrl: aspeed: Add AST2700 SoC1 support

This commit implements pin multiplexing and pin configuration for the
AST2700 SoC1 SCU pinctrl block using static SoC data tables. The driver
registers with the generic pinctrl, pinmux, and pinconf frameworks.

> diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g7-soc1.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g7-soc1.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g7-soc1.c

[ ... ]

> +static int aspeed_g7_soc1_pin_config_get(struct pinctrl_dev *pctldev,
> +					 unsigned int pin,
> +					 unsigned long *config)
> +{
> +	struct aspeed_g7_soc1_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
> +	enum pin_config_param param = pinconf_to_config_param(*config);
> +	struct aspeed_g7_field field;
> +	unsigned int val, val_raw;
> +	int ret, ds_idx;
> +
> +	if (pin > AC24)
> +		return -EINVAL;

[Severity: High]
Should this return -ENOTSUPP instead of -EINVAL for virtual pins?

The pinctrl core treats -EINVAL as a fatal error, but gracefully ignores
-ENOTSUPP for unsupported configurations. If a device tree applies generic
pin configurations (like bias-disable or drive-strength) to groups containing
a mix of physical and virtual pins, returning -EINVAL could abort the entire
group configuration and cause the consumer device's probe to fail.

[ ... ]

> +static int aspeed_g7_soc1_pin_config_set(struct pinctrl_dev *pctldev,
> +					 unsigned int pin,
> +					 unsigned long *configs,
> +					 unsigned int num_configs)
> +{
> +	struct aspeed_g7_soc1_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
> +	struct aspeed_g7_field field;
> +	enum pin_config_param param;
> +	int i, ret, ds_idx;
> +	unsigned int val;
> +	u32 arg;
> +
> +	if (pin > AC24)
> +		return -EINVAL;

[Severity: High]
Does this code also need to return -ENOTSUPP for virtual pins to avoid
failing pinconf_apply_setting() during device probe?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260521-pinctrl-single-bit-v5-0-308be2c160fc@aspeedtech.com?part=3

      reply	other threads:[~2026-05-21 10:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  9:17 [PATCH v5 0/3] pinctrl: aspeed: Add AST2700 SoC1 support Billy Tsai
2026-05-21  9:17 ` [PATCH v5 1/3] dt-bindings: mfd: aspeed,ast2x00-scu: Support AST2700 SoC1 pinctrl Billy Tsai
2026-05-21  9:17 ` [PATCH v5 2/3] dt-bindings: pinctrl: Add aspeed,ast2700-soc1-pinctrl Billy Tsai
2026-05-21  9:17 ` [PATCH v5 3/3] pinctrl: aspeed: Add AST2700 SoC1 support Billy Tsai
2026-05-21 10:07   ` 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=20260521100759.AD2181F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=billy_tsai@aspeedtech.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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