-
Notifications
You must be signed in to change notification settings - Fork 349
[Stable v1.7] Backport some fixes for v1.7 final release #3933
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
[Stable v1.7] Backport some fixes for v1.7 final release #3933
Conversation
To stop/suspend an active DMA channel: 1. Stop the DMA service request at the peripheral first (stop the DAI); 2. Disable the hardware service request on the appropriate DMA channel. For start/resume: 1. Enable the DMA service request on the appropriate channel; 2. Enable the DMA service request at the peripheral (enable DAI). When the start/stop order for DMA and DAI is different, on multiple start/stop runs for playback or record or combined, we get an underrun/overflow. That's because the DAI makes a DMA request, before the DMA channel is enabled. Some platforms cannot just simple disable DMA channel during the transfer, because it will hang the whole DMA controller. Therefore, for DMA_SUSPEND_DRAIN, stop the DMA first and let the DAI drain the FIFO in order to stop the channel as soon as possible. Fixes: thesofproject#3809 Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Set SAI watermark only once, on sai_set_config(). There is no need to set it each time, on start(). SAI watermark is kept on half FIFO size. Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
For SAI, we have the synchronous mode enabled: the transmitter is configured for asynchronous operation and the receiver for synchronous operation. In this case, transmitter bit clock and frame sync are used by both the transmitter and receiver. So, when enabling RX we need to enable TX (if not already enabled). Therefore, for a clear start, we first do a software reset for the current direction, but checking the state of RX and TX. This will reset the internal transmitter/receiver logic including the FIFO pointers. For capture we can disable the receiver data channel, but on playback, we can disable the transmitter only if the RX has the DMA requests disabled. Also, for capture, there's no need to enable the transmit data channel. It's sufficient to enable only the transmitter, which enables the bit clock (shared with RX). On stop, we just need to disable the DMA request, the transmit/receive data channel, the interrupts and the receiver and/or the transmitter. Fixes: thesofproject#3809 Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
On start W1C the Work Start Flag, Sync Error Flag and FIFO Error Flag. Write a logic 1 to this field to clear each of this flags and have a clean start for SAI. Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
paulstelian97
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.
I assume Intel was OK with the ordering change in the original PR so approving based on that.
|
@paulstelian97 @iuliana-prodan please confirm all patches are in master ? |
It's exactly the 4 commits from #3867. |
Yes, are the exact patches from master. |
|
CI showing docker build timeout and known issue on BYT |
Next time use the More backporting tips learned from backporting tens of thousands of commits: https://chromium.googlesource.com/chromiumos/docs/+/master/kernel_development.md#How-do-I-backport-an-upstream-patch |
@marc-hb Thanks! I'll use -x option next time. |
Cherry-pick some fixes from DAI and IMX for v1.7 final release.
Original pull request was #3867
Fixes: #3809