rockchip/64: fix pl330 cyclic dma transfers #7695
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
PL330 DMA controller driver in mainline kernel is suboptimal; according to this patch, the driver can be modified to make it more efficient and stable.
This inefficiency causes ALL rockchip SoCs I tested (rk3228, rk3308, rk3328 and rk3399) to produce pops and clicks when playing through I²S (ie: analog or HDMI) or SPDIF outputs even with modest load on memory subsystem, but the DMA controller also serves UART, SPI bus, CAN bus, PWMs, and some other device... so possibly the DMA issues of the mainline driver can affect several other areas, sound is just the most evident one.
In my case, I can steadily reproduce the problem on all the mentioned SoCs this way:
aplay
,ogg123
or whatever. The issue appears more prominent if at high samplerates (>= 96khz)mbw
, tying the process to a core which is not the same core handling DMA controller interruptsAn example:
This PR takes the patch above and applies to kernel 6.12 (current) and 6.13 (edge) for both rockchip and rockchip64 families.
After the patch, the issue is much more reduced, but not totally cancelled yet, because if you add a third
iperf3
process to the mix, the clicks and pops still appears (at least on rk3308):Nonetheless, this is a first step that will address the common scenario with "regular" workloads and is probably a good idea to bring in this fix until I progress in completely fixing the issue. As a note, the rockchip vendor 4.4 kernel on rk3308 does not show any issue.
I don't know if rk356x and rk3588 also are affected, but since they use pl330 DMA controllers as well, I guess the issues can appear there too. Other possibly affected SoC may be some Samsung Exynos SoCs.
SPDIF
maxburst
parameter is also increased from4
to8
words, as it is in the vendor kernel.GitHub issue reference:
Jira reference number AR-2584
How Has This Been Tested?
ogg123
+mbw
has been done to verify there were no artifacts in analog and SPDIF audioChecklist:
Please delete options that are not relevant.