Patch "ASoC: cs35l41: Handle mdsync_up reg write errors" has been added to the 6.6-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: Handle mdsync_up reg write errors

to the 6.6-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-handle-mdsync_up-reg-write-errors.patch
and it can be found in the queue-6.6 subdirectory.

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



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

    ASoC: cs35l41: Handle mdsync_up reg write errors
    
    [ Upstream commit 4bb5870ab60abca6ad18196090831b5e4cf82d93 ]
    
    The return code of regmap_multi_reg_write() call related to "MDSYNC up"
    sequence is shadowed by the subsequent regmap_read_poll_timeout()
    invocation, which will hit a timeout in case the write operation above
    fails.
    
    Make sure cs35l41_global_enable() returns the correct error code instead
    of -ETIMEDOUT.
    
    Additionally, to be able to distinguish between the timeouts of
    wait_for_completion_timeout() and regmap_read_poll_timeout(), print an
    error message for the former and return immediately.  This also avoids
    having to wait unnecessarily for the second time.
    
    Fixes: f8264c759208 ("ALSA: cs35l41: Poll for Power Up/Down rather than waiting a fixed delay")
    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-3-cristian.ciocaltea@xxxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/codecs/cs35l41-lib.c b/sound/soc/codecs/cs35l41-lib.c
index a018f1d984286..a6c6bb23b9574 100644
--- a/sound/soc/codecs/cs35l41-lib.c
+++ b/sound/soc/codecs/cs35l41-lib.c
@@ -1251,15 +1251,18 @@ int cs35l41_global_enable(struct device *dev, struct regmap *regmap, enum cs35l4
 
 		ret = wait_for_completion_timeout(pll_lock, msecs_to_jiffies(1000));
 		if (ret == 0) {
-			ret = -ETIMEDOUT;
-		} else {
-			regmap_read(regmap, CS35L41_PWR_CTRL3, &pwr_ctrl3);
-			pwr_ctrl3 |= CS35L41_SYNC_EN_MASK;
-			cs35l41_mdsync_up_seq[0].def = pwr_ctrl3;
-			ret = regmap_multi_reg_write(regmap, cs35l41_mdsync_up_seq,
-						     ARRAY_SIZE(cs35l41_mdsync_up_seq));
+			dev_err(dev, "Timed out waiting for pll_lock\n");
+			return -ETIMEDOUT;
 		}
 
+		regmap_read(regmap, CS35L41_PWR_CTRL3, &pwr_ctrl3);
+		pwr_ctrl3 |= CS35L41_SYNC_EN_MASK;
+		cs35l41_mdsync_up_seq[0].def = pwr_ctrl3;
+		ret = regmap_multi_reg_write(regmap, cs35l41_mdsync_up_seq,
+					     ARRAY_SIZE(cs35l41_mdsync_up_seq));
+		if (ret)
+			return ret;
+
 		ret = regmap_read_poll_timeout(regmap, CS35L41_IRQ1_STATUS1,
 					int_status, int_status & pup_pdn_mask,
 					1000, 100000);



[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