[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CBF3C648-84C9-4034-A5A0-EC110A9124E4@amazon.com>
Date: Mon, 1 Jun 2020 00:10:06 +0000
From: "Saidi, Ali" <alisaidi@...zon.com>
To: Marc Zyngier <maz@...nel.org>
CC: Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"Herrenschmidt, Benjamin" <benh@...zon.com>,
"Woodhouse, David" <dwmw@...zon.co.uk>,
"Zilberman, Zeev" <zeev@...zon.com>,
"Machulsky, Zorik" <zorik@...zon.com>
Subject: Re: [PATCH] irqchip/gic-v3-its: Don't try to move a disabled irq
Marc,
> On May 31, 2020, at 6:10 AM, Marc Zyngier <maz@...nel.org> wrote:
>> Not great indeed. But this is not, as far as I can tell, a GIC
>> driver problem.
>>
>> The semantic of activate/deactivate (which maps to started/shutdown
>> in the IRQ code) is that the HW resources for a given interrupt are
>> only committed when the interrupt is activated. Trying to perform
>> actions involving the HW on an interrupt that isn't active cannot be
>> guaranteed to take effect.
Yes, then it absolutely makes sense to address it outside the GIC.
>>
>> I'd rather address it in the core code, by preventing set_affinity (and
>> potentially others) to take place when the interrupt is not in the
>> STARTED state. Userspace would get an error, which is perfectly
>> legitimate, and which it already has to deal with it for plenty of
>> other
>> reasons.
>
> How about this:
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 453a8a0f4804..1a2ac1392c0f 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -147,7 +147,8 @@ cpumask_var_t irq_default_affinity;
> static bool __irq_can_set_affinity(struct irq_desc *desc)
> {
> if (!desc || !irqd_can_balance(&desc->irq_data) ||
> - !desc->irq_data.chip || !desc->irq_data.chip->irq_set_affinity)
> + !desc->irq_data.chip || !desc->irq_data.chip->irq_set_affinity ||
> + !irqd_is_started(&desc->irq_data))
> return false;
> return true;
> }
Confirmed I can’t reproduce the issue with your fix.
Thanks,
Ali
Powered by blists - more mailing lists