public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Anup Patel <anup@brainfault.org>
Cc: Yingjun Ni <yingjun.ni@riscv-computing.com>,
	pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
	alex@ghiti.fr, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqchip/riscv-imsic: Fix irq migration failure issue when cpu hotplug.
Date: Tue, 03 Feb 2026 19:28:18 +0100	[thread overview]
Message-ID: <87ldh93cn1.ffs@tglx> (raw)
In-Reply-To: <CAAhSdy31dF1qHtaM1mqx+dG6ryb_3M+M63e8ujaCZBWDGUYeNg@mail.gmail.com>

On Tue, Feb 03 2026 at 22:39, Anup Patel wrote:
> On Tue, Feb 3, 2026 at 7:05 PM Thomas Gleixner <tglx@kernel.org> wrote:
>> >  static void imsic_msi_update_msg(struct irq_data *d, struct imsic_vector *vec)
>> >  {
>> >       struct msi_msg msg = { };
>> > +     struct irq_chip *irq_chip = irq_data_get_irq_chip(d);
>> > +
>> > +     if (!irq_chip->irq_write_msi_msg)
>> > +             return;
>>
>> I have no idea how this ever worked. The irq_data pointer belongs to the
>> IMSIC base domain, which definitely does not have a irq_write_msi_msg()
>> callback and never can have one.
>
> The imsic_irq_set_affinity() passes irq_get_irq_data(d->irq) as
> irq_data pointer to imsic_msi_update_msg() expecting it to be
> the top-level irq_data. The imsic_msi_update_msg() assumes
> that the top-level irq_data always has irq_write_msi_msg() but if
> this assumption is not correct then we need an if-check over here.

Indeed. I misread that part and yes, you can assume that the top level
domain has a write MSI callback because that's what this MSI parent
domain is about.

We might check for that in the msi lib. See below

Thanks,

        tglx
---        
--- a/drivers/irqchip/irq-msi-lib.c
+++ b/drivers/irqchip/irq-msi-lib.c
@@ -48,6 +48,9 @@ bool msi_lib_init_dev_msi_info(struct de
 		return false;
 	}
 
+	if (WARN__ON_ONCE(!chip->irq_write_msi_msg))
+		return false;
+
 	required_flags = pops->required_flags;
 
 	/* Is the target domain bus token supported? */

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2026-02-03 18:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03  8:02 [PATCH] irqchip/riscv-imsic: Fix irq migration failure issue when cpu hotplug Yingjun Ni
2026-02-03 13:35 ` Thomas Gleixner
2026-02-03 17:09   ` Anup Patel
2026-02-03 18:28     ` Thomas Gleixner [this message]
2026-02-03 21:05       ` [PATCH] irqchip/msi-lib: Refuse initialization when irq_write_msi_msg() is missing Thomas Gleixner
2026-02-04  1:59   ` [PATCH] irqchip/riscv-imsic: Fix irq migration failure issue when cpu hotplug Yingjun Ni

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=87ldh93cn1.ffs@tglx \
    --to=tglx@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=yingjun.ni@riscv-computing.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