-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SoundWire fails because of trying program BUSCLOCK_SCALE on devices that were not enumerate #5257
Comments
I can reproduce the issue. But even I reverted the change in
I think that is a valid issue when we try to access an unexist codec. diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 50ebeb048e6e..e933407a3f0f 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -643,6 +643,8 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
/* Check if all Peripherals comply with SDCA */
list_for_each_entry(slave, &bus->slaves, node) {
+ if (slave->status == SDW_SLAVE_UNATTACHED)
+ continue;
if (!is_clock_scaling_supported_by_slave(slave)) {
dev_dbg(&slave->dev, "The Peripheral doesn't comply with SDCA\n");
goto manager_runtime;
@@ -659,6 +661,8 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
int scale_index;
u8 base;
+ if (slave->status == SDW_SLAVE_UNATTACHED)
+ continue;
scale_index = sdw_slave_get_scale_index(slave, &base);
if (scale_index < 0)
return scale_index; Thanks. |
@bardliao probably best to avoid testing a status. I'd check if the device has ever been enumerated with the sticky device num. I think we have other cases where we check for 'ghost' devices, don't we? |
Welcome back @plbossart. I forgot how did we handle with the 'ghost' devices. diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 50ebeb048e6e..d4d69ece7969 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -643,6 +643,8 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
/* Check if all Peripherals comply with SDCA */
list_for_each_entry(slave, &bus->slaves, node) {
+ if (!slave->dev_num_sticky)
+ continue;
if (!is_clock_scaling_supported_by_slave(slave)) {
dev_dbg(&slave->dev, "The Peripheral doesn't comply with SDCA\n");
goto manager_runtime;
@@ -659,6 +661,8 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
int scale_index;
u8 base;
+ if (!slave->dev_num_sticky)
+ continue;
scale_index = sdw_slave_get_scale_index(slave, &base);
if (scale_index < 0)
return scale_index;
|
@bardliao Sorry, I didn't see your requests for me to test changes. I don't seem to have received a notification email from github. |
@bardliao Your second patch (test dev_num_sticky) fixes the problem for me, and the other peripherals on the bus are still working |
The UpXtreme i14 (MTL) reports in ACPI that it has a RT711 on SoundWire bus 0, but it does NOT have a RT711. (Apparently this is quite common for motherboard ACPI to report a RT711 that is not really there).
The patch
Tries to program this RT711 that does not really exist on the bus, and then throws a lot of errors like:
[ 3783.196648] rt711-sdca sdw:0:0:025d:0711:01: SDW_SCP_BUSCLOCK_SCALE register write failed
[ 3783.196998] soundwire sdw-master-0-0: Program params failed: -61
[ 3783.197028] SDW1-Playback-SmartAmp: ASoC: error at snd_soc_link_prepare on SDW1-Playback-SmartAmp: -61
[ 3783.197088] SDW1-Playback-SmartAmp: ASoC: error at __soc_pcm_prepare on SDW1-Playback-SmartAmp: -61
[ 3783.197119] Speaker: ASoC: error at dpcm_be_dai_prepare on Speaker: -61
[ 3783.197145] Speaker: ASoC: error at dpcm_fe_dai_prepare on Speaker: -61
[ 3783.203646] sdw_deprepare_stream: subdevice #0-Playback: inconsistent state state 1
If I partially revert that patch (but leave the new function is_clock_scaling_supported_by_slave() because later patches call it) it fixes this problem.
The text was updated successfully, but these errors were encountered: