Re: [patch 6/8] genirq: Provide IRQCHIP_AFFINITY_PRE_STARTUP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 22 2021 at 16:12, Marc Zyngier wrote:
> On Wed, 21 Jul 2021 20:11:32 +0100,
> Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>>  #include <linux/irqdesc.h>
>> --- a/kernel/irq/chip.c
>> +++ b/kernel/irq/chip.c
>> @@ -265,8 +265,11 @@ int irq_startup(struct irq_desc *desc, b
>>  	} else {
>>  		switch (__irq_startup_managed(desc, aff, force)) {
>>  		case IRQ_STARTUP_NORMAL:
>> +			if (d->chip->flags & IRQCHIP_AFFINITY_PRE_STARTUP)
>> +				irq_setup_affinity(desc);
>
> How about moving this to activate instead? We already special-case the
> activation of MSIs for PCI (MSI_FLAG_ACTIVATE_EARLY), and this
> wouldn't look completely out of place. The startup mode could be an
> issue though...

Yes, I thought about that, but the ordering here is:

setup()
  early_activate()

early activation just needs to program a valid message. Now later we
have request_irq() invoking:

     activate()
     startup()

So, yes. We could do that in activate, but then we still have the post
startup variant in irq_startup() which makes the code hard to follow.

There is another practical issue. Assume the irq is requested with
IRQF_NOAUTOEN, then irq_startup() will be invoked when the driver calls
enable_irq(), which might be way later and then the affinity setting
might be completely different already. So I rather keep it there.

Thanks,

        tglx



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux