diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2014-12-12 05:51:23 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-12-13 07:41:06 -0500 |
commit | aca268df8a576ad11ce5ecd55d1eabe00c69e3c6 (patch) | |
tree | caffe48fdb8d8ab3876f470108ddbf1ad310bc4c /drivers/irqchip | |
parent | 2da399495fdbd147fa8c4c849fdcc01dad887f70 (diff) |
irqchip: gicv3-its: Move some alloc/free code to activate/deactivate
The ITS code could do a bit less in the alloc/free paths, and a bit
more in the activate/deactivate methods, giving a better separation
between software allocation and HW programing.
Suggested-by: Wuyun Wu (Abel) <wuyun.wu@huawei.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Yun Wu (Abel) <wuyun.wu@huawei.com>
Cc: Robert Richter <robert.richter@caviumnetworks.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r-- | drivers/irqchip/irq-gic-v3-its.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index ab0185225857..98144fde1df0 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c | |||
@@ -1102,9 +1102,6 @@ static int its_alloc_device_irq(struct its_device *dev, irq_hw_number_t *hwirq) | |||
1102 | *hwirq = dev->lpi_base + idx; | 1102 | *hwirq = dev->lpi_base + idx; |
1103 | set_bit(idx, dev->lpi_map); | 1103 | set_bit(idx, dev->lpi_map); |
1104 | 1104 | ||
1105 | /* Map the GIC irq ID to the device */ | ||
1106 | its_send_mapvi(dev, *hwirq, idx); | ||
1107 | |||
1108 | return 0; | 1105 | return 0; |
1109 | } | 1106 | } |
1110 | 1107 | ||
@@ -1191,6 +1188,26 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, | |||
1191 | return 0; | 1188 | return 0; |
1192 | } | 1189 | } |
1193 | 1190 | ||
1191 | static void its_irq_domain_activate(struct irq_domain *domain, | ||
1192 | struct irq_data *d) | ||
1193 | { | ||
1194 | struct its_device *its_dev = irq_data_get_irq_chip_data(d); | ||
1195 | u32 event = its_get_event_id(d); | ||
1196 | |||
1197 | /* Map the GIC IRQ and event to the device */ | ||
1198 | its_send_mapvi(its_dev, d->hwirq, event); | ||
1199 | } | ||
1200 | |||
1201 | static void its_irq_domain_deactivate(struct irq_domain *domain, | ||
1202 | struct irq_data *d) | ||
1203 | { | ||
1204 | struct its_device *its_dev = irq_data_get_irq_chip_data(d); | ||
1205 | u32 event = its_get_event_id(d); | ||
1206 | |||
1207 | /* Stop the delivery of interrupts */ | ||
1208 | its_send_discard(its_dev, event); | ||
1209 | } | ||
1210 | |||
1194 | static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, | 1211 | static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, |
1195 | unsigned int nr_irqs) | 1212 | unsigned int nr_irqs) |
1196 | { | 1213 | { |
@@ -1201,10 +1218,7 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, | |||
1201 | for (i = 0; i < nr_irqs; i++) { | 1218 | for (i = 0; i < nr_irqs; i++) { |
1202 | struct irq_data *data = irq_domain_get_irq_data(domain, | 1219 | struct irq_data *data = irq_domain_get_irq_data(domain, |
1203 | virq + i); | 1220 | virq + i); |
1204 | int event = its_get_event_id(data); | 1221 | u32 event = its_get_event_id(data); |
1205 | |||
1206 | /* Stop the delivery of interrupts */ | ||
1207 | its_send_discard(its_dev, event); | ||
1208 | 1222 | ||
1209 | /* Mark interrupt index as unused */ | 1223 | /* Mark interrupt index as unused */ |
1210 | clear_bit(event, its_dev->lpi_map); | 1224 | clear_bit(event, its_dev->lpi_map); |
@@ -1230,6 +1244,8 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, | |||
1230 | static const struct irq_domain_ops its_domain_ops = { | 1244 | static const struct irq_domain_ops its_domain_ops = { |
1231 | .alloc = its_irq_domain_alloc, | 1245 | .alloc = its_irq_domain_alloc, |
1232 | .free = its_irq_domain_free, | 1246 | .free = its_irq_domain_free, |
1247 | .activate = its_irq_domain_activate, | ||
1248 | .deactivate = its_irq_domain_deactivate, | ||
1233 | }; | 1249 | }; |
1234 | 1250 | ||
1235 | static int its_probe(struct device_node *node, struct irq_domain *parent) | 1251 | static int its_probe(struct device_node *node, struct irq_domain *parent) |