linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] irqchip/genirq/msi: Use irq_domain_alloc_irqs()
@ 2022-12-13 14:08 Johan Hovold
  2022-12-13 14:08 ` [PATCH 1/2] irqchip: " Johan Hovold
  2022-12-13 14:08 ` [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper Johan Hovold
  0 siblings, 2 replies; 7+ messages in thread
From: Johan Hovold @ 2022-12-13 14:08 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Andrew Lunn,
	Gregory Clement, Sebastian Hesselbarth, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	asahi, linux-arm-kernel, linux-kernel, linux-rpi-kernel,
	Johan Hovold

When reworking the irqdomain locking I noticed that we had quite a few
users of the __irq_domain_alloc_irqs() interface which was initially
only intended for some legacy x86 use cases.

This first patch updates the irqchip driver so that the
irq_domain_alloc_irqs() wrapper is instead used consistently.

The second patch adds a matching irq_domain_alloc_irqs_affinity() helper
which can be used when an affinity hint needs to be provided and updates
the sole user.

With this update to gpiolib:

	https://lore.kernel.org/lkml/20221213135227.14398-1-johan+linaro@kernel.org

the only remaining users of the full interface (with preallocated
descriptors) are the two original calls in x86/io_apic and the later
added one for IPI.

Johan


Johan Hovold (2):
  irqchip: Use irq_domain_alloc_irqs()
  genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper

 drivers/irqchip/irq-apple-aic.c     |  5 ++---
 drivers/irqchip/irq-armada-370-xp.c |  4 ++--
 drivers/irqchip/irq-bcm2836.c       |  6 ++----
 drivers/irqchip/irq-gic-v3.c        |  5 ++---
 drivers/irqchip/irq-gic-v4.c        | 10 ++++------
 drivers/irqchip/irq-gic.c           |  5 ++---
 include/linux/irqdomain.h           | 15 +++++++++++++++
 kernel/irq/msi.c                    |  6 +++---
 8 files changed, 32 insertions(+), 24 deletions(-)

-- 
2.37.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] irqchip: Use irq_domain_alloc_irqs()
  2022-12-13 14:08 [PATCH 0/2] irqchip/genirq/msi: Use irq_domain_alloc_irqs() Johan Hovold
