Skip to content

Commit f274fff

Browse files
committed
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
2 parents 4f5d3da + a37eecb commit f274fff

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

arch/arm/mach-imx/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ menuconfig ARCH_MXC
66
select CLKSRC_IMX_GPT
77
select GENERIC_IRQ_CHIP
88
select GPIOLIB
9+
select PINCTRL
910
select PM_OPP if PM
1011
select SOC_BUS
1112
select SRAM

drivers/pinctrl/pinctrl-mcp23s08.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const struct regmap_config mcp23x08_regmap = {
8686
.num_reg_defaults = ARRAY_SIZE(mcp23x08_defaults),
8787
.cache_type = REGCACHE_FLAT,
8888
.max_register = MCP_OLAT,
89+
.disable_locking = true, /* mcp->lock protects the regmap */
8990
};
9091
EXPORT_SYMBOL_GPL(mcp23x08_regmap);
9192

@@ -132,6 +133,7 @@ const struct regmap_config mcp23x17_regmap = {
132133
.num_reg_defaults = ARRAY_SIZE(mcp23x17_defaults),
133134
.cache_type = REGCACHE_FLAT,
134135
.val_format_endian = REGMAP_ENDIAN_LITTLE,
136+
.disable_locking = true, /* mcp->lock protects the regmap */
135137
};
136138
EXPORT_SYMBOL_GPL(mcp23x17_regmap);
137139

@@ -228,7 +230,9 @@ static int mcp_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
228230

229231
switch (param) {
230232
case PIN_CONFIG_BIAS_PULL_UP:
233+
mutex_lock(&mcp->lock);
231234
ret = mcp_read(mcp, MCP_GPPU, &data);
235+
mutex_unlock(&mcp->lock);
232236
if (ret < 0)
233237
return ret;
234238
status = (data & BIT(pin)) ? 1 : 0;
@@ -257,7 +261,9 @@ static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
257261

258262
switch (param) {
259263
case PIN_CONFIG_BIAS_PULL_UP:
264+
mutex_lock(&mcp->lock);
260265
ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg);
266+
mutex_unlock(&mcp->lock);
261267
break;
262268
default:
263269
dev_dbg(mcp->dev, "Invalid config param %04x\n", param);

0 commit comments

Comments
 (0)