[Letux-kernel] Fwd: [PATCH] pinctrl: single: Fix PIN_CONFIG_BIAS_DISABLE handling

H. Nikolaus Schaller hns at goldelico.com
Thu Mar 28 22:28:40 CET 2024


Just seen. May (or may not) affect our pull-up/down management of the X1600.

> Anfang der weitergeleiteten Nachricht:
> 
> Von: Linus Walleij <linus.walleij at linaro.org>
> Betreff: Aw: [PATCH] pinctrl: single: Fix PIN_CONFIG_BIAS_DISABLE handling
> Datum: 28. März 2024 um 22:02:20 MEZ
> An: Matthijs Kooijman <matthijs at stdin.nl>
> Kopie: Haojian Zhuang <haojian.zhuang at linaro.org>, Tony Lindgren <tony at atomide.com>, linux-gpio at vger.kernel.org, linux-omap at vger.kernel.org
> 
> On Tue, Mar 19, 2024 at 12:07 PM Matthijs Kooijman <matthijs at stdin.nl> wrote:
> 
>> The pinctrl-single driver handles pin_config_set by looking up the
>> requested setting in a DT-defined lookup table, which defines what bits
>> correspond to each setting. There is no way to add
>> PIN_CONFIG_BIAS_DISABLE entries to the table, since there is instead
>> code to disable the bias by applying the disable values of both the
>> pullup and pulldown entries in the table.
>> 
>> However, this code is inside the table-lookup loop, so it would only
>> execute if there is an entry for PIN_CONFIG_BIAS_DISABLE in the table,
>> which can never exist, so this code never runs.
>> 
>> This commit lifts the offending code out of the loop, so it just
>> executes directly whenever PIN_CONFIG_BIAS_DISABLE is requested,
>> skippipng the table lookup loop.
>> 
>> This also introduces a new `param` variable to make the code slightly
>> more readable.
>> 
>> This bug seems to have existed when this code was first merged in commit
>> 9dddb4df90d13 ("pinctrl: single: support generic pinconf"). Earlier
>> versions of this patch did have an entry for PIN_CONFIG_BIAS_DISABLE in
>> the lookup table, but that was removed, which is probably how this bug
>> was introduced.
>> 
>> Signed-off-by: Matthijs Kooijman <matthijs at stdin.nl>
> 
> This looks reasonable to me, but I need Tony to review it before applying.
> 
> Yours,
> Linus Walleij
> 



More information about the Letux-kernel mailing list