Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'pinctrl-v6.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:

- A small Kconfig fixup for the i.MX.

In principle this could come in from the SoC tree but the bug was
introduced from the pin control tree so let's fix it from here.

- Fix a sleep in atomic context in the MCP23xxx GPIO expander by
disabling the regmap locking and using explicit mutex locks.

* tag 'pinctrl-v6.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: mcp23s08: Fix sleeping in atomic context due to regmap locking
ARM: imx: Re-introduce the PINCTRL selection

+7
+1
arch/arm/mach-imx/Kconfig
··· 6 6 select CLKSRC_IMX_GPT 7 7 select GENERIC_IRQ_CHIP 8 8 select GPIOLIB 9 + select PINCTRL 9 10 select PM_OPP if PM 10 11 select SOC_BUS 11 12 select SRAM
+6
drivers/pinctrl/pinctrl-mcp23s08.c
··· 86 86 .num_reg_defaults = ARRAY_SIZE(mcp23x08_defaults), 87 87 .cache_type = REGCACHE_FLAT, 88 88 .max_register = MCP_OLAT, 89 + .disable_locking = true, /* mcp->lock protects the regmap */ 89 90 }; 90 91 EXPORT_SYMBOL_GPL(mcp23x08_regmap); 91 92 ··· 133 132 .num_reg_defaults = ARRAY_SIZE(mcp23x17_defaults), 134 133 .cache_type = REGCACHE_FLAT, 135 134 .val_format_endian = REGMAP_ENDIAN_LITTLE, 135 + .disable_locking = true, /* mcp->lock protects the regmap */ 136 136 }; 137 137 EXPORT_SYMBOL_GPL(mcp23x17_regmap); 138 138 ··· 230 228 231 229 switch (param) { 232 230 case PIN_CONFIG_BIAS_PULL_UP: 231 + mutex_lock(&mcp->lock); 233 232 ret = mcp_read(mcp, MCP_GPPU, &data); 233 + mutex_unlock(&mcp->lock); 234 234 if (ret < 0) 235 235 return ret; 236 236 status = (data & BIT(pin)) ? 1 : 0; ··· 261 257 262 258 switch (param) { 263 259 case PIN_CONFIG_BIAS_PULL_UP: 260 + mutex_lock(&mcp->lock); 264 261 ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg); 262 + mutex_unlock(&mcp->lock); 265 263 break; 266 264 default: 267 265 dev_dbg(mcp->dev, "Invalid config param %04x\n", param);