Skip to content

Commit 2081572

Browse files
tmlindgregkh
authored andcommitted
mfd: cpcap: Fix interrupt regression with regmap clear_ack
[ Upstream commit 14639a2 ] With commit 3a6f0fb ("regmap: irq: Add support to clear ack registers"), the cpcap interrupts are no longer getting acked properly leading to a very unresponsive device with CPUs fully loaded spinning in the threaded IRQ handlers. To me it looks like the clear_ack commit above actually fixed a long standing bug in regmap_irq_thread() where we unconditionally acked the interrupts earlier without considering ack_invert. And the issue with cpcap started happening as we now also consider ack_invert. Tim Harvey <tharvey@gateworks.com> tried to fix this issue earlier with "[PATCH v2] regmap: irq: fix ack-invert", but the reading of the ack register was considered unnecessary for just ack_invert, and we did not have clear_ack available yet. As the cpcap irqs worked both with and without ack_invert earlier because of the unconditional ack, the problem remained hidden until now. Also, looks like the earlier v3.0.8 based Motorola Android Linux kernel does clear_ack style read-clear-write with "ireg_val & ~mreg_val" instead of just ack_invert style write. So let's switch cpcap to use clear_ack to fix the issue. Fixes: 3a6f0fb ("regmap: irq: Add support to clear ack registers") Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Laxminath Kasam <lkasam@codeaurora.org> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Mark Brown <broonie@kernel.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Sebastian Reichel <sre@kernel.org> Cc: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Tested-by: Pavel Machek <pavel@ucw.cz> Reviewed-By: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent de39384 commit 2081572

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/mfd/motorola-cpcap.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = {
9797
.ack_base = CPCAP_REG_MI1,
9898
.mask_base = CPCAP_REG_MIM1,
9999
.use_ack = true,
100-
.ack_invert = true,
100+
.clear_ack = true,
101101
},
102102
{
103103
.name = "cpcap-m2",
@@ -106,7 +106,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = {
106106
.ack_base = CPCAP_REG_MI2,
107107
.mask_base = CPCAP_REG_MIM2,
108108
.use_ack = true,
109-
.ack_invert = true,
109+
.clear_ack = true,
110110
},
111111
{
112112
.name = "cpcap1-4",
@@ -115,7 +115,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = {
115115
.ack_base = CPCAP_REG_INT1,
116116
.mask_base = CPCAP_REG_INTM1,
117117
.use_ack = true,
118-
.ack_invert = true,
118+
.clear_ack = true,
119119
},
120120
};
121121

0 commit comments

Comments
 (0)