diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2021-07-09 13:13:23 +0200 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2021-08-11 20:36:10 +0200 |
commit | 43ba2237281a59b40ea2393da9e89ea3a68de2a5 (patch) | |
tree | 279852e9c915e48d49a5ff5b65e2c05a23d481ff /arch/xtensa | |
parent | xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG (diff) | |
download | linux-43ba2237281a59b40ea2393da9e89ea3a68de2a5.tar.xz linux-43ba2237281a59b40ea2393da9e89ea3a68de2a5.zip |
xtensa: add fairness to IRQ handling
Track which IRQs have been served at each level to make sure that no IRQ
is served more than once while other IRQs at the same level are pending.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/kernel/traps.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index efc3a29cde80..874b6efc6fb3 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c @@ -268,6 +268,7 @@ void do_interrupt(struct pt_regs *regs) XCHAL_INTLEVEL7_MASK, }; struct pt_regs *old_regs; + unsigned unhandled = ~0u; trace_hardirqs_off(); @@ -283,6 +284,10 @@ void do_interrupt(struct pt_regs *regs) for (level = LOCKLEVEL; level > 0; --level) { if (int_at_level & int_level_mask[level]) { int_at_level &= int_level_mask[level]; + if (int_at_level & unhandled) + int_at_level &= unhandled; + else + unhandled |= int_level_mask[level]; break; } } @@ -290,6 +295,8 @@ void do_interrupt(struct pt_regs *regs) if (level == 0) break; + /* clear lowest pending irq in the unhandled mask */ + unhandled ^= (int_at_level & -int_at_level); do_IRQ(__ffs(int_at_level), regs); } |