Skip to content

soundwire: fix programing unattached BUSCLOCK_SCALE issue#5666

Open
bardliao wants to merge 2 commits intothesofproject:topic/sof-devfrom
bardliao:fix-bus_clock_scale_error
Open

soundwire: fix programing unattached BUSCLOCK_SCALE issue#5666
bardliao wants to merge 2 commits intothesofproject:topic/sof-devfrom
bardliao:fix-bus_clock_scale_error

Conversation

@bardliao
Copy link
Collaborator

We do need to set the same bus clock scale on all Peripherals to make sure all Peripherals are running on the same frequency. But we can skip the unattached Peripherals when programing params. Because the frequency will be set when the Peripheral is attached.

simontrimmer
simontrimmer previously approved these changes Feb 11, 2026
@simontrimmer
Copy link
Collaborator

Tested on a LNL product, this looks good and unblocked from my perspective (Though we're still working through the other troubles)

Copy link
Collaborator

@ujfalusi ujfalusi left a comment

Choose a reason for hiding this comment

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

are these two separate issues?
do you want these to be backported to stable? Fixes tag?

ujfalusi
ujfalusi previously approved these changes Feb 11, 2026
@bardliao
Copy link
Collaborator Author

are these two separate issues? do you want these to be backported to stable? Fixes tag?

Hmm, it could be separated. The first commit is to remove the unnecessary writes to the SDW_SCP_BUSCLOCK_SCALE register, and the second commit is to fix the issue that we may access an unattached peripheral. And yes, it is worth to add a Fixes tag to the second commit. I will also revert the commits order to let the fix commit apply to the stable kernel easier.

@bardliao bardliao dismissed stale reviews from ujfalusi and simontrimmer via fad14e4 February 11, 2026 13:21
@bardliao bardliao force-pushed the fix-bus_clock_scale_error branch from 4e03732 to fad14e4 Compare February 11, 2026 13:21
ujfalusi
ujfalusi previously approved these changes Feb 11, 2026
simontrimmer
simontrimmer previously approved these changes Feb 12, 2026
/* Skip the unattached Peripherals */
if (!completion_done(&slave->enumeration_complete)) {
dev_warn(&slave->dev,
"Not enumerated, skip programing BUSCLOCK_SCALE\n");
Copy link
Collaborator

@ranj063 ranj063 Feb 12, 2026

Choose a reason for hiding this comment

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

@bardliao nit-pick: you have several typos in the commit message and here in the word "programming", in the commit message "unattached", "programmed" and "programming". I am good if you want to fix these before sending upstream.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated, could you please double check if I miss any?

ranj063
ranj063 previously approved these changes Feb 12, 2026
…eral

The SDW_SCP_BUSCLOCK_SCALE register will be programmed when the
Peripheral is attached. We can and should skip programming the
SDW_SCP_BUSCLOCK_SCALE register when the Peripheral is unattached.

Fixes: 645291c ("Soundwire: stream: program BUSCLOCK_SCALE")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Currently, we program bus clock scale index unconditionally. It is not
necessary if the new index is the same as the current one.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao bardliao dismissed stale reviews from ranj063, simontrimmer, and ujfalusi via 39feb17 February 13, 2026 02:44
@bardliao bardliao force-pushed the fix-bus_clock_scale_error branch from fad14e4 to 39feb17 Compare February 13, 2026 02:44
@bardliao bardliao requested a review from ujfalusi February 13, 2026 10:03
"Not enumerated, skip programming BUSCLOCK_SCALE\n");
continue;
}

Copy link
Member

Choose a reason for hiding this comment

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

if I follow the commit message "The SDW_SCP_BUSCLOCK_SCALE register will be programmed when the
Peripheral is attached", then why do we even need to configure this register during a stream operation, as done below?

"Not enumerated, skip programming BUSCLOCK_SCALE\n");
continue;
}

Copy link
Member

Choose a reason for hiding this comment

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

also typo in commit tile "unattaced"

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.

5 participants