Skip to content
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: cadence_master: set frame shape and divider based on actual clk freq #5179

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

bardliao
Copy link
Collaborator

"soundwire: cadence_master: set frame shape and divider based on actual clk freq" is the only new commit. CI reports below error without this commit.

[  405.383015] soundwire sdw-master-0-0: Controller Timed out on bank switch
[  405.383126] soundwire sdw-master-0-0: multi link bank switch failed: -110

The issue happens randomly when cdns_init_clock_ctrl() and cdns_bus_conf() set different divider. In theory, divider could be changed. But, the existing code set max_clk_freq in cdns_init_clock_ctrl() and set curr_dr_freq in sdw_initialize_slave() which doesn't make sense to me. The PR suggests setting curr_dr_freq if it is present.

To reproduce the issue:
Run 2 times for each below command one by one on LNL_SDW_AIOC devices.
TPLG=/lib/firmware/intel/sof-ipc4-tplg/sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg MODEL=LNLM_SDW_AIOC SOF_TEST_INTERVAL=5 ~/sof-test/test-case/check-playback.sh -d 3 -l 3 -r 1
TPLG=/lib/firmware/intel/sof-ipc4-tplg/sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg MODEL=LNLM_SDW_AIOC SOF_TEST_INTERVAL=5 ~/sof-test/test-case/check-capture.sh -d 3 -l 3 -r 1
TPLG=/lib/firmware/intel/sof-ipc4-tplg/sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg MODEL=LNLM_SDW_AIOC SOF_TEST_INTERVAL=5 ~/sof-test/test-case/check-playback.sh -d 3 -l 1 -r 3
TPLG=/lib/firmware/intel/sof-ipc4-tplg/sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg MODEL=LNLM_SDW_AIOC SOF_TEST_INTERVAL=5 ~/sof-test/test-case/check-capture.sh -d 3 -l 1 -r 3

@plbossart
Copy link
Member

not following why you have 2 PRs that look mostly identical @bardliao? Which one do you want us to review?

@bardliao
Copy link
Collaborator Author

not following why you have 2 PRs that look mostly identical @bardliao? Which one do you want us to review?

Please review #5160. This PR is to discuss the 60f5a6b commit only

@bardliao
Copy link
Collaborator Author

SOFCI TEST

@bardliao bardliao force-pushed the sdw-clock branch 2 times, most recently from 7ded0c4 to 059f9ed Compare October 31, 2024 08:30
@bardliao bardliao changed the title [RFC] soundwire: cadence_master: set frame shape and divider based on actual clk freq soundwire: cadence_master: set frame shape and divider based on actual clk freq Nov 1, 2024
@bardliao bardliao marked this pull request as ready for review November 1, 2024 03:25
@bardliao
Copy link
Collaborator Author

bardliao commented Nov 1, 2024

Rebase to the latest topic/sof-dev branch and the CI test result looks good to me.

if (!prop->default_frame_rate || !prop->default_row) {
dev_err(cdns->dev, "Default frame_rate %d or row %d is invalid\n",
prop->default_frame_rate, prop->default_row);
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should return an error in this case, so change the return type from void to int for this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should return an error in this case, so change the return type from void to int for this function?

Agree, done

…l clk freq

Frame shape and curr_dr_freq could be updated by sdw_compute_bus_params().
Peripherals will set curr_dr_freq as their frequency. Managers
should do the same. Then update frame shape according to the actual
bus frequency.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Now, we can support more than 1 soundwire bus clock frequency.

This reverts commit c326356.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@ranj063 ranj063 merged commit b0dc371 into thesofproject:topic/sof-dev Nov 12, 2024
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants