From: Thomas Gleixner <tglx@linutronix.de>
To: markus.stockhausen@gmx.de, tsbogend@alpha.franken.de,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
s.gottschall@dd-wrt.com
Subject: Re: AW: [PATCH] irqchip/mips-gic: allow forced affinity for current cpu during hotplug
Date: Sun, 25 May 2025 20:40:04 +0200 [thread overview]
Message-ID: <878qmkr0u3.ffs@tglx> (raw)
In-Reply-To: <043701dbcd59$73bcfb70$5b36f250$@gmx.de>
On Sun, May 25 2025 at 11:43, markus stockhausen wrote:
>> Von: Thomas Gleixner <tglx@linutronix.de>
>>
>> On Fri, May 23 2025 at 11:15, Markus Stockhausen wrote:
>> > +
>> > + if ((cpu >= NR_CPUS) && !force)
>> > + /* In normal mode allow only online CPUs. */
>> > return -EINVAL;
>> >
>> > + if (cpu >= NR_CPUS) {
>> > + /* In force mode allow current not yet online CPU for
> hotplug handlers. */
>> > + cpu = cpumask_first(cpumask);
>> > + if (cpu != get_cpu())
>> > + return -EINVAL;
>> > + }
>>
>> This logic really makes my brain hurt. Why not doing the obvious:
>>
>> if (cpu >= NR_CPUS) {
>> /* Sensible comment */
>> if (!force)
>> return -EINVAL;
>> ...
>> }
>
> Then what about an even more relaxed and cleaner version like in other
> drivers?
>
> If (force)
> cpu = cpumask_first(cpumask);
> else
> cpu = cpumask_first_and(cpumask, cpu_online_mask);
Fine with me.
prev parent reply other threads:[~2025-05-25 18:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 15:15 [PATCH] irqchip/mips-gic: allow forced affinity for current cpu during hotplug Markus Stockhausen
2025-05-25 9:10 ` Thomas Gleixner
2025-05-25 9:43 ` AW: " markus.stockhausen
2025-05-25 18:40 ` Thomas Gleixner [this message]
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=878qmkr0u3.ffs@tglx \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=markus.stockhausen@gmx.de \
--cc=s.gottschall@dd-wrt.com \
--cc=tsbogend@alpha.franken.de \
/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