@ 2022-12-13 14:08 ` Johan Hovold
  2023-01-11 21:17   ` [tip: irq/core] " tip-bot2 for Johan Hovold
  2022-12-13 14:08 ` [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper Johan Hovold
  1 sibling, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2022-12-13 14:08 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Andrew Lunn,
	Gregory Clement, Sebastian Hesselbarth, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	asahi, linux-arm-kernel, linux-kernel, linux-rpi-kernel,
	Johan Hovold

Use the irq_domain_alloc_irqs() wrapper instead of the full
__irq_domain_alloc_irqs() interface, which was only intended for some
legacy (x86) use cases.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/irqchip/irq-apple-aic.c     |  5 ++---
 drivers/irqchip/irq-armada-370-xp.c |  4 ++--
 drivers/irqchip/irq-bcm2836.c       |  6 ++----
 drivers/irqchip/irq-gic-v3.c        |  5 ++---
 drivers/irqchip/irq-gic-v4.c        | 10 ++++------
 drivers/irqchip/irq-gic.c           |  5 ++---
 6 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c
index ae3437f03e6c..848ccef03c92 100644
--- a/drivers/irqchip/irq-apple-aic.c
+++ b/drivers/irqchip/irq-apple-aic.c
@@ -924,9 +924,8 @@ static int __init aic_init_smp(struct aic_irq_chip *irqc, struct device_node *no
 	ipi_domain->flags |= IRQ_DOMAIN_FLAG_IPI_SINGLE;
 	irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI);
 
-	base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, AIC_NR_SWIPI,
-					   NUMA_NO_NODE, NULL, false, NULL);
-
+	base_ipi = irq_domain_alloc_irqs(ipi_domain, AIC_NR_SWIPI, NUMA_NO_NODE,
+					 NULL);
 	if (WARN_ON(!base_ipi)) {
 		irq_domain_remove(ipi_domain);
 		return -ENODEV;
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index ee18eb3e72b7..c6f8f5b07ec0 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -454,8 +454,8 @@ static __init void armada_xp_ipi_init(struct device_node *node)
 		return;
 
 	irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI);
-	base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, IPI_DOORBELL_END,
-					   NUMA_NO_NODE, NULL, false, NULL);
+	base_ipi = irq_domain_alloc_irqs(ipi_domain, IPI_DOORBELL_END,
+					 NUMA_NO_NODE, NULL);
 	if (WARN_ON(!base_ipi))
 		return;
 
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
index 51491c3c6fdd..0f49246af16e 100644
--- a/drivers/irqchip/irq-bcm2836.c
+++ b/drivers/irqchip/irq-bcm2836.c
@@ -268,10 +268,8 @@ static void __init bcm2836_arm_irqchip_smp_init(void)
 	ipi_domain->flags |= IRQ_DOMAIN_FLAG_IPI_SINGLE;
 	irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI);
 
-	base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, BITS_PER_MBOX,
-					   NUMA_NO_NODE, NULL,
-					   false, NULL);
-
+	base_ipi = irq_domain_alloc_irqs(ipi_domain, BITS_PER_MBOX,
+					 NUMA_NO_NODE, NULL);
 	if (WARN_ON(!base_ipi))
 		return;
 
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 997104d4338e..7acf501c9a10 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -1310,9 +1310,8 @@ static void __init gic_smp_init(void)
 				  gic_starting_cpu, NULL);
 
 	/* Register all 8 non-secure SGIs */
-	base_sgi = __irq_domain_alloc_irqs(gic_data.domain, -1, 8,
-					   NUMA_NO_NODE, &sgi_fwspec,
-					   false, NULL);
+	base_sgi = irq_domain_alloc_irqs(gic_data.domain, 8, NUMA_NO_NODE,
+					 &sgi_fwspec);
 	if (WARN_ON(base_sgi <= 0))
 		return;
 
diff --git a/drivers/irqchip/irq-gic-v4.c b/drivers/irqchip/irq-gic-v4.c
index a6277dea4c7a..7635707c37e5 100644
--- a/drivers/irqchip/irq-gic-v4.c
+++ b/drivers/irqchip/irq-gic-v4.c
@@ -139,9 +139,8 @@ static int its_alloc_vcpu_sgis(struct its_vpe *vpe, int idx)
 	if (!vpe->sgi_domain)
 		goto err;
 
-	sgi_base = __irq_domain_alloc_irqs(vpe->sgi_domain, -1, 16,
-					       NUMA_NO_NODE, vpe,
-					       false, NULL);
+	sgi_base = irq_domain_alloc_irqs(vpe->sgi_domain, 16, NUMA_NO_NODE,
+					 vpe);
 	if (sgi_base <= 0)
 		goto err;
 
@@ -176,9 +175,8 @@ int its_alloc_vcpu_irqs(struct its_vm *vm)
 		vm->vpes[i]->idai = true;
 	}
 
-	vpe_base_irq = __irq_domain_alloc_irqs(vm->domain, -1, vm->nr_vpes,
-					       NUMA_NO_NODE, vm,
-					       false, NULL);
+	vpe_base_irq = irq_domain_alloc_irqs(vm->domain, vm->nr_vpes,
+					     NUMA_NO_NODE, vm);
 	if (vpe_base_irq <= 0)
 		goto err;
 
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 210bc2f4d555..c87021f037c9 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -868,9 +868,8 @@ static __init void gic_smp_init(void)
 				  "irqchip/arm/gic:starting",
 				  gic_starting_cpu, NULL);
 
-	base_sgi = __irq_domain_alloc_irqs(gic_data[0].domain, -1, 8,
-					   NUMA_NO_NODE, &sgi_fwspec,
-					   false, NULL);
+	base_sgi = irq_domain_alloc_irqs(gic_data[0].domain, 8, NUMA_NO_NODE,
+					 &sgi_fwspec);
 	if (WARN_ON(base_sgi <= 0))
 		return;
 
-- 
2.37.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper
  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
  2023-01-11 18:52   ` Thomas Gleixner
  1 sibling, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2022-12-13 14:08 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Andrew Lunn,
	Gregory Clement, Sebastian Hesselbarth, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	asahi, linux-arm-kernel, linux-kernel, linux-rpi-kernel,
	Johan Hovold

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper
  2022-12-13 14:08 ` [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper Johan Hovold
@ 2023-01-11 18:52   ` Thomas Gleixner
  2023-01-12 13:24     ` Johan Hovold
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2023-01-11 18:52 UTC (permalink / raw)
  To: Johan Hovold, Marc Zyngier
  Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Andrew Lunn,
	Gregory Clement, Sebastian Hesselbarth, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	asahi, linux-arm-kernel, linux-kernel, linux-rpi-kernel,
	Johan Hovold

On Tue, Dec 13 2022 at 15:08, Johan Hovold wrote:
> 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.

I definitely like the irqchip cleanup, but this one is core code and
having the extra wrapper is not really buying us much.

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip: irq/core] irqchip: Use irq_domain_alloc_irqs()
  2022-12-13 14:08 ` [PATCH 1/2] irqchip: " Johan Hovold
