Skip to content

irqchip/sifive-plic: fix stuck in-progress IRQ on affinity migration#247

Open
swjtuer326 wants to merge 1 commit into
RVCK-Project:OLK-6.6from
swjtuer326:plic-affinity-fix
Open

irqchip/sifive-plic: fix stuck in-progress IRQ on affinity migration#247
swjtuer326 wants to merge 1 commit into
RVCK-Project:OLK-6.6from
swjtuer326:plic-affinity-fix

Conversation

@swjtuer326

Copy link
Copy Markdown

community inclusion
category: bugfix
bugzilla: #246

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck-olk/actions/runs/29484887421

参数解析结果
args value
repository RVCK-Project/rvck-olk
head ref pull/247/head
base ref OLK-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch success
lava-trigger-qemu failure
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

[08:55:41] Testing complete. Ran 482 tests: passed: 466, skipped: 16

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 0

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck-olk/247_29484887421_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck-olk/247_29484887421_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck-olk_pull_request_target_247__common-test_qemu

result: Lava check done!

community inclusion
category: bugfix
bugzilla: RVCK-Project#246
Reference: RVCK-Project#247

--------------------------------

The PLIC silently drops a completion whose source is not enabled for the
target hart, and until it receives a completion it will not re-deliver
the source, so the device stops receiving interrupts.

During affinity migration plic_set_affinity() clears the old hart's
enable bit; if that lands between claim and completion, the completion
is dropped. For a direct PLIC IRQ, plic_irq_eoi() and plic_set_affinity()
are both under desc->lock and cannot race, but a PLIC IRQ backing a
chained irqchip issues the completion from chained_irq_exit() and reaches
plic_set_affinity() via the chained chip's ->irq_set_affinity() callback,
neither holding desc->lock.

Take the per-context enable_lock (already held by plic_toggle() when
clearing the enable bit) across plic_irq_eoi() so the affinity clear
cannot overlap the EOI; test the enable bit inside the critical section
and re-enable around the completion if it is clear. enable_lock nests
inside desc->lock, so no new lock ordering is introduced.

Signed-off-by: Bowen Pang <bowen.pang01@sophgo.com>
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck-olk/actions/runs/29485015232

参数解析结果
args value
repository RVCK-Project/rvck-olk
head ref pull/247/head
base ref OLK-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch success
lava-trigger-qemu success
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

[08:57:06] Testing complete. Ran 482 tests: passed: 466, skipped: 16

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 0

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck-olk/247_29485015232_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck-olk/247_29485015232_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck-olk_pull_request_target_247__common-test_qemu

result: Lava check done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant