linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip/gic: Return IRQ_SET_MASK_OK_DONE in the set_affinity method
@ 2016-02-19 15:00 Marc Zyngier
  2016-02-19 15:06 ` Thomas Petazzoni
  2016-02-19 15:59 ` Jason Cooper
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Zyngier @ 2016-02-19 15:00 UTC (permalink / raw)
  To: linux-arm-kernel

Moving an SPI around doesn't require any extra work from the rest
of the stack, and specially not for MSI-generated SPIs.

It is then worth returning IRQ_SET_MASK_OK_DONE instead of
IRQ_SET_MASK_OK, and simplify the other irqchips that rely on
this behaviour (GICv2m and Marvell's ODMI controller).

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/irqchip/irq-gic-v2m.c    | 14 +-------------
 drivers/irqchip/irq-gic.c        |  2 +-
 drivers/irqchip/irq-mvebu-odmi.c | 14 +-------------
 3 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index c779f83..28f047c 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -92,18 +92,6 @@ static struct msi_domain_info gicv2m_msi_domain_info = {
 	.chip	= &gicv2m_msi_irq_chip,
 };
 
-static int gicv2m_set_affinity(struct irq_data *irq_data,
-			       const struct cpumask *mask, bool force)
-{
-	int ret;
-
-	ret = irq_chip_set_affinity_parent(irq_data, mask, force);
-	if (ret == IRQ_SET_MASK_OK)
-		ret = IRQ_SET_MASK_OK_DONE;
-
-	return ret;
-}
-
 static void gicv2m_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
 {
 	struct v2m_data *v2m = irq_data_get_irq_chip_data(data);
@@ -122,7 +110,7 @@ static struct irq_chip gicv2m_irq_chip = {
 	.irq_mask		= irq_chip_mask_parent,
 	.irq_unmask		= irq_chip_unmask_parent,
 	.irq_eoi		= irq_chip_eoi_parent,
-	.irq_set_affinity	= gicv2m_set_affinity,
+	.irq_set_affinity	= irq_chip_set_affinity_parent,
 	.irq_compose_msi_msg	= gicv2m_compose_msi_msg,
 };
 
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 8f9ebf7..282344b 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -319,7 +319,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 	writel_relaxed(val | bit, reg);
 	raw_spin_unlock_irqrestore(&irq_controller_lock, flags);
 
-	return IRQ_SET_MASK_OK;
+	return IRQ_SET_MASK_OK_DONE;
 }
 #endif
 
diff --git a/drivers/irqchip/irq-mvebu-odmi.c b/drivers/irqchip/irq-mvebu-odmi.c
index 0ae98b2..b4d3678 100644
--- a/drivers/irqchip/irq-mvebu-odmi.c
+++ b/drivers/irqchip/irq-mvebu-odmi.c
@@ -47,18 +47,6 @@ static unsigned int odmis_count;
 /* Protects odmis_bm */
 static DEFINE_SPINLOCK(odmis_bm_lock);
 
-static int odmi_set_affinity(struct irq_data *d,
-			     const struct cpumask *mask, bool force)
-{
-	int ret;
-
-	ret = irq_chip_set_affinity_parent(d, mask, force);
-	if (ret == IRQ_SET_MASK_OK)
-		ret = IRQ_SET_MASK_OK_DONE;
-
-	return ret;
-}
-
 static void odmi_compose_msi_msg(struct irq_data *d, struct msi_msg *msg)
 {
 	struct odmi_data *odmi;
@@ -83,7 +71,7 @@ static struct irq_chip odmi_irq_chip = {
 	.irq_mask		= irq_chip_mask_parent,
 	.irq_unmask		= irq_chip_unmask_parent,
 	.irq_eoi		= irq_chip_eoi_parent,
-	.irq_set_affinity	= odmi_set_affinity,
+	.irq_set_affinity	= irq_chip_set_affinity_parent,
 	.irq_compose_msi_msg	= odmi_compose_msi_msg,
 };
 
-- 
2.1.4

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

* [PATCH] irqchip/gic: Return IRQ_SET_MASK_OK_DONE in the set_affinity method
  2016-02-19 15:00 [PATCH] irqchip/gic: Return IRQ_SET_MASK_OK_DONE in the set_affinity method Marc Zyngier
@ 2016-02-19 15:06 ` Thomas Petazzoni
  2016-02-19 15:59 ` Jason Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-02-19 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

Marc,

On Fri, 19 Feb 2016 15:00:29 +0000, Marc Zyngier wrote:
> Moving an SPI around doesn't require any extra work from the rest
> of the stack, and specially not for MSI-generated SPIs.
> 
> It is then worth returning IRQ_SET_MASK_OK_DONE instead of
> IRQ_SET_MASK_OK, and simplify the other irqchips that rely on
> this behaviour (GICv2m and Marvell's ODMI controller).
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  drivers/irqchip/irq-gic-v2m.c    | 14 +-------------
>  drivers/irqchip/irq-gic.c        |  2 +-
>  drivers/irqchip/irq-mvebu-odmi.c | 14 +-------------
>  3 files changed, 3 insertions(+), 27 deletions(-)

For the irq-mvebu-odmi part:

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [PATCH] irqchip/gic: Return IRQ_SET_MASK_OK_DONE in the set_affinity method
  2016-02-19 15:00 [PATCH] irqchip/gic: Return IRQ_SET_MASK_OK_DONE in the set_affinity method Marc Zyngier
  2016-02-19 15:06 ` Thomas Petazzoni
@ 2016-02-19 15:59 ` Jason Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Cooper @ 2016-02-19 15:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 19, 2016 at 03:00:29PM +0000, Marc Zyngier wrote:
> Moving an SPI around doesn't require any extra work from the rest
> of the stack, and specially not for MSI-generated SPIs.
> 
> It is then worth returning IRQ_SET_MASK_OK_DONE instead of
> IRQ_SET_MASK_OK, and simplify the other irqchips that rely on
> this behaviour (GICv2m and Marvell's ODMI controller).
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  drivers/irqchip/irq-gic-v2m.c    | 14 +-------------
>  drivers/irqchip/irq-gic.c        |  2 +-
>  drivers/irqchip/irq-mvebu-odmi.c | 14 +-------------
>  3 files changed, 3 insertions(+), 27 deletions(-)

Applied to irchip/mvebu with Thomas' (P) Acked-by.

thx,

Jason.

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

end of thread, other threads:[~2016-02-19 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19 15:00 [PATCH] irqchip/gic: Return IRQ_SET_MASK_OK_DONE in the set_affinity method Marc Zyngier
2016-02-19 15:06 ` Thomas Petazzoni
2016-02-19 15:59 ` Jason Cooper

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