diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2016-02-19 10:00:29 -0500 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2016-02-19 10:42:29 -0500 |
commit | 0407daceedfed003eaacb850d06cbbe359348367 (patch) | |
tree | c47fc329b56a23ce8d329c53357016359bc1e550 | |
parent | c27f29bbbf02168c9b1e8ba0fe7a8cb917e5a50f (diff) |
irqchip/gic: Return IRQ_SET_MASK_OK_DONE in the set_affinity method
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>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1455894029-17270-1-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r-- | drivers/irqchip/irq-gic-v2m.c | 14 | ||||
-rw-r--r-- | drivers/irqchip/irq-gic.c | 2 | ||||
-rw-r--r-- | 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 c779f83e511d..28f047c61baa 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 = { | |||
92 | .chip = &gicv2m_msi_irq_chip, | 92 | .chip = &gicv2m_msi_irq_chip, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static int gicv2m_set_affinity(struct irq_data *irq_data, | ||
96 | const struct cpumask *mask, bool force) | ||
97 | { | ||
98 | int ret; | ||
99 | |||
100 | ret = irq_chip_set_affinity_parent(irq_data, mask, force); | ||
101 | if (ret == IRQ_SET_MASK_OK) | ||
102 | ret = IRQ_SET_MASK_OK_DONE; | ||
103 | |||
104 | return ret; | ||
105 | } | ||
106 | |||
107 | static void gicv2m_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) | 95 | static void gicv2m_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) |
108 | { | 96 | { |
109 | struct v2m_data *v2m = irq_data_get_irq_chip_data(data); | 97 | struct v2m_data *v2m = irq_data_get_irq_chip_data(data); |
@@ -122,7 +110,7 @@ static struct irq_chip gicv2m_irq_chip = { | |||
122 | .irq_mask = irq_chip_mask_parent, | 110 | .irq_mask = irq_chip_mask_parent, |
123 | .irq_unmask = irq_chip_unmask_parent, | 111 | .irq_unmask = irq_chip_unmask_parent, |
124 | .irq_eoi = irq_chip_eoi_parent, | 112 | .irq_eoi = irq_chip_eoi_parent, |
125 | .irq_set_affinity = gicv2m_set_affinity, | 113 | .irq_set_affinity = irq_chip_set_affinity_parent, |
126 | .irq_compose_msi_msg = gicv2m_compose_msi_msg, | 114 | .irq_compose_msi_msg = gicv2m_compose_msi_msg, |
127 | }; | 115 | }; |
128 | 116 | ||
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 911758c056c1..e14f2f2a7263 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, | |||
319 | writel_relaxed(val | bit, reg); | 319 | writel_relaxed(val | bit, reg); |
320 | raw_spin_unlock_irqrestore(&irq_controller_lock, flags); | 320 | raw_spin_unlock_irqrestore(&irq_controller_lock, flags); |
321 | 321 | ||
322 | return IRQ_SET_MASK_OK; | 322 | return IRQ_SET_MASK_OK_DONE; |
323 | } | 323 | } |
324 | #endif | 324 | #endif |
325 | 325 | ||
diff --git a/drivers/irqchip/irq-mvebu-odmi.c b/drivers/irqchip/irq-mvebu-odmi.c index 0ae98b24836f..b4d367868dbb 100644 --- a/drivers/irqchip/irq-mvebu-odmi.c +++ b/drivers/irqchip/irq-mvebu-odmi.c | |||
@@ -47,18 +47,6 @@ static unsigned int odmis_count; | |||
47 | /* Protects odmis_bm */ | 47 | /* Protects odmis_bm */ |
48 | static DEFINE_SPINLOCK(odmis_bm_lock); | 48 | static DEFINE_SPINLOCK(odmis_bm_lock); |
49 | 49 | ||
50 | static int odmi_set_affinity(struct irq_data *d, | ||
51 | const struct cpumask *mask, bool force) | ||
52 | { | ||
53 | int ret; | ||
54 | |||
55 | ret = irq_chip_set_affinity_parent(d, mask, force); | ||
56 | if (ret == IRQ_SET_MASK_OK) | ||
57 | ret = IRQ_SET_MASK_OK_DONE; | ||
58 | |||
59 | return ret; | ||
60 | } | ||
61 | |||
62 | static void odmi_compose_msi_msg(struct irq_data *d, struct msi_msg *msg) | 50 | static void odmi_compose_msi_msg(struct irq_data *d, struct msi_msg *msg) |
63 | { | 51 | { |
64 | struct odmi_data *odmi; | 52 | struct odmi_data *odmi; |
@@ -83,7 +71,7 @@ static struct irq_chip odmi_irq_chip = { | |||
83 | .irq_mask = irq_chip_mask_parent, | 71 | .irq_mask = irq_chip_mask_parent, |
84 | .irq_unmask = irq_chip_unmask_parent, | 72 | .irq_unmask = irq_chip_unmask_parent, |
85 | .irq_eoi = irq_chip_eoi_parent, | 73 | .irq_eoi = irq_chip_eoi_parent, |
86 | .irq_set_affinity = odmi_set_affinity, | 74 | .irq_set_affinity = irq_chip_set_affinity_parent, |
87 | .irq_compose_msi_msg = odmi_compose_msi_msg, | 75 | .irq_compose_msi_msg = odmi_compose_msi_msg, |
88 | }; | 76 | }; |
89 | 77 | ||