[PW_SID:1136511] pinctrl: spacemit: validate pins in pinconf callbacks - #2384
[PW_SID:1136511] pinctrl: spacemit: validate pins in pinconf callbacks#2384linux-riscv-bot wants to merge 3 commits into
Conversation
__iomem is missing while calling readl_relaxed() in get_cycles() and get_cycles_hi() and sparse complains. Add __iomem to silence the sparse warnings. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202607160619.14G8GHp5-lkp@intel.com/ Signed-off-by: Nam Cao <namcao@linutronix.de> Link: https://patch.msgid.link/20260716053319.2178937-1-namcao@linutronix.de Signed-off-by: Paul Walmsley <pjw@kernel.org>
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: a83c29e ("pinctrl: spacemit: add support for SpacemiT K1 SoC") Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Reviewed-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
|
Patch 1: "pinctrl: spacemit: validate pins in pinconf callbacks" |
971bf8c to
caa07c5
Compare
PR for series 1136511 applied to workflow__riscv__fixes
Name: pinctrl: spacemit: validate pins in pinconf callbacks
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1136511
Version: 1