public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guixin Liu <kanie@linux.alibaba.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Marc Zyngier <maz@kernel.org>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Inochi Amaoto <inochiama@gmail.com>,
	Nam Cao <namcao@linutronix.de>,
	Shradha Gupta <shradhagupta@linux.microsoft.com>,
	Randy Dunlap <rdunlap@infradead.org>
Cc: Xunlei Pang <xlpang@linux.alibaba.com>,
	oliver.yang@linux.alibaba.com, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: [PATCH 1/2] genirq/msi: Introduce update hwsize helper
Date: Tue, 24 Mar 2026 09:47:53 +0800	[thread overview]
Message-ID: <20260324014754.4973-2-kanie@linux.alibaba.com> (raw)
In-Reply-To: <20260324014754.4973-1-kanie@linux.alibaba.com>

Introduce msi_domain_update_hwsize() helper for updating hwsize.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Guanghui Feng <guanghuifeng@linux.alibaba.com>
---
 include/linux/msi.h |  3 +++
 kernel/irq/msi.c    | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/include/linux/msi.h b/include/linux/msi.h
index fa41eed62868..6de938ba2245 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -647,6 +647,9 @@ bool msi_create_device_irq_domain(struct device *dev, unsigned int domid,
 				  void *chip_data);
 void msi_remove_device_irq_domain(struct device *dev, unsigned int domid);
 
+int msi_domain_update_hwsize(struct device *dev, unsigned int domid,
+			     unsigned int hwsize_new);
+
 bool msi_match_device_irq_domain(struct device *dev, unsigned int domid,
 				 enum irq_domain_bus_token bus_token);
 
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 3cafa40e6ce3..162e7263ef7f 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -1133,6 +1133,28 @@ void msi_remove_device_irq_domain(struct device *dev, unsigned int domid)
 	kfree(container_of(info, struct msi_domain_template, info));
 }
 
+int msi_domain_update_hwsize(struct device *dev, unsigned int domid,
+			     unsigned int hwsize_new)
+{
+	struct msi_domain_info *info;
+	struct irq_domain *domain;
+
+	if (hwsize_new > MSI_XA_DOMAIN_SIZE)
+		return -EINVAL;
+	if (!hwsize_new)
+		hwsize_new = MSI_XA_DOMAIN_SIZE;
+
+	domain = msi_get_device_domain(dev, domid);
+	if (!domain)
+		return -ENODEV;
+
+	info = domain->host_data;
+	if (hwsize_new != info->hwsize)
+		info->hwsize = hwsize_new;
+
+	return 0;
+}
+
 /**
  * msi_match_device_irq_domain - Match a device irq domain against a bus token
  * @dev:	Pointer to the device
-- 
2.32.0.3.g01195cf9f


  reply	other threads:[~2026-03-24  1:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  1:47 [PATCH 0/2] Update MSI-X irq domain hwsize Guixin Liu
2026-03-24  1:47 ` Guixin Liu [this message]
2026-03-25  8:15   ` [PATCH 1/2] genirq/msi: Introduce update hwsize helper Thomas Gleixner
2026-03-25  8:49     ` Guixin Liu
2026-03-24  1:47 ` [PATCH 2/2] PCI/MSI: Update MSI-X irq domain hwsize Guixin Liu
2026-03-24 13:59   ` Thomas Gleixner
2026-03-25  1:34     ` Guixin Liu
2026-03-25  7:42       ` Thomas Gleixner
2026-03-25  8:40         ` Guixin Liu
2026-03-25 13:58           ` Thomas Gleixner
2026-03-26  1:55             ` Guixin Liu

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=20260324014754.4973-2-kanie@linux.alibaba.com \
    --to=kanie@linux.alibaba.com \
    --cc=bhelgaas@google.com \
    --cc=inochiama@gmail.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=maz@kernel.org \
    --cc=namcao@linutronix.de \
    --cc=oliver.yang@linux.alibaba.com \
    --cc=rdunlap@infradead.org \
    --cc=shradhagupta@linux.microsoft.com \
    --cc=tglx@kernel.org \
    --cc=xlpang@linux.alibaba.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