Repository navigation
Multi core series -- cache & consistency - #4221
Conversation
There was a problem hiding this comment.
Everything else looks good, not sure why this is going away though. What was the logic here and why is this no longer needed?
There was a problem hiding this comment.
@keyonjie this code clears all the DONE bits in the LLI that's be written by HW. If these bits are not clear then DMA will stop.
There was a problem hiding this comment.
@paulstelian97 @lgirdwood this part is covered by above Zephyr lines:
for (i = 0; i < channel->desc_count; i++)
dw_chan->lli[i].ctrl_hi &= ~DW_CTLH_DONE(1);
There was a problem hiding this comment.
Sorry I mean, when we dont use Zephyr ?
There was a problem hiding this comment.
Sorry I mean, when we dont use Zephyr ?
before change,
Zephyr case: do invalidate -> write -> writeback
Non-Zephyr case: just write.
after my change,
unified for Zephyr and Non-Zephyr cases('#if defined ZEPHYR' is removed): do invalidate -> write -> writeback
There was a problem hiding this comment.
This is racy and there is no easy way around it. We are racing against the DMAC writing back the LLI data which could occur during this loop. This may be safer if we allocate LLI as an uncache region. i.e. both DW driver and DMAC use the uncache address for LLI.
lgirdwood
left a comment
There was a problem hiding this comment.
I assume we are good for alh and dmic ?
There was a problem hiding this comment.
@keyonjie this code clears all the DONE bits in the LLI that's be written by HW. If these bits are not clear then DMA will stop.
|
looks this fail on APL, mark it draft as debugging needed. |
There was a problem hiding this comment.
corresponding to the line 829, an empty line between variables and codes.
|
SOFCI TEST |
c694029 to
46152d3
Compare
lgirdwood
left a comment
There was a problem hiding this comment.
I think it probably make a lot more sense to allocate shared configuration data using the uncached alias, this way we dont have to manually remember to inv or wb and it keeps the code simpler.
Btw, there is still a CI failure in APL nocodec.
There was a problem hiding this comment.
These should be after the spin_lock (since the lock has a memory barrier built in)
There was a problem hiding this comment.
This is racy and there is no easy way around it. We are racing against the DMAC writing back the LLI data which could occur during this loop. This may be safer if we allocate LLI as an uncache region. i.e. both DW driver and DMAC use the uncache address for LLI.
While this is probably fine for now, the code should be compatible with switching back to being able to correctly support either; if i.MX ever comes up with a multicore DSP, well we don't have uncached aliases so we'd have to use cached memory for that. |
Agree, but the driver will be fully integrated with Zephyr at this point so that would then have to align with any Zephyr cache APIs. |
|
@lgirdwood @paulstelian97 I just change to use small change as @lgirdwood suggested, allocated shared uncached memory where needed, now the change is very minor while addressing multi-core issue. |
|
SOFCI TEST |
The DMA channels need to be shared among pipelines and DSP cores, allocate buffer for it in RUNTIME_SHARED area. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
The dd and dai_spec_config need to be shared among DSP cores, allocate them in RUNTIME_SHARED area. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
|
This should go for rc3 |
|
@keyonjie CI looking clean now - we can ignore the DUT boot failure. Lets takes for rc3. @slawblauciak fyi |
|
Thanks for reviewing, as it is minor change and fixes multi-core xrun issue, I will merge it myself. |
For dw dma controllers and channels, they are shared to multiple pipelines and cores.
For dai config and ssp config, the configuration may happen on different core with the one on the active time.
Add cache invalidate and writeback to ensure the consistency, to address issue #3953