From: Shengjiu Wang <[email protected]>

irq0_isr() ignores the result of reading FSL_XCVR_EXT_ISR and processes
an uninitialized status value if the read fails. The register is volatile,
so regmap cannot supply a cached value when the map is in cache-only mode.
This can cause interrupt conditions to be handled without valid status.

Return IRQ_NONE on a failed status read before testing any interrupt bits.

Fixes: 28564486866f ("ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver")
Signed-off-by: Shengjiu Wang <[email protected]>
---
 sound/soc/fsl/fsl_xcvr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index fb996a55c753..7208d0e46e94 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -1594,8 +1594,11 @@ static irqreturn_t irq0_isr(int irq, void *devid)
        struct regmap *regmap = xcvr->regmap;
        void __iomem *reg_ctrl, *reg_buff;
        u32 isr, isr_clr = 0, val, i;
+       int ret;
 
-       regmap_read(regmap, FSL_XCVR_EXT_ISR, &isr);
+       ret = regmap_read(regmap, FSL_XCVR_EXT_ISR, &isr);
+       if (ret < 0)
+               return IRQ_NONE;
 
        if (isr & FSL_XCVR_IRQ_NEW_CS) {
                dev_dbg(dev, "Received new CS block\n");
-- 
2.34.1


Reply via email to