Re: [PATCH] pinctrl: spacemit: validate pins in pinconf callbacks
Linus Walleij <[email protected]> Mon, 3 Aug 2026 09:46:50 +0200
| Newsgroups | dev.linux.lists.spacemit,org.infradead.lists.linux-riscv,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAD++jLkh0BxaNksg8GzBKbhT20B5qutOAkBc5hMODmG=9uLy_w@mail.gmail.com> |
On Wed, Jul 29, 2026 at 11:27=E2=80=AFAM Troy Mitchell <[email protected]> wrote: > Pin 0 is a valid pin ID, but spacemit_pinconf_get() rejects it by > testing the numeric ID rather than the result of the descriptor lookup. > It also fails to reject nonzero IDs absent from the SoC pin table before > computing their register addresses. Check the descriptor and use its pin > ID for the register lookup. > > spacemit_pinconf_group_set() validates only the first group member when > generating the configuration. If a later member is invalid, > spacemit_pin_set_config() returns -EINVAL, but the callback ignores it > and reports success after partially updating the group. > > Validate every group member before writing any registers so malformed > groups fail without being partially applied. > > Fixes: a83c29e1d145 ("pinctrl: spacemit: add support for SpacemiT K1 SoC"= ) > Signed-off-by: Troy Mitchell <[email protected]> Patch applied! Yours, Linus Walleij