Patch "regmap: sdw: use _no_pm functions in regmap_read/write" has been added to the 5.10-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

    regmap: sdw: use _no_pm functions in regmap_read/write

to the 5.10-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:
     regmap-sdw-use-_no_pm-functions-in-regmap_read-write.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 8b3577e99156c6f453c05cf7566cfc8730e6adc5
Author: Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx>
Date:   Fri Jan 22 15:06:30 2021 +0800

    regmap: sdw: use _no_pm functions in regmap_read/write
    
    [ Upstream commit d288a5712ef961e16d588bbdb2d846e00b5ef154 ]
    
    sdw_update_slave_status will be invoked when a codec is attached,
    and the codec driver will initialize the codec with regmap functions
    while the codec device is pm_runtime suspended.
    
    regmap routines currently rely on regular SoundWire IO functions,
    which will call pm_runtime_get_sync()/put_autosuspend.
    
    This causes a deadlock where the resume routine waits for an
    initialization complete signal that while the initialization complete
    can only be reached when the resume completes.
    
    The only solution if we allow regmap functions to be used in resume
    operations as well as during codec initialization is to use _no_pm
    routines. The duty of making sure the bus is operational needs to be
    handled above the regmap level.
    
    Fixes: 7c22ce6e21840 ('regmap: Add SoundWire bus support')
    Signed-off-by: Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx>
    Acked-by: Mark Brown <broonie@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210122070634.12825-6-yung-chuan.liao@xxxxxxxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/base/regmap/regmap-sdw.c b/drivers/base/regmap/regmap-sdw.c
index c92d614b49432..4b8d2d010cab9 100644
--- a/drivers/base/regmap/regmap-sdw.c
+++ b/drivers/base/regmap/regmap-sdw.c
@@ -11,7 +11,7 @@ static int regmap_sdw_write(void *context, unsigned int reg, unsigned int val)
 	struct device *dev = context;
 	struct sdw_slave *slave = dev_to_sdw_dev(dev);
 
-	return sdw_write(slave, reg, val);
+	return sdw_write_no_pm(slave, reg, val);
 }
 
 static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val)
@@ -20,7 +20,7 @@ static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val)
 	struct sdw_slave *slave = dev_to_sdw_dev(dev);
 	int read;
 
-	read = sdw_read(slave, reg);
+	read = sdw_read_no_pm(slave, reg);
 	if (read < 0)
 		return read;
 



[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