if (!need_irq_preemption())
return false;
- /*
- * Note: thread_info::preempt_count includes both thread_info::count
- * and thread_info::need_resched, and is not equivalent to
- * preempt_count().
- */
- if (READ_ONCE(current_thread_info()->preempt_count) != 0)
- return false;
-
/*
* DAIF.DA are cleared at the start of IRQ/FIQ handling, and when GIC
* priority masking is used the GIC irqchip driver will clear DAIF.IF
do_interrupt_handler(regs, handler);
irq_exit_rcu();
- if (arm64_preempt_schedule_irq())
- preempt_schedule_irq();
+ if (!preempt_count() && need_resched()) {
+ if (arm64_preempt_schedule_irq())
+ preempt_schedule_irq();
+ }
exit_to_kernel_mode(regs, state);
}