Skip to content

Commit 299e978

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: bus: use sdw_write_no_pm when setting the bus scale registers
When a Slave device is resumed, it may resume the bus and restart the enumeration. During that process, we absolutely don't want to call regular read/write routines which will wait for the resume to complete, otherwise a deadlock occurs. This patch fixes the same problem as the previous one, but is split to make the life of linux-stable maintainers less painful. Fixes: 29d158f ('soundwire: bus: initialize bus clock base and scale registers') Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent b04c975 commit 299e978

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/soundwire/bus.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,21 +1220,21 @@ static int sdw_slave_set_frequency(struct sdw_slave *slave)
12201220
}
12211221
scale_index++;
12221222

1223-
ret = sdw_write(slave, SDW_SCP_BUS_CLOCK_BASE, base);
1223+
ret = sdw_write_no_pm(slave, SDW_SCP_BUS_CLOCK_BASE, base);
12241224
if (ret < 0) {
12251225
dev_err(&slave->dev,
12261226
"SDW_SCP_BUS_CLOCK_BASE write failed:%d\n", ret);
12271227
return ret;
12281228
}
12291229

12301230
/* initialize scale for both banks */
1231-
ret = sdw_write(slave, SDW_SCP_BUSCLOCK_SCALE_B0, scale_index);
1231+
ret = sdw_write_no_pm(slave, SDW_SCP_BUSCLOCK_SCALE_B0, scale_index);
12321232
if (ret < 0) {
12331233
dev_err(&slave->dev,
12341234
"SDW_SCP_BUSCLOCK_SCALE_B0 write failed:%d\n", ret);
12351235
return ret;
12361236
}
1237-
ret = sdw_write(slave, SDW_SCP_BUSCLOCK_SCALE_B1, scale_index);
1237+
ret = sdw_write_no_pm(slave, SDW_SCP_BUSCLOCK_SCALE_B1, scale_index);
12381238
if (ret < 0)
12391239
dev_err(&slave->dev,
12401240
"SDW_SCP_BUSCLOCK_SCALE_B1 write failed:%d\n", ret);

0 commit comments

Comments
 (0)