arm64: kexec: Check if IRQ is already masked before masking
Review
Quoted 8 lines · Thomas Gleixner
This is just wrong. If the interrupt was torn down, then its state is deactivated and it was masked already. So the EOI handling and the mask/disable dance are neither required nor make sense.
So this whole thing should be:
chip = irq_desc_get_chip(desc);(quoted diff) +1
-1- if (!chip) + if (!chip || !irqd_is_started(&desc->irq_data)) continue;
ACK. Will be done this way in V3.
Quoted 23 lines
But what's worse is that we have 4 almost identical variants of the same code.
So instead of exposing core functionality and "fixing" up four variants, can we please have a consolidated version of this function in the core code:
struct irq_chip *chip; int check_eoi = 1; chip = irq_desc_get_chip(desc); if (!chip || !irqd_is_started(&desc->irq_data)) continue; if (IS_ENABLED(CONFIG_.....)) { /* * Add a sensible comment which explains this. */ check_eoi = irq_set_irqchip_state(....); } if (check_eoi && ....) chip->irq_eoi(&desc->irq_data); irq_shutdown(desc);
Quoted 1 line
No?
In V3 I will add a preliminary patch that will remove the four variants and instead add a common implementations to the kexec core.
Thanks, Eliav