Re: [PATCH v2] regmap-irq: Use regmap_irq_update_bits instead of regmap_write

From: Marek Szyprowski
Date: Tue Feb 08 2022 - 08:17:36 EST


Hi Prasad,

On 19.01.2022 15:29, Prasad Kumpatla wrote:
> With the existing logic by using regmap_write() all the bits in
> the register are being updated which is not expected. To update only the
> interrupt raised bit and not tocuhing other bits, replace regmap_write()
> with regmap_irq_update_bits().
>
> This patch is to fix the issue observed in MBHC button press/release events.
>
> Fixes: 3a6f0fb7b8eb ("regmap: irq: Add support to clear ack registers")
> Signed-off-by: Prasad Kumpatla <quic_pkumpatl@xxxxxxxxxxx>

There is something wrong with this patch. Since it landed in linux-next
(20220204) I get an interrupt storm on two of my test devices:

1. ARM 32bit Exynos4412-based Trats2 ("wm8994-codec wm8994-codec: FIFO
error" message)

2. ARM 64bit Exynos5433-based TM2e ("arizona spi1.0: Mixer dropped
sample" message)

Definitely the interrupts are not acknowledged properly. Once I find
some spare time, I will check it further which regmap configuration
triggers the issue, but it is definitely related to this patch.
Reverting it on top of current linux-next fixes the issue.

> ---
> Changes Since V1:
> -- Update commit message.
>
> drivers/base/regmap/regmap-irq.c | 52 ++++++++++++++++++--------------
> 1 file changed, 29 insertions(+), 23 deletions(-)
>
> ...

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland