linux icon indicating copy to clipboard operation
linux copied to clipboard

soundwire: add multi-lane support

Open bardliao opened this issue 2 years ago • 1 comments

The first 2 commits are from https://github.com/thesofproject/linux/pull/4704.

This PR adds SoundWire multi-lane support.

bardliao avatar Dec 06 '23 10:12 bardliao

Hmm, the CI test Failure on TGLU_RVP_SDW-ipc4 is because that 2 1308 amps are on the same sdw link, and 1 controller data port maps to 2 peripheral data ports. But I assume that controller data port and peripheral data port is 1:1 mapping. I need to think about how to handle this case.

bardliao avatar Dec 07 '23 08:12 bardliao

looks good except for the first patch missing your sign-off @bardliao

Updated to

Co-developed-by: Chao Song <[email protected]>
Signed-off-by: Chao Song <[email protected]>
Signed-off-by: Bard Liao <[email protected]>

bardliao avatar Aug 28 '24 01:08 bardliao

@plbossart @ranj063 @ujfalusi I just found an issue when I tested with dynamic sdw bus clock. We need to clear p_rt->ch_mask when deprepare. Otherwise, sdw_compute_group_params() will still count the port bandwidth which is already stop when it is called in deprepare. And it will return error when we stop a stream and reduce the sdw clock. The same issue happens in the existing code, too. But we won't meet the issue because currently the sdw clock will never change.

bardliao avatar Aug 29 '24 06:08 bardliao

@plbossart @ranj063 @ujfalusi I just found an issue when I tested with dynamic sdw bus clock. We need to clear p_rt->ch_mask when deprepare. Otherwise, sdw_compute_group_params() will still count the port bandwidth which is already stop when it is called in deprepare. And it will return error when we stop a stream and reduce the sdw clock. The same issue happens in the existing code, too. But we won't meet the issue because currently the sdw clock will never change.

It will impact the multi-lane support. I need to think more about it.

bardliao avatar Aug 29 '24 08:08 bardliao

@plbossart @ranj063 @ujfalusi I just found an issue when I tested with dynamic sdw bus clock. We need to clear p_rt->ch_mask when deprepare. Otherwise, sdw_compute_group_params() will still count the port bandwidth which is already stop when it is called in deprepare. And it will return error when we stop a stream and reduce the sdw clock. The same issue happens in the existing code, too. But we won't meet the issue because currently the sdw clock will never change.

It will impact the multi-lane support. I need to think more about it.

@bardliao are you saying this PR is not ready for merging then? Also, what is the plan for testing multilane? I understand you have tested this locally but do we need to add tests to our CI also?

ranj063 avatar Aug 29 '24 19:08 ranj063

@plbossart @ranj063 @ujfalusi I just found an issue when I tested with dynamic sdw bus clock. We need to clear p_rt->ch_mask when deprepare. Otherwise, sdw_compute_group_params() will still count the port bandwidth which is already stop when it is called in deprepare. And it will return error when we stop a stream and reduce the sdw clock. The same issue happens in the existing code, too. But we won't meet the issue because currently the sdw clock will never change.

It will impact the multi-lane support. I need to think more about it.

@bardliao are you saying this PR is not ready for merging then? Also, what is the plan for testing multilane? I understand you have tested this locally but do we need to add tests to our CI also?

After 1 and half day's investigation, I decide to roll back to the reviewed/approved and full tested version. I.e. remove the set p_rt->ch_mask = 0 in deprepare change. I will continue debug the issue when enabling dynamic sdw clock change. But in the meantime, we can merge this if you agree. @ranj063 @plbossart @ujfalusi.

And yes, we need to setup a device to test multilane in CI. We will need a codec that can support multilane like rt722, rt712-vb

bardliao avatar Aug 30 '24 05:08 bardliao

change: remove duplicated trace.

bardliao avatar Sep 02 '24 11:09 bardliao