-
Notifications
You must be signed in to change notification settings - Fork 349
drivers: Intel: SSP: ignore config when SSP is already configured #4462
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
Conversation
|
@ranj063 I am not completely on-board with the explanations and the fix. At the end of ssp_set_config() we do ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_PREPARE;
ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_PREPARE;So you should probably clarify that we don't do the configuration twice. The other open I have is that in theory we said that this configuration can be done multiple times. I think what happened is that we do a set of register writes, and later some register updates. We should probably only do a write once per register so that in the event where the configuration is run twice, there is no change to the register settings. |
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested edit to the commit message:
When two streams are started one after the other, 2 DAI_CONFIG
IPC's will be sent before the START trigger. This ends up
configuring the SSP when the first one has already just
configured it and ends up with xruns.
The root cause is that the ssp_set_config() function configures a set of variables, writes those variables into SSP registers, and later on does a read-modify-write operation on the TSRE, RSRE and SSE bits.
If the ssp_set_config is executed more than once, this will temporarily clear all three bitfields, and temporarily disables DMA transfers and SSP clocks. This is not desirable at all...
Avoid this by checking
if the current state is > COMP_STATE_READY before configuring the
SSP, so that the ssp_set_config() function only modifies SSP registers once.
When two streams are started one after the other, 2 DAI_CONFIG IPC's will be sent before the START trigger. This ends up configuring the SSP when the first one has already just configured it and ends up with xruns. The root cause is that the ssp_set_config() function configures a set of variables, writes those variables into SSP registers, and later on does a read-modify-write operation on the TSRE, RSRE and SSE bits. If the ssp_set_config is executed more than once, this will temporarily clear all three bitfields, and temporarily disable DMA transfers and SSP clocks. Avoid this by checking if the current state is > COMP_STATE_READY before configuring the SSP, so that the ssp_set_config() function only modifies SSP registers once. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Thanks @plbossart. Updated now |
|
I am going to take a calculated risk and merge this to see if this solves our daily test issue before the end of the week. If not we can always revert/improve tomorrow |
When two streams are started one after the other, 2 DAI_CONFIG
IPC's will be sent before the START trigger. This ends up
configuring the SSP when the first one has already just
configured it and ends up with xruns. Avoid this by checking
if the current state is > COMP_STATE_READY before configuring the
SSP.
Fixes #4457