@ 2023-01-11 21:17   ` tip-bot2 for Johan Hovold
  0 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Johan Hovold @ 2023-01-11 21:17 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Johan Hovold, Thomas Gleixner, x86, linux-kernel, maz

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     0e2213fe0ab4c04da0e2354e84ec3b90e59939a4
Gitweb:        https://git.kernel.org/tip/0e2213fe0ab4c04da0e2354e84ec3b90e59939a4
Author:        Johan Hovold <johan+linaro@kernel.org>
AuthorDate:    Tue, 13 Dec 2022 15:08:43 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 11 Jan 2023 19:51:39 +01:00

irqchip: Use irq_domain_alloc_irqs()

Use the irq_domain_alloc_irqs() wrapper instead of the full
__irq_domain_alloc_irqs() interface, which was only intended for some
legacy (x86) use cases.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20221213140844.15470-2-johan+linaro@kernel.org

---
 drivers/irqchip/irq-apple-aic.c     |  4 +---
 drivers/irqchip/irq-armada-370-xp.c |  3 +--
 drivers/irqchip/irq-bcm2836.c       |  5 +----
 drivers/irqchip/irq-gic-v3.c        |  4 +---
 drivers/irqchip/irq-gic-v4.c        |  9 +++------
 drivers/irqchip/irq-gic.c           |  4 +---
 6 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c
index ae3437f..cf513b6 100644
--- a/drivers/irqchip/irq-apple-aic.c
+++ b/drivers/irqchip/irq-apple-aic.c
@@ -924,9 +924,7 @@ static int __init aic_init_smp(struct aic_irq_chip *irqc, struct device_node *no
 	ipi_domain->flags |= IRQ_DOMAIN_FLAG_IPI_SINGLE;
 	irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI);
 
-	base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, AIC_NR_SWIPI,
-					   NUMA_NO_NODE, NULL, false, NULL);
-
+	base_ipi = irq_domain_alloc_irqs(ipi_domain, AIC_NR_SWIPI, NUMA_NO_NODE, NULL);
 	if (WARN_ON(!base_ipi)) {
 		irq_domain_remove(ipi_domain);
 		return -ENODEV;
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index ee18eb3..a555284 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -454,8 +454,7 @@ static __init void armada_xp_ipi_init(struct device_node *node)
 		return;
 
 	irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI);
-	base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, IPI_DOORBELL_END,
-					   NUMA_NO_NODE, NULL, false, NULL);
+	base_ipi = irq_domain_alloc_irqs(ipi_domain, IPI_DOORBELL_END, NUMA_NO_NODE, NULL);
 	if (WARN_ON(!base_ipi))
 		return;
 
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
index 51491c3..e5f1059 100644
--- a/drivers/irqchip/irq-bcm2836.c
+++ b/drivers/irqchip/irq-bcm2836.c
@@ -268,10 +268,7 @@ static void __init bcm2836_arm_irqchip_smp_init(void)
 	ipi_domain->flags |= IRQ_DOMAIN_FLAG_IPI_SINGLE;
 	irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI);
 
-	base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, BITS_PER_MBOX,
-					   NUMA_NO_NODE, NULL,
-					   false, NULL);
-
+	base_ipi = irq_domain_alloc_irqs(ipi_domain, BITS_PER_MBOX, NUMA_NO_NODE, NULL);
 	if (WARN_ON(!base_ipi))
 		return;
 
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 997104d..bb57ab8 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -1310,9 +1310,7 @@ static void __init gic_smp_init(void)
 				  gic_starting_cpu, NULL);
 
 	/* Register all 8 non-secure SGIs */
-	base_sgi = __irq_domain_alloc_irqs(gic_data.domain, -1, 8,
-					   NUMA_NO_NODE, &sgi_fwspec,
-					   false, NULL);
+	base_sgi = irq_domain_alloc_irqs(gic_data.domain, 8, NUMA_NO_NODE, &sgi_fwspec);
 	if (WARN_ON(base_sgi <= 0))
 		return;
 
diff --git a/drivers/irqchip/irq-gic-v4.c b/drivers/irqchip/irq-gic-v4.c
index a6277de..94d56a0 100644
--- a/drivers/irqchip/irq-gic-v4.c
+++ b/drivers/irqchip/irq-gic-v4.c
@@ -139,9 +139,7 @@ static int its_alloc_vcpu_sgis(struct its_vpe *vpe, int idx)
 	if (!vpe->sgi_domain)
 		goto err;
 
-	sgi_base = __irq_domain_alloc_irqs(vpe->sgi_domain, -1, 16,
-					       NUMA_NO_NODE, vpe,
-					       false, NULL);
+	sgi_base = irq_domain_alloc_irqs(vpe->sgi_domain, 16, NUMA_NO_NODE, vpe);
 	if (sgi_base <= 0)
 		goto err;
 
@@ -176,9 +174,8 @@ int its_alloc_vcpu_irqs(struct its_vm *vm)
 		vm->vpes[i]->idai = true;
 	}
 
-	vpe_base_irq = __irq_domain_alloc_irqs(vm->domain, -1, vm->nr_vpes,
-					       NUMA_NO_NODE, vm,
-					       false, NULL);
+	vpe_base_irq = irq_domain_alloc_irqs(vm->domain, vm->nr_vpes,
+					     NUMA_NO_NODE, vm);
 	if (vpe_base_irq <= 0)
 		goto err;
 
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 210bc2f..4fa4d8a 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -868,9 +868,7 @@ static __init void gic_smp_init(void)
 				  "irqchip/arm/gic:starting",
 				  gic_starting_cpu, NULL);
 
-	base_sgi = __irq_domain_alloc_irqs(gic_data[0].domain, -1, 8,
-					   NUMA_NO_NODE, &sgi_fwspec,
-					   false, NULL);
+	base_sgi = irq_domain_alloc_irqs(gic_data[0].domain, 8, NUMA_NO_NODE, &sgi_fwspec);
 	if (WARN_ON(base_sgi <= 0))
 		return;
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper
  2023-01-11 18:52   ` Thomas Gleixner
