Skip to content

Commit bf67214

Browse files
bardliaogregkh
authored andcommitted
regmap: sdw: use _no_pm functions in regmap_read/write
[ Upstream commit d288a57 ] 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: 7c22ce6 ('regmap: Add SoundWire bus support') Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210122070634.12825-6-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 291803e commit bf67214

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/base/regmap/regmap-sdw.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static int regmap_sdw_write(void *context, unsigned int reg, unsigned int val)
1111
struct device *dev = context;
1212
struct sdw_slave *slave = dev_to_sdw_dev(dev);
1313

14-
return sdw_write(slave, reg, val);
14+
return sdw_write_no_pm(slave, reg, val);
1515
}
1616

1717
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)
2020
struct sdw_slave *slave = dev_to_sdw_dev(dev);
2121
int read;
2222

23-
read = sdw_read(slave, reg);
23+
read = sdw_read_no_pm(slave, reg);
2424
if (read < 0)
2525
return read;
2626

0 commit comments

Comments
 (0)