From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4BA2364026 for ; Tue, 3 Feb 2026 18:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770143302; cv=none; b=ZCKc1GuCstm0wda39ZAK0eifhQ0+oLqEkfmq5otqPeYQ3pR/cgu5Sy9cqOEtZy7/+QIFJMYIcynwE34wf2S96Gs9EZA41U2/Z0XCEx82HWs/j8nxfxu7iNbk1oJm849GDPobpfOAWfq9pGLyL0IQgAFcIgD5rEZ679Lv5XIWcZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770143302; c=relaxed/simple; bh=IpK3bdfagj+tzAgiMbLE1YNpk2IdlComlUbdTFWpyTQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=EWTpMK1fL68odpEisO/FL0ljjlQrIcfJxO5++KQ86f9BUaGE8yMYQd+3IrFkEbgNOXjNblWKOKfR75iyHMHn1+cYbhYNfuQRI0opIqzSXC/038f3JfAkDIwvWyxVdWHEu42Zpp0nwqHx0RlbWmA5HEV1QS0GFwvxMsnvZK8Cihc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oCRmjjKL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oCRmjjKL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86390C116D0; Tue, 3 Feb 2026 18:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770143302; bh=IpK3bdfagj+tzAgiMbLE1YNpk2IdlComlUbdTFWpyTQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=oCRmjjKLdK7dbIBoYO5zDPWZdHVkealFfIMxQNBhE8BM6WZl4ZS8y9Eh2CiEuHo6v msA5CmmeF02GgRI35c/WCVYR8leY5AdPi7oK5qOgFYS4y7lmTByLgOYxlIFu5MUrnT dwt7kk6vg6tDmdnxJB1Qm+JR1epcEbwnKhQrsFdahXiSeWz++j+Kv1YlCHkp16pCea sq5z54Nr3QjmcqG5jMfROsQFvXYezKQE2MbfXoQcsQ5TPA/3jJhKMpMaBXAGrW7XpP p8kxoJTLu4Vi1MGxo3BKtOrx73g8AkoRXWU4Z94YF83SNL04XmgxLOVDY6iakMPdsa 0Zwo1+U4h0pAA== From: Thomas Gleixner To: Anup Patel Cc: Yingjun Ni , 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. In-Reply-To: References: <20260203080256.9401-2-yingjun.ni@riscv-computing.com> <87ecn23q6e.ffs@tglx> Date: Tue, 03 Feb 2026 19:28:18 +0100 Message-ID: <87ldh93cn1.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, Feb 03 2026 at 22:39, Anup Patel wrote: > On Tue, Feb 3, 2026 at 7:05=E2=80=AFPM Thomas Gleixner = wrote: >> > static void imsic_msi_update_msg(struct irq_data *d, struct imsic_vec= tor *vec) >> > { >> > struct msi_msg msg =3D { }; >> > + struct irq_chip *irq_chip =3D 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 ---=20=20=20=20=20=20=20=20 --- 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; } =20 + if (WARN__ON_ONCE(!chip->irq_write_msi_msg)) + return false; + required_flags =3D pops->required_flags; =20 /* Is the target domain bus token supported? */