Repository navigation
Conversation
|
For more context, here's the git bisect log and the diff that was applied on top of each bisect point to find the issue |
|
SOFCI TEST |
|
I have a theory that SoundWire tries to assign two secondary fwnodes and fails now. Check how you assing device properties and companion devices in the code. Also check if any of that nodes are shared or exclusive (how many devices are actually using it). You see, this is probably the outcome of avoiding |
|
@andy-shev we don't assign companion devices, and we only use the same reference in several layers. It's quite possible that we are idiots and never did the right thing... The initial handle is the PRP0001 device that's the companion of the PCI device. From there we create 4 platform devices: And below we create a master device below each platform device (not my decision...) Edit: The only other place where we play with properties is in the machine driver, where we set properties for the RT711. https://elixir.bootlin.com/linux/v5.9.13/source/sound/soc/intel/boards/sof_sdw_rt711.c#L37 Does this help @andy-shev? @bardliao maybe we should remove this handling of device properties in the RT711 case, just to see if the problem is on the machine driver side or in the Soundwire code. |
|
Yeah... You need to use like others do: https://elixir.bootlin.com/linux/latest/source/drivers/i2c/busses/i2c-dln2.c#L211 i.o.w. |
wow, what a miss! thanks @andy-shev for the tip. Did you mean to say we have to do this as every additional device layer we create? |
That is how primary fwnode got shared between "virtual" devices in the Linux kernel. So, parent here, let's say, describes real physical device and we create some other device as it's child. What we want is to have access to the properties provided by firmware for real device, i.e. parent. Thus, we install primary fwnode of the child to be the same as primary of the parent. |
Our code 'worked' before without all this, and the only case where we read the properties of the parent from a lower layer is here: https://elixir.bootlin.com/linux/latest/source/drivers/soundwire/intel.c#L1213 That part doesn't seem related to the RT711 timeouts though. I have to run, will look into this on Monday. Thanks @andy-shev for your help |
The timed out issue is gone if I removed device_add_properties in sof_sdw_rt711.c. But I think what we really missed is --- a/sound/soc/intel/boards/sof_sdw_rt711.c
+++ b/sound/soc/intel/boards/sof_sdw_rt711.c
@@ -36,7 +36,8 @@ static int rt711_add_codec_device_props(const char *sdw_dev_name)
SOF_RT711_JDSRC(sof_sdw_quirk));
}
- ret = device_add_properties(sdw_dev, props);
+ ret = 0;
put_device(sdw_dev);
return ret;
|
Something is telling me that your topology is more complex than parent <--> child relation. Perhaps you actually need to use fwnode graph (as V4L2 does). |
no, it's strictly parent-child. the only exception is when we set properties in the machine driver, but that's not changing the device topology. we've shown that the issue is that the dev->fwnode is overridden the second time in a modprobe/rmmod/modprobe test. The dev->fwnode is overridden by the properties, and that causes massive issues with suspend/resume. |
Good to know, thanks for clarifying. Let's close this an continue elsewhere. |
Git bisect tells us that the changes made by @andy-shev seem to introduce timeout errors for SoundWire during our system suspend-resume tests, specifically when we play with modprobe/rmmod before doing the suspend-resume tests.
See traces in #2603 (comment)
PR2063 makes the timeouts disappear by forcing the codecs and sdw-master devices pm_runtime active on system resume, but it's not clear what the link is with @andy-shev's patches.
This PR is just to test the hypothesis and see if reverting also removes the timeouts. There may be something we are missing here. We do share the same fwnode in the Intel SoundWire drivers, so there's more than a random coincidence IMHO.