dma: hda: enable xrun handling#53327
Conversation
8ecb99a to
4e9424d
Compare
There was a problem hiding this comment.
In looking at the sof code for HDA this is logged, cleared, and then ignored. See https://github.com/thesofproject/sof/blob/main/src/drivers/intel/hda/hda-dma.c#L933
GPDMA does not have specific flagging to say there was an under/over run, but that the transfer (an endless loop of them in sof) has stopped by checking the enable bit, signaling an under/over run. https://github.com/thesofproject/sof/blob/main/src/drivers/dw/dma.c#L1126
I think returning -ENODATA here from get_status is good though! The error return is enough to signal an under/over run as the stream direction should be known by the caller.
So lets remove the bool additions from the status struct here, which are going to be unused by all other DMAs in Zephyr today and document the -ENODATA return.
Doing that, +1 from me easy
|
@teburd |
For the error code, SOF has used ENODATA quite a bit, but I do agree EPIPE is probably better. ENODATA is more often used in cases, where the condition is not a fatal error yet, there's just not data yet. EPIPE seems more fitting as signals a more severe problem, which applies here as the DMA did run out of data leading to data loss. |
Enable link under/overruns handling and reporting such events in dma status Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
4e9424d to
1afcc20
Compare
There was a problem hiding this comment.
Is this report generic for HDA link? In any case information in the comment on report functions describing where we actually reporting it to would be good I think.
Maybe to be more specific: If I was reading this not knowing the context I would ask myself why we clear on the xrun detect.
@dabekjakub Good point. Yes, this is generic for HDA link. From SOF point of view link status is retrieved each time new data is copied from/to link in DAI or Chain DMA interfaces. Once we had a chance to get its status, we clear stat register and this is the only chance to handle xrun. After retrieving xrun we have to clean it to be able to check it during next chunk processing. However, I am a little bit concerning if we should not move reg clearing it to dma_reload... What do you think ? |
|
@makarukp can you update the PR comment as well? Still says "please do not merge" |
|
@makarukp @softwarecki @mwasko This causes HDMI tests to fail in SOF CI when we attempt to move to newer Zephyr mainline -> thesofproject/sof#6965 |
|
@kv2019i Could you provide any IPC + FW logs for analysis and reproduction? |
|
Thanks to |
|
Could this be reverted for now? This is now blocking zephyr upgrades and testing like:
A bit problematic considering Zephyr is now in a pre-release, bug fixing phase. |
@marc-hb we are currently working to fix this issue. In case of no progress in a next few days we will revert changes. |
|
PR in OSF should solve the issue: |
This is proposition of enabling link under/overruns handling and reporting such events in dma status.
Signed-off-by: Piotr Makaruk piotr.makaruk@intel.com