Repository navigation
Conversation
- include the final fitting bitmap range when allocating from a DMA pool - match DMA pool ownership with exclusive region boundaries and allocation size - preserve mapping ownership when freeing cached and non-linear DMA memory - emit the correct PL330 DMALP loop-count byte - wait for DMAEND after DMAKILL before reusing a PL330 channel or releasing resources - honor the peripheral burst quirk when generating PL330 single-transfer programs - reject 32-bit DW SDIO IDMAC buffers and descriptor rings outside its DMA aperture - use one-shot timers for DW SDIO command and data timeouts Signed-off-by: GuEe-GUI <2991707448@qq.com>
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-10-29 16:24 CST)
📝 Review Instructions
|
|
Rbb666
left a comment
There was a problem hiding this comment.
发现两处 PL330 错误恢复问题,详见行内意见。已使用提取自本提交的 C 函数进行主机桩测试;尚未进行硬件或 QEMU 验证。
|
|
||
| if ((err = pl330_wait_stopped(pl330, pc))) | ||
| { | ||
| return err; |
There was a problem hiding this comment.
[P2] 准备失败后仍需允许停止旧传输
当旧传输仍处于 WFP、循环运行中或已经进入 FAULT 时,这里会返回超时或 I/O 错误。上层 rt_dma_prep_single() 会把该错误写入 chan->prep_err,而 rt_dma_chan_stop() 在发现 prep_err 非零时直接返回,不再调用控制器的 stop(),因此后续清理无法下发 DMAKILL。对于需要 DMAKILL 才能退出的状态,重试准备也无法恢复。
使用本提交中的函数进行主机桩测试,能够复现 prep 返回错误后,调用 rt_dma_chan_stop() 时控制器停止函数的调用次数为 0。建议同步调整框架的停止路径,确保准备失败不会阻止清理此前的活动传输;prep_memcpy 和 prep_cyclic 新增的检查也需要覆盖这一情况。
| } | ||
| if (csr == PL330_CS_FAULT || csr == PL330_CS_FLTCMP) | ||
| { | ||
| return -RT_EIO; |
There was a problem hiding this comment.
[P2] 等待 DMAKILL 完成时不应因旧故障状态立即退出
pl330_dma_stop() 写入 DBGCMD 后立即调用此函数,但调试指令可能需要若干时钟周期才开始执行。如果第一次读取 CSR 时仍是原来的 FAULT/FLTCMP,这里就返回 -RT_EIO,没有等到 DMAKILL 将通道推进到 STOP,导致停止操作误报失败,也没有完成本次修改预期的同步停止。
建议区分准备/启动前的状态检查与 DMAKILL 后的停止等待:后者应允许故障状态在指令执行前短暂存在,并有界等待 STOP。主机桩测试中,将 CSR 设置为 FAULT、计划下一次轮询转为 STOP,当前函数会在第一次读取后直接退出。
依据:ARM PL330 技术参考手册 第 2.5.1 节说明调试指令可能延迟若干周期执行,第 4.3.10 节说明 DMAKILL 最终使通道进入 Stopped。
拉取/合并请求描述:(PR description)
[
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up