From: Johan Hovold <johan+linaro@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <maz@kernel.org>
Cc: Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>,
Alyssa Rosenzweig <alyssa@rosenzweig.io>,
Andrew Lunn <andrew@lunn.ch>,
Gregory Clement <gregory.clement@bootlin.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper
Date: Tue, 13 Dec 2022 15:08:44 +0100 [thread overview]
Message-ID: <20221213140844.15470-3-johan+linaro@kernel.org> (raw)
In-Reply-To: <20221213140844.15470-1-johan+linaro@kernel.org>
The full __irq_domain_alloc_irqs() interface was initially only intended
for some legacy (x86) use cases while most callers should use the
irq_domain_alloc_irqs() wrapper.
Add a matching irq_domain_alloc_irqs_affinity() wrapper that can be used
when an affinity hint needs to be provided and use it for MSI
allocations.
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
include/linux/irqdomain.h | 15 +++++++++++++++
kernel/irq/msi.c | 6 +++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index cad47737a052..b1b06d75d31a 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -507,6 +507,14 @@ static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
NULL);
}
+static inline int irq_domain_alloc_irqs_affinity(struct irq_domain *domain,
+ unsigned int nr_irqs, int node, void *arg,
+ const struct irq_affinity_desc *affinity)
+{
+ return __irq_domain_alloc_irqs(domain, -1, nr_irqs, node, arg, false,
+ affinity);
+}
+
extern int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain,
unsigned int irq_base,
unsigned int nr_irqs, void *arg);
@@ -585,6 +593,13 @@ static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
return -1;
}
+static inline int irq_domain_alloc_irqs_affinity(struct irq_domain *domain,
+ unsigned int nr_irqs, int node, void *arg,
+ const struct irq_affinity_desc *affinity)
+{
+ return -1;
+}
+
static inline void irq_domain_free_irqs(unsigned int virq,
unsigned int nr_irqs) { }
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index bd4d4dd626b4..01f7f3c8d77a 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -1272,9 +1272,9 @@ static int __msi_domain_alloc_irqs(struct device *dev, struct irq_domain *domain
ops->set_desc(&arg, desc);
- virq = __irq_domain_alloc_irqs(domain, -1, desc->nvec_used,
- dev_to_node(dev), &arg, false,
- desc->affinity);
+ virq = irq_domain_alloc_irqs_affinity(domain, desc->nvec_used,
+ dev_to_node(dev), &arg,
+ desc->affinity);
if (virq < 0)
return msi_handle_pci_fail(domain, desc, allocated);
--
2.37.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-12-13 14:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 14:08 [PATCH 0/2] irqchip/genirq/msi: Use irq_domain_alloc_irqs() Johan Hovold
2022-12-13 14:08 ` [PATCH 1/2] irqchip: " Johan Hovold
2022-12-13 14:08 ` Johan Hovold [this message]
2023-01-11 18:52 ` [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper Thomas Gleixner
2023-01-12 13:24 ` Johan Hovold
2023-01-12 13:34 ` Johan Hovold
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=20221213140844.15470-3-johan+linaro@kernel.org \
--to=johan+linaro@kernel.org \
--cc=alyssa@rosenzweig.io \
--cc=andrew@lunn.ch \
--cc=asahi@lists.linux.dev \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=f.fainelli@gmail.com \
--cc=gregory.clement@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=marcan@marcan.st \
--cc=maz@kernel.org \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=sven@svenpeter.dev \
--cc=tglx@linutronix.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;
as well as URLs for NNTP newsgroup(s).