From: Marc Zyngier <maz@kernel.org>
To: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
Hanks Chen <hanks.chen@mediatek.com>,
Cheng-Yuh.Wu@mediatek.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqchip/gic-v3: Workaround for GIC-700 erratum 2941627
Date: Tue, 04 Jul 2023 16:31:13 +0100 [thread overview]
Message-ID: <86r0pnwv5q.wl-maz@kernel.org> (raw)
In-Reply-To: <ZKQ6ce1pbYHGVIsA@lpieralisi>
On Tue, 04 Jul 2023 16:27:45 +0100,
Lorenzo Pieralisi <lpieralisi@kernel.org> wrote:
>
> On Tue, Jul 04, 2023 at 03:44:50PM +0100, Marc Zyngier wrote:
>
> [...]
>
> > > + return !((gic_irq_in_rdist(d)) || gic_irq(d) >= 8192 ||
> > > + cpumask_equal(irq_data_get_effective_affinity_mask(d),
> > > + cpumask_of(smp_processor_id())));
> >
> > I dislike this statement for multiple reasons:
> >
> > - it is written as a negation, making it harder than strictly
> > necessary to parse as it is the opposite of the comment above
> >
> > - gic_irq_in_rdist() and gic_irq(d) >= 8192 are two ways of checking
> > the interrupt range -- maybe we should just do that
> >
> > - cpumask_equal() is *slow* if you have more that 64 CPUs, something
> > that is increasingly common -- a better option would be to check
> > whether the current CPU is in the mask or not, which would be enough
> > as we only have a single affinity bit set
> >
> > - smp_processor_id() can check for preemption, which is pointless
> > here, as we're doing things under the irq_desc raw spinlock.
> >
> > I would expect something like:
> >
> > enum gic_intid_range range = get_intid_range(d);
> >
> > return (range == SGI_RANGE || range == ESPI_RANGE) &&
> > !cpumask_test_cpu(raw_smp_processor_id(),
> > irq_data_get_effective_affinity_mask(d));
> >
>
> s/SGI/SPI - just noticed, for the records.
Indeed. As you can tell, I didn't really test the damn thing...
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-04 15:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 12:34 [PATCH] irqchip/gic-v3: Workaround for GIC-700 erratum 2941627 Lorenzo Pieralisi
2023-07-04 14:44 ` Marc Zyngier
2023-07-04 15:14 ` Lorenzo Pieralisi
2023-07-04 15:23 ` Marc Zyngier
2023-07-04 15:27 ` Lorenzo Pieralisi
2023-07-04 15:31 ` Marc Zyngier [this message]
2023-07-04 15:50 ` [PATCH v2] " Lorenzo Pieralisi
[not found] <ed3c5fe3f7ed42d58d98e77b3513d6eabf2ad6cd.camel@mediatek.com>
2023-07-09 8:20 ` [PATCH] " Marc Zyngier
2023-07-10 6:00 ` Chunhui Li (李春辉)
2023-07-11 2:03 ` Chunhui Li (李春辉)
[not found] <17c629f00dee2bbcd09b99a6ed1bd2a411322084.camel@mediatek.com>
2023-07-12 7:21 ` Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86r0pnwv5q.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=Cheng-Yuh.Wu@mediatek.com \
--cc=hanks.chen@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).