From: Shengjiu Wang <[email protected]>

fsl_easrc_isr() ignores the return value of regmap_read() and evaluates
the interrupt flags even if the read fails, leaving val uninitialized.

The interrupt status register is volatile. If an interrupt arrives while
the regmap is in cache-only mode, for example during runtime suspend,
regmap_read() returns -EBUSY without setting the output value. Testing
the uninitialized value can then produce bogus FIFO error messages when
debug logging is enabled.

Return IRQ_NONE when the status read fails instead of evaluating an
invalid value. Also use an unsigned int for the status to match the
regmap_read() interface.

Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Shengjiu Wang <[email protected]>
---
 sound/soc/fsl/fsl_easrc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
index b7a429170794..a4f98bcb8e22 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -1968,9 +1968,12 @@ static irqreturn_t fsl_easrc_isr(int irq, void *dev_id)
 {
        struct fsl_asrc *easrc = (struct fsl_asrc *)dev_id;
        struct device *dev = &easrc->pdev->dev;
-       int val;
+       unsigned int val;
+       int ret;
 
-       regmap_read(easrc->regmap, REG_EASRC_IRQF, &val);
+       ret = regmap_read(easrc->regmap, REG_EASRC_IRQF, &val);
+       if (ret)
+               return IRQ_NONE;
 
        if (val & EASRC_IRQF_OER_MASK)
                dev_dbg(dev, "output FIFO underflow\n");
-- 
2.34.1


Reply via email to