Repository navigation
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
|
意思是都 EOI 了就没必要 ACK 了么? |
|
这个 PR 删的不是 ACK,也不是 EOI,而是旧 arm_gic_ack 在 EOI 之前多写的一笔 GICD_ICPENDR(清 pending)。这笔写是错的:处理期间若同一边沿中断源又来了新事件(典型如 NPU 先报 AXI 错误、紧接着报 done),GIC 会重新锁存 pending,这笔 ICPENDR 会把它抹掉,导致新中断永久丢失。实测:删掉它,纯中断路径 48 万次推理 0 失败;加上它, |
|
看了一下,arm_gic_ack 是对的,rt_hw_interrupt_ack 的用法不对,在 ISR 之后再调用会出问题,那还是建议改 traps.c 中的用法。 |
|
arm_gic_ack() 这个名字其实有误导性——它做的是 EOI(写 GICC_EOIR),不是 ACK。GIC 的中断处理是两件事:
真正的问题是:arm_gic_ack() 除了写 EOI,还多写了一笔 GICD_ICPENDR(清 pending)。这笔写个人认为既没必要(读 IAR 时 pending 已被硬件清除),又有害——ISR 执行期间若同一边沿中断源又来了新事件,GIC 会重新锁存 pending,这笔 ICPENDR 会把它抹掉,导致新中断永久丢失。 |
|
是 ACK 的意思,只是 GIC 有两种模式,一个 EOI 模式,一个是非 EOI,RTOS通常用非 EOI 模式,所以看上去语义很奇怪,你可以看看其他操作系统比如Linux的写法。 rt-thread/libcpu/aarch64/common/trap.c Lines 180 to 208 in 5d1fb66 |
|
稍等,这两天再测试一下trap.c的改法 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
arm_gic_ack() currently clears the interrupt pending state through GIC_DIST_PENDING_CLEAR before writing the interrupt ID to GIC_CPU_EOI.
This change removes the explicit pending-clear operation and its now-unused mask variable, leaving the CPU interface EOI write as the interrupt acknowledgment operation.
你的解决方案是什么 (what is your solution)
Remove the GIC_DIST_PENDING_CLEAR write and the unused mask variable from arm_gic_ack().
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 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