From: Thomas Gleixner <tglx@linutronix.de>
To: Jinjie Ruan <ruanjinjie@huawei.com>, linux-kernel@vger.kernel.org
Cc: ruanjinjie@huawei.com
Subject: Re: [PATCH] genirq: Fix IRQ_MOVE_PENDING try set when CONFIG_GENERIC_PENDING_IRQ not set
Date: Mon, 02 Sep 2024 09:19:10 +0200 [thread overview]
Message-ID: <87ttey7cb5.ffs@tglx> (raw)
In-Reply-To: <20240830100923.3818817-1-ruanjinjie@huawei.com>
On Fri, Aug 30 2024 at 18:09, Jinjie Ruan wrote:
> The irqd_set_move_pending() and irq_copy_pending() appear in pairs, but
> irq_copy_pending() is empty when CONFIG_GENERIC_PENDING_IRQ is not set,
> irqd_set_move_pending always set IRQD_SETAFFINITY_PENDING flag.
Which will never happen if CONFIG_GENERIC_PENDING_IRQ is not set.
> And before commit 1fa46f1f0709 ("genirq: Simplify affinity related code"),
> if the config not set, IRQ_MOVE_PENDING will not try set and
# git grep IRQ_MOVE_PENDING
#
> desc->pending_mask will not be copied no matter what. Fix it by combining
> them to align with them, and define empty for both if the config
> is not enabled.
>
> Fixes: 1fa46f1f0709 ("genirq: Simplify affinity related code")
What does this actually fix?
You fail to explain what the actual consequence and failure is. If your
change is not fixing anything then there is no reason for a fixes tag.
> static inline void
> -irq_copy_pending(struct irq_desc *desc, const struct cpumask *mask)
> +irq_set_copy_pending(struct irq_data *data, const struct cpumask *mask)
> {
> + struct irq_desc *desc = irq_data_to_desc(data);
> +
> + irqd_set_move_pending(data);
> cpumask_copy(desc->pending_mask, mask);
> }
How is that different from the existing irq_set_affinity_pending() ?
> -#ifdef CONFIG_GENERIC_PENDING_IRQ
> static inline int irq_set_affinity_pending(struct irq_data *data,
> const struct cpumask *dest)
> {
> - struct irq_desc *desc = irq_data_to_desc(data);
> -
> - irqd_set_move_pending(data);
> - irq_copy_pending(desc, dest);
> + irq_set_copy_pending(data, dest);
> +#ifdef CONFIG_GENERIC_PENDING_IRQ
No. We don't put the ifdefs into the function. That's horrible to read.
Thanks,
tglx
prev parent reply other threads:[~2024-09-02 7:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 10:09 [PATCH] genirq: Fix IRQ_MOVE_PENDING try set when CONFIG_GENERIC_PENDING_IRQ not set Jinjie Ruan
2024-09-02 7:19 ` 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=87ttey7cb5.ffs@tglx \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ruanjinjie@huawei.com \
/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