Repository navigation
lib: dma: simplify DMAC search and fix users to max channels - #687
Conversation
Currently the dai user only increments the DMA channel usage count on channel start and decrements on stop. This doesn't align with the current DMAC allocator so ensure that the DMAC allocator cannot over subscribe a DMAC with more users than channels. i.e. DAI config will try and allocate a channel and fail if over subscribed. This needs to be revisisted with changes to DAI to allow over subscription. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
libinyang
left a comment
There was a problem hiding this comment.
In the sof code, host and dai will comsume a lot of dma channels. Only dai will get dma channels in initialization and host doesn't.
For byt, there are only 2 dmacs.
For apl-like, there are 2 GPDMA which has 8 channels for each; one host-in DMAC which has 7 channels; one host-out DMAC which has 6 or 9 channels. one link-in DMAC which has 8 or 9 channels; one link-out DMAC which has 8 or 7 channels.
This patch will introduce the new limitation for host components. If pipelines are more than the host dma for apl, it will not work. (GPDMA channel number is 8 for dai, while host dma channel number is 6 for host component. So it will definitely no dmac for host). For byt, both host and dai will use GPDMA, if pipelines are more than 8, it will use 2x8 DMA channels and it will complain no channels.
|
@libinyang there is already a limitation on each DMAC today with the generic DAI driver which grabs a DMA channel on every call to DAI config (even if the DAI is never used). This needs rework later after 0.3 release, but this change today only limits the number of users to the number of channels (otherwise some nocodec topologies will not load).. As far as pipelines that over commit the host DMA channels then these are not supported since they cannot be guaranteed to run concurrently. They are mutually exclusive by design and hence will result in new errors being propagated up the stack. |
|
@lgirdwood can fix this issue. But I believe this fix is still not enough on byt platform as host dma and dai dma are using GPDMA together. |
This is the intention.
Pipelines must not over commit DMAC channels as playback is not guaranteed for any pipeline in this case.
So topology here is broken or someone is asking for multiple channels.... either way a bug. |
|
@lgirdwood |
Then the topology is broken for that platform. Which topologies do you mean ? |
@lgirdwood I'm using sof-apl-nocodec.tplg to test |
Currently the dai user only increments the DMA channel usage count on
channel start and decrements on stop. This doesn't align with the current
DMAC allocator so ensure that the DMAC allocator cannot over subscribe
a DMAC with more users than channels. i.e. DAI config will try and allocate
a channel and fail if over subscribed.
This needs to be revisisted with changes to DAI to allow over subscription.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com