@ 2023-01-12 13:24     ` Johan Hovold
  2023-01-12 13:34       ` Johan Hovold
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2023-01-12 13:24 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Johan Hovold, Marc Zyngier, Hector Martin, Sven Peter,
	Alyssa Rosenzweig, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	asahi, linux-arm-kernel, linux-kernel, linux-rpi-kernel

On Wed, Jan 11, 2023 at 07:52:42PM +0100, Thomas Gleixner wrote:
> On Tue, Dec 13 2022 at 15:08, Johan Hovold wrote:
> > 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.
> 
> I definitely like the irqchip cleanup, but this one is core code and
> having the extra wrapper is not really buying us much.

Fair enough. If you don't expect there to be any further users then
perhaps it's not worth it even if it arguably makes the call site a bit
more readable (e.g. by dropping the base and realloc arguments).

Johan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper
  2023-01-12 13:24     ` Johan Hovold
@ 2023-01-12 13:34       ` Johan Hovold
  0 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2023-01-12 13:34 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Johan Hovold, Marc Zyngier, Hector Martin, Sven Peter,
	Alyssa Rosenzweig, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	asahi, linux-arm-kernel, linux-kernel, linux-rpi-kernel

On Thu, Jan 12, 2023 at 02:24:58PM +0100, Johan Hovold wrote:
> On Wed, Jan 11, 2023 at 07:52:42PM +0100, Thomas Gleixner wrote:
> > On Tue, Dec 13 2022 at 15:08, Johan Hovold wrote:
> > > 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.
> > 
> > I definitely like the irqchip cleanup, but this one is core code and
> > having the extra wrapper is not really buying us much.
> 
> Fair enough. If you don't expect there to be any further users then
> perhaps it's not worth it even if it arguably makes the call site a bit
> more readable (e.g. by dropping the base and realloc arguments).

And having this wrapper would also limit the use of the full (internal)
helper to places that actually need the realloc parameter (e.g. making
those stand out more).

Johan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-12 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2023-01-11 21:17   ` [tip: irq/core] " tip-bot2 for Johan Hovold
2022-12-13 14:08 ` [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper Johan Hovold
2023-01-11 18:52   ` Thomas Gleixner
2023-01-12 13:24     ` Johan Hovold
2023-01-12 13:34       ` Johan Hovold

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).