• Tony Lindgren's avatar
    mfd: cpcap: Fix interrupt regression with regmap clear_ack · 14639a22
    Tony Lindgren authored
    With commit 3a6f0fb7 ("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: 3a6f0fb7 ("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: default avatarTony Lindgren <tony@atomide.com>
    Tested-by: default avatarPavel Machek <pavel@ucw.cz>
    Reviewed-By: default avatarTim Harvey <tharvey@gateworks.com>
    Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
    14639a22
motorola-cpcap.c 7.89 KB