Patch "ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-cs35l41-verify-pm-runtime-resume-errors-in-irq-.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e2a4693d004b232d89a75ebf487808444cf3c993
Author: Cristian Ciocaltea <cristian.ciocaltea@xxxxxxxxxxxxx>
Date:   Thu Sep 7 20:10:04 2023 +0300

    ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler
    
    [ Upstream commit 9f8948db9849d202dee3570507d3a0642f92d632 ]
    
    The interrupt handler invokes pm_runtime_get_sync() without checking the
    returned error code.
    
    Add a proper verification and switch to pm_runtime_resume_and_get(), to
    avoid the need to call pm_runtime_put_noidle() for decrementing the PM
    usage counter before returning from the error condition.
    
    Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode")
    Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@xxxxxxxxxxxxx>
    Acked-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Takashi Iwai <tiwai@xxxxxxx>
    Link: https://lore.kernel.org/r/20230907171010.1447274-6-cristian.ciocaltea@xxxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
index c9f033d2782d2..abbe82071c1a4 100644
--- a/sound/soc/codecs/cs35l41.c
+++ b/sound/soc/codecs/cs35l41.c
@@ -386,10 +386,18 @@ static irqreturn_t cs35l41_irq(int irq, void *data)
 	struct cs35l41_private *cs35l41 = data;
 	unsigned int status[4] = { 0, 0, 0, 0 };
 	unsigned int masks[4] = { 0, 0, 0, 0 };
-	int ret = IRQ_NONE;
 	unsigned int i;
+	int ret;
 
-	pm_runtime_get_sync(cs35l41->dev);
+	ret = pm_runtime_resume_and_get(cs35l41->dev);
+	if (ret < 0) {
+		dev_err(cs35l41->dev,
+			"pm_runtime_resume_and_get failed in %s: %d\n",
+			__func__, ret);
+		return IRQ_NONE;
+	}
+
+	ret = IRQ_NONE;
 
 	for (i = 0; i < ARRAY_SIZE(status); i++) {
 		regmap_read(cs35l41->regmap,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux