• Thomas Gleixner's avatar
    genirq/affinity: Make affinity setting if activated opt-in · f0c7baca
    Thomas Gleixner authored
    John reported that on a RK3288 system the perf per CPU interrupts are all
    affine to CPU0 and provided the analysis:
    
     "It looks like what happens is that because the interrupts are not per-CPU
      in the hardware, armpmu_request_irq() calls irq_force_affinity() while
      the interrupt is deactivated and then request_irq() with IRQF_PERCPU |
      IRQF_NOBALANCING.  
    
      Now when irq_startup() runs with IRQ_STARTUP_NORMAL, it calls
      irq_setup_affinity() which returns early because IRQF_PERCPU and
      IRQF_NOBALANCING are set, leaving the interrupt on its original CPU."
    
    This was broken by the recent commit which blocked interrupt affinity
    setting in hardware before activation of the interrupt. While this works in
    general, it does not work for this particular case. As contrary to the
    initial analysis not all interrupt chip drivers implement an activate
    callback, the safe cure is to make the deferred interrupt affinity setting
    at activation time opt-in.
    
    Implement the necessary core logic and make the two irqchip implementations
    for which this is required opt-in. In hindsight this would have been the
    right thing to do, but ...
    
    Fixes: baedb87d ("genirq/affinity: Handle affinity setting on inactive interrupts correctly")
    Reported-by: default avatarJohn Keeping <john@metanate.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Tested-by: default avatarMarc Zyngier <maz@kernel.org>
    Acked-by: default avatarMarc Zyngier <maz@kernel.org>
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/87blk4tzgm.fsf@nanos.tec.linutronix.de
    f0c7baca
manage.c 72.6 KB