Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The driver ignores the argument for PIN_CONFIG_OUTPUT_ENABLE and PIN_CONFIG_INPUT_ENABLE, incorrectly enabling output or input even when explicitly requested to disable them.
--
--- Patch [16]: [PATCH v10 16/36] pinctrl: airoha: minor improvements ---
commit 4b2c740f295974755e7cd78a7cde87ad90927662
Author: Mikhail Kshevetskiy <[email protected]>
pinctrl: airoha: minor improvements
This commit updates the airoha pinctrl driver to use the field_get() and
field_prep() macros instead of direct bit operations. It also improves error
handling across several pinconf setter functions by checking and propagating
return values.
> diff --git a/drivers/pinctrl/airoha/pinctrl-airoha.c b/drivers/pinctrl/airoha/pinctrl-airoha.c
> index e4ccf357df892..f9c126a2f2791 100644
> --- a/drivers/pinctrl/airoha/pinctrl-airoha.c
> +++ b/drivers/pinctrl/airoha/pinctrl-airoha.c
[ ... ]
> @@ -2996,7 +2996,7 @@ static int airoha_pinconf_set(struct pinctrl_dev *pctrl_dev,
[ ... ]
> case PIN_CONFIG_OUTPUT_ENABLE:
> case PIN_CONFIG_INPUT_ENABLE:
> case PIN_CONFIG_LEVEL: {
> bool input = param == PIN_CONFIG_INPUT_ENABLE;
> - int err;
[Severity: High]
This is a pre-existing issue, but does airoha_pinconf_set() ignore the
configuration argument for PIN_CONFIG_OUTPUT_ENABLE and
PIN_CONFIG_INPUT_ENABLE?
When the pinctrl generic framework parses a device tree "output-disable"
property, it translates it into PIN_CONFIG_OUTPUT_ENABLE with arg=0.
Because the "input" direction boolean is derived exclusively by evaluating
param == PIN_CONFIG_INPUT_ENABLE, PIN_CONFIG_OUTPUT_ENABLE with arg=0
evaluates to input=false.
This causes airoha_pinmux_set_direction() to incorrectly enable the pin as an
output instead of disabling it, which could cause a physical short circuit if
an external component is already driving the line.
>
> err = airoha_pinmux_set_direction(pctrl_dev, NULL, pin,
> input);
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=16
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.