diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-05 15:08:54 -0500 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-03-03 12:00:29 -0500 |
| commit | c9e265e030537167c94cbed190826f02e3887f4d (patch) | |
| tree | 232450d4fb3c5d540ca701362d9127b05ea19518 | |
| parent | 149f256f8ca690c28dd8aa9fb8bcdaf2e93b1e1c (diff) | |
xen: Switch to new irq_chip functions
Convert Xen to the new irq_chip functions. Brings us closer to enable
CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| -rw-r--r-- | drivers/xen/events.c | 95 |
1 files changed, 51 insertions, 44 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index c8826b5142c..cf1712fb1c4 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
| @@ -277,7 +277,7 @@ static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu) | |||
| 277 | 277 | ||
| 278 | BUG_ON(irq == -1); | 278 | BUG_ON(irq == -1); |
| 279 | #ifdef CONFIG_SMP | 279 | #ifdef CONFIG_SMP |
| 280 | cpumask_copy(irq_to_desc(irq)->affinity, cpumask_of(cpu)); | 280 | cpumask_copy(irq_to_desc(irq)->irq_data.affinity, cpumask_of(cpu)); |
| 281 | #endif | 281 | #endif |
| 282 | 282 | ||
| 283 | clear_bit(chn, cpu_evtchn_mask(cpu_from_irq(irq))); | 283 | clear_bit(chn, cpu_evtchn_mask(cpu_from_irq(irq))); |
| @@ -294,7 +294,7 @@ static void init_evtchn_cpu_bindings(void) | |||
| 294 | 294 | ||
| 295 | /* By default all event channels notify CPU#0. */ | 295 | /* By default all event channels notify CPU#0. */ |
| 296 | for_each_irq_desc(i, desc) { | 296 | for_each_irq_desc(i, desc) { |
| 297 | cpumask_copy(desc->affinity, cpumask_of(0)); | 297 | cpumask_copy(desc->irq_data.affinity, cpumask_of(0)); |
| 298 | } | 298 | } |
| 299 | #endif | 299 | #endif |
| 300 | 300 | ||
| @@ -474,7 +474,7 @@ static bool probing_irq(int irq) | |||
| 474 | return desc && desc->action == NULL; | 474 | return desc && desc->action == NULL; |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | static unsigned int startup_pirq(unsigned int irq) | 477 | static unsigned int __startup_pirq(unsigned int irq) |
| 478 | { | 478 | { |
| 479 | struct evtchn_bind_pirq bind_pirq; | 479 | struct evtchn_bind_pirq bind_pirq; |
| 480 | struct irq_info *info = info_for_irq(irq); | 480 | struct irq_info *info = info_for_irq(irq); |
| @@ -512,9 +512,15 @@ out: | |||
| 512 | return 0; | 512 | return 0; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | static void shutdown_pirq(unsigned int irq) | 515 | static unsigned int startup_pirq(struct irq_data *data) |
| 516 | { | ||
| 517 | return __startup_pirq(data->irq); | ||
| 518 | } | ||
| 519 | |||
| 520 | static void shutdown_pirq(struct irq_data *data) | ||
| 516 | { | 521 | { |
| 517 | struct evtchn_close close; | 522 | struct evtchn_close close; |
| 523 | unsigned int irq = data->irq; | ||
| 518 | struct irq_info *info = info_for_irq(irq); | 524 | struct irq_info *info = info_for_irq(irq); |
| 519 | int evtchn = evtchn_from_irq(irq); | 525 | int evtchn = evtchn_from_irq(irq); |
| 520 | 526 | ||
| @@ -534,20 +540,20 @@ static void shutdown_pirq(unsigned int irq) | |||
| 534 | info->evtchn = 0; | 540 | info->evtchn = 0; |
| 535 | } | 541 | } |
| 536 | 542 | ||
| 537 | static void enable_pirq(unsigned int irq) | 543 | static void enable_pirq(struct irq_data *data) |
| 538 | { | 544 | { |
| 539 | startup_pirq(irq); | 545 | startup_pirq(data); |
| 540 | } | 546 | } |
| 541 | 547 | ||
| 542 | static void disable_pirq(unsigned int irq) | 548 | static void disable_pirq(struct irq_data *data) |
| 543 | { | 549 | { |
| 544 | } | 550 | } |
| 545 | 551 | ||
| 546 | static void ack_pirq(unsigned int irq) | 552 | static void ack_pirq(struct irq_data *data) |
| 547 | { | 553 | { |
| 548 | int evtchn = evtchn_from_irq(irq); | 554 | int evtchn = evtchn_from_irq(data->irq); |
| 549 | 555 | ||
| 550 | move_native_irq(irq); | 556 | irq_move_irq(data); |
| 551 | 557 | ||
| 552 | if (VALID_EVTCHN(evtchn)) { | 558 | if (VALID_EVTCHN(evtchn)) { |
| 553 | mask_evtchn(evtchn); | 559 | mask_evtchn(evtchn); |
| @@ -1215,11 +1221,12 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) | |||
| 1215 | return 0; | 1221 | return 0; |
| 1216 | } | 1222 | } |
| 1217 | 1223 | ||
| 1218 | static int set_affinity_irq(unsigned irq, const struct cpumask *dest) | 1224 | static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest, |
| 1225 | bool force) | ||
| 1219 | { | 1226 | { |
| 1220 | unsigned tcpu = cpumask_first(dest); | 1227 | unsigned tcpu = cpumask_first(dest); |
| 1221 | 1228 | ||
| 1222 | return rebind_irq_to_cpu(irq, tcpu); | 1229 | return rebind_irq_to_cpu(data->irq, tcpu); |
| 1223 | } | 1230 | } |
| 1224 | 1231 | ||
| 1225 | int resend_irq_on_evtchn(unsigned int irq) | 1232 | int resend_irq_on_evtchn(unsigned int irq) |
| @@ -1238,35 +1245,35 @@ int resend_irq_on_evtchn(unsigned int irq) | |||
| 1238 | return 1; | 1245 | return 1; |
| 1239 | } | 1246 | } |
| 1240 | 1247 | ||
| 1241 | static void enable_dynirq(unsigned int irq) | 1248 | static void enable_dynirq(struct irq_data *data) |
| 1242 | { | 1249 | { |
| 1243 | int evtchn = evtchn_from_irq(irq); | 1250 | int evtchn = evtchn_from_irq(data->irq); |
| 1244 | 1251 | ||
| 1245 | if (VALID_EVTCHN(evtchn)) | 1252 | if (VALID_EVTCHN(evtchn)) |
| 1246 | unmask_evtchn(evtchn); | 1253 | unmask_evtchn(evtchn); |
| 1247 | } | 1254 | } |
| 1248 | 1255 | ||
| 1249 | static void disable_dynirq(unsigned int irq) | 1256 | static void disable_dynirq(struct irq_data *data) |
| 1250 | { | 1257 | { |
| 1251 | int evtchn = evtchn_from_irq(irq); | 1258 | int evtchn = evtchn_from_irq(data->irq); |
| 1252 | 1259 | ||
| 1253 | if (VALID_EVTCHN(evtchn)) | 1260 | if (VALID_EVTCHN(evtchn)) |
| 1254 | mask_evtchn(evtchn); | 1261 | mask_evtchn(evtchn); |
| 1255 | } | 1262 | } |
| 1256 | 1263 | ||
| 1257 | static void ack_dynirq(unsigned int irq) | 1264 | static void ack_dynirq(struct irq_data *data) |
| 1258 | { | 1265 | { |
| 1259 | int evtchn = evtchn_from_irq(irq); | 1266 | int evtchn = evtchn_from_irq(data->irq); |
| 1260 | 1267 | ||
| 1261 | move_masked_irq(irq); | 1268 | move_masked_irq(data->irq); |
| 1262 | 1269 | ||
| 1263 | if (VALID_EVTCHN(evtchn)) | 1270 | if (VALID_EVTCHN(evtchn)) |
| 1264 | unmask_evtchn(evtchn); | 1271 | unmask_evtchn(evtchn); |
| 1265 | } | 1272 | } |
| 1266 | 1273 | ||
| 1267 | static int retrigger_dynirq(unsigned int irq) | 1274 | static int retrigger_dynirq(struct irq_data *data) |
| 1268 | { | 1275 | { |
| 1269 | int evtchn = evtchn_from_irq(irq); | 1276 | int evtchn = evtchn_from_irq(data->irq); |
| 1270 | struct shared_info *sh = HYPERVISOR_shared_info; | 1277 | struct shared_info *sh = HYPERVISOR_shared_info; |
| 1271 | int ret = 0; | 1278 | int ret = 0; |
| 1272 | 1279 | ||
| @@ -1315,7 +1322,7 @@ static void restore_cpu_pirqs(void) | |||
| 1315 | 1322 | ||
| 1316 | printk(KERN_DEBUG "xen: --> irq=%d, pirq=%d\n", irq, map_irq.pirq); | 1323 | printk(KERN_DEBUG "xen: --> irq=%d, pirq=%d\n", irq, map_irq.pirq); |
| 1317 | 1324 | ||
| 1318 | startup_pirq(irq); | 1325 | __startup_pirq(irq); |
| 1319 | } | 1326 | } |
| 1320 | } | 1327 | } |
| 1321 | 1328 | ||
| @@ -1467,44 +1474,44 @@ void xen_irq_resume(void) | |||
| 1467 | } | 1474 | } |
| 1468 | 1475 | ||
| 1469 | static struct irq_chip xen_dynamic_chip __read_mostly = { | 1476 | static struct irq_chip xen_dynamic_chip __read_mostly = { |
| 1470 | .name = "xen-dyn", | 1477 | .name = "xen-dyn", |
| 1471 | 1478 | ||
| 1472 | .disable = disable_dynirq, | 1479 | .irq_disable = disable_dynirq, |
| 1473 | .mask = disable_dynirq, | 1480 | .irq_mask = disable_dynirq, |
| 1474 | .unmask = enable_dynirq, | 1481 | .irq_unmask = enable_dynirq, |
| 1475 | 1482 | ||
| 1476 | .eoi = ack_dynirq, | 1483 | .irq_eoi = ack_dynirq, |
| 1477 | .set_affinity = set_affinity_irq, | 1484 | .irq_set_affinity = set_affinity_irq, |
| 1478 | .retrigger = retrigger_dynirq, | 1485 | .irq_retrigger = retrigger_dynirq, |
| 1479 | }; | 1486 | }; |
| 1480 | 1487 | ||
| 1481 | static struct irq_chip xen_pirq_chip __read_mostly = { | 1488 | static struct irq_chip xen_pirq_chip __read_mostly = { |
| 1482 | .name = "xen-pirq", | 1489 | .name = "xen-pirq", |
| 1483 | 1490 | ||
| 1484 | .startup = startup_pirq, | 1491 | .irq_startup = startup_pirq, |
| 1485 | .shutdown = shutdown_pirq, | 1492 | .irq_shutdown = shutdown_pirq, |
| 1486 | 1493 | ||
| 1487 | .enable = enable_pirq, | 1494 | .irq_enable = enable_pirq, |
| 1488 | .unmask = enable_pirq, | 1495 | .irq_unmask = enable_pirq, |
| 1489 | 1496 | ||
| 1490 | .disable = disable_pirq, | 1497 | .irq_disable = disable_pirq, |
| 1491 | .mask = disable_pirq, | 1498 | .irq_mask = disable_pirq, |
| 1492 | 1499 | ||
| 1493 | .ack = ack_pirq, | 1500 | .irq_ack = ack_pirq, |
| 1494 | 1501 | ||
| 1495 | .set_affinity = set_affinity_irq, | 1502 | .irq_set_affinity = set_affinity_irq, |
| 1496 | 1503 | ||
| 1497 | .retrigger = retrigger_dynirq, | 1504 | .irq_retrigger = retrigger_dynirq, |
| 1498 | }; | 1505 | }; |
| 1499 | 1506 | ||
| 1500 | static struct irq_chip xen_percpu_chip __read_mostly = { | 1507 | static struct irq_chip xen_percpu_chip __read_mostly = { |
| 1501 | .name = "xen-percpu", | 1508 | .name = "xen-percpu", |
| 1502 | 1509 | ||
| 1503 | .disable = disable_dynirq, | 1510 | .irq_disable = disable_dynirq, |
| 1504 | .mask = disable_dynirq, | 1511 | .irq_mask = disable_dynirq, |
| 1505 | .unmask = enable_dynirq, | 1512 | .irq_unmask = enable_dynirq, |
| 1506 | 1513 | ||
| 1507 | .ack = ack_dynirq, | 1514 | .irq_ack = ack_dynirq, |
| 1508 | }; | 1515 | }; |
| 1509 | 1516 | ||
| 1510 | int xen_set_callback_via(uint64_t via) | 1517 | int xen_set_callback_via(uint64_t via) |
