aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2011-01-22 06:32:18 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-16 21:19:02 -0400
commit4832b992553ef6c714c604809d9d3f0f4d137b7e (patch)
tree1ccf1fa868bfeda1b53fe9ec2ddf2b7e1f8085d5 /arch/sparc
parente6ebd529e4a6ddac43bc447f39d1f8a0e4d79864 (diff)
sparc64: use up-to-data genirq functions
Drop all uses of deprecated genirq features. The irq_set_affinity() call got a third paramter 'force' which is unused. For now genirq does not use this paramter and it is ignored by sparc. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Josip Rodin <joy@entuzijast.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/Kconfig1
-rw-r--r--arch/sparc/kernel/irq_64.c119
2 files changed, 61 insertions, 59 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 95695e97703e..13d2b6721da2 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -51,6 +51,7 @@ config SPARC64
51 select HAVE_PERF_EVENTS 51 select HAVE_PERF_EVENTS
52 select PERF_USE_VMALLOC 52 select PERF_USE_VMALLOC
53 select HAVE_GENERIC_HARDIRQS 53 select HAVE_GENERIC_HARDIRQS
54 select GENERIC_HARDIRQS_NO_DEPRECATED
54 55
55config ARCH_DEFCONFIG 56config ARCH_DEFCONFIG
56 string 57 string
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index b07fc79b7d5d..f356e4cd7420 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -275,16 +275,15 @@ static int irq_choose_cpu(unsigned int virt_irq, const struct cpumask *affinity)
275 real_hard_smp_processor_id() 275 real_hard_smp_processor_id()
276#endif 276#endif
277 277
278static void sun4u_irq_enable(unsigned int virt_irq) 278static void sun4u_irq_enable(struct irq_data *data)
279{ 279{
280 struct irq_handler_data *handler_data = get_irq_data(virt_irq); 280 struct irq_handler_data *handler_data = data->handler_data;
281 281
282 if (likely(handler_data)) { 282 if (likely(handler_data)) {
283 unsigned long cpuid, imap, val; 283 unsigned long cpuid, imap, val;
284 unsigned int tid; 284 unsigned int tid;
285 285
286 cpuid = irq_choose_cpu(virt_irq, 286 cpuid = irq_choose_cpu(data->irq, data->affinity);
287 irq_desc[virt_irq].irq_data.affinity);
288 imap = handler_data->imap; 287 imap = handler_data->imap;
289 288
290 tid = sun4u_compute_tid(imap, cpuid); 289 tid = sun4u_compute_tid(imap, cpuid);
@@ -298,16 +297,16 @@ static void sun4u_irq_enable(unsigned int virt_irq)
298 } 297 }
299} 298}
300 299
301static int sun4u_set_affinity(unsigned int virt_irq, 300static int sun4u_set_affinity(struct irq_data *data,
302 const struct cpumask *mask) 301 const struct cpumask *mask, bool force)
303{ 302{
304 struct irq_handler_data *handler_data = get_irq_data(virt_irq); 303 struct irq_handler_data *handler_data = data->handler_data;
305 304
306 if (likely(handler_data)) { 305 if (likely(handler_data)) {
307 unsigned long cpuid, imap, val; 306 unsigned long cpuid, imap, val;
308 unsigned int tid; 307 unsigned int tid;
309 308
310 cpuid = irq_choose_cpu(virt_irq, mask); 309 cpuid = irq_choose_cpu(data->irq, mask);
311 imap = handler_data->imap; 310 imap = handler_data->imap;
312 311
313 tid = sun4u_compute_tid(imap, cpuid); 312 tid = sun4u_compute_tid(imap, cpuid);
@@ -340,14 +339,14 @@ static int sun4u_set_affinity(unsigned int virt_irq,
340 * sees that, it also hooks up a default ->shutdown method which 339 * sees that, it also hooks up a default ->shutdown method which
341 * invokes ->mask() which we do not want. See irq_chip_set_defaults(). 340 * invokes ->mask() which we do not want. See irq_chip_set_defaults().
342 */ 341 */
343static void sun4u_irq_disable(unsigned int virt_irq) 342static void sun4u_irq_disable(struct irq_data *data)
344{ 343{
345} 344}
346 345
347static void sun4u_irq_eoi(unsigned int virt_irq) 346static void sun4u_irq_eoi(struct irq_data *data)
348{ 347{
349 struct irq_handler_data *handler_data = get_irq_data(virt_irq); 348 struct irq_handler_data *handler_data = data->handler_data;
350 struct irq_desc *desc = irq_desc + virt_irq; 349 struct irq_desc *desc = irq_desc + data->irq;
351 350
352 if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))) 351 if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS)))
353 return; 352 return;
@@ -356,11 +355,10 @@ static void sun4u_irq_eoi(unsigned int virt_irq)
356 upa_writeq(ICLR_IDLE, handler_data->iclr); 355 upa_writeq(ICLR_IDLE, handler_data->iclr);
357} 356}
358 357
359static void sun4v_irq_enable(unsigned int virt_irq) 358static void sun4v_irq_enable(struct irq_data *data)
360{ 359{
361 unsigned int ino = virt_irq_table[virt_irq].dev_ino; 360 unsigned int ino = virt_irq_table[data->irq].dev_ino;
362 unsigned long cpuid = irq_choose_cpu(virt_irq, 361 unsigned long cpuid = irq_choose_cpu(data->irq, data->affinity);
363 irq_desc[virt_irq].irq_data.affinity);
364 int err; 362 int err;
365 363
366 err = sun4v_intr_settarget(ino, cpuid); 364 err = sun4v_intr_settarget(ino, cpuid);
@@ -377,11 +375,11 @@ static void sun4v_irq_enable(unsigned int virt_irq)
377 ino, err); 375 ino, err);
378} 376}
379 377
380static int sun4v_set_affinity(unsigned int virt_irq, 378static int sun4v_set_affinity(struct irq_data *data,
381 const struct cpumask *mask) 379 const struct cpumask *mask, bool force)
382{ 380{
383 unsigned int ino = virt_irq_table[virt_irq].dev_ino; 381 unsigned int ino = virt_irq_table[data->irq].dev_ino;
384 unsigned long cpuid = irq_choose_cpu(virt_irq, mask); 382 unsigned long cpuid = irq_choose_cpu(data->irq, mask);
385 int err; 383 int err;
386 384
387 err = sun4v_intr_settarget(ino, cpuid); 385 err = sun4v_intr_settarget(ino, cpuid);
@@ -392,9 +390,9 @@ static int sun4v_set_affinity(unsigned int virt_irq,
392 return 0; 390 return 0;
393} 391}
394 392
395static void sun4v_irq_disable(unsigned int virt_irq) 393static void sun4v_irq_disable(struct irq_data *data)
396{ 394{
397 unsigned int ino = virt_irq_table[virt_irq].dev_ino; 395 unsigned int ino = virt_irq_table[data->irq].dev_ino;
398 int err; 396 int err;
399 397
400 err = sun4v_intr_setenabled(ino, HV_INTR_DISABLED); 398 err = sun4v_intr_setenabled(ino, HV_INTR_DISABLED);
@@ -403,10 +401,10 @@ static void sun4v_irq_disable(unsigned int virt_irq)
403 "err(%d)\n", ino, err); 401 "err(%d)\n", ino, err);
404} 402}
405 403
406static void sun4v_irq_eoi(unsigned int virt_irq) 404static void sun4v_irq_eoi(struct irq_data *data)
407{ 405{
408 unsigned int ino = virt_irq_table[virt_irq].dev_ino; 406 unsigned int ino = virt_irq_table[data->irq].dev_ino;
409 struct irq_desc *desc = irq_desc + virt_irq; 407 struct irq_desc *desc = irq_desc + data->irq;
410 int err; 408 int err;
411 409
412 if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))) 410 if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS)))
@@ -418,15 +416,15 @@ static void sun4v_irq_eoi(unsigned int virt_irq)
418 "err(%d)\n", ino, err); 416 "err(%d)\n", ino, err);
419} 417}
420 418
421static void sun4v_virq_enable(unsigned int virt_irq) 419static void sun4v_virq_enable(struct irq_data *data)
422{ 420{
423 unsigned long cpuid, dev_handle, dev_ino; 421 unsigned long cpuid, dev_handle, dev_ino;
424 int err; 422 int err;
425 423
426 cpuid = irq_choose_cpu(virt_irq, irq_desc[virt_irq].irq_data.affinity); 424 cpuid = irq_choose_cpu(data->irq, data->affinity);
427 425
428 dev_handle = virt_irq_table[virt_irq].dev_handle; 426 dev_handle = virt_irq_table[data->irq].dev_handle;
429 dev_ino = virt_irq_table[virt_irq].dev_ino; 427 dev_ino = virt_irq_table[data->irq].dev_ino;
430 428
431 err = sun4v_vintr_set_target(dev_handle, dev_ino, cpuid); 429 err = sun4v_vintr_set_target(dev_handle, dev_ino, cpuid);
432 if (err != HV_EOK) 430 if (err != HV_EOK)
@@ -447,16 +445,16 @@ static void sun4v_virq_enable(unsigned int virt_irq)
447 dev_handle, dev_ino, err); 445 dev_handle, dev_ino, err);
448} 446}
449 447
450static int sun4v_virt_set_affinity(unsigned int virt_irq, 448static int sun4v_virt_set_affinity(struct irq_data *data,
451 const struct cpumask *mask) 449 const struct cpumask *mask, bool force)
452{ 450{
453 unsigned long cpuid, dev_handle, dev_ino; 451 unsigned long cpuid, dev_handle, dev_ino;
454 int err; 452 int err;
455 453
456 cpuid = irq_choose_cpu(virt_irq, mask); 454 cpuid = irq_choose_cpu(data->irq, mask);
457 455
458 dev_handle = virt_irq_table[virt_irq].dev_handle; 456 dev_handle = virt_irq_table[data->irq].dev_handle;
459 dev_ino = virt_irq_table[virt_irq].dev_ino; 457 dev_ino = virt_irq_table[data->irq].dev_ino;
460 458
461 err = sun4v_vintr_set_target(dev_handle, dev_ino, cpuid); 459 err = sun4v_vintr_set_target(dev_handle, dev_ino, cpuid);
462 if (err != HV_EOK) 460 if (err != HV_EOK)
@@ -467,13 +465,13 @@ static int sun4v_virt_set_affinity(unsigned int virt_irq,
467 return 0; 465 return 0;
468} 466}
469 467
470static void sun4v_virq_disable(unsigned int virt_irq) 468static void sun4v_virq_disable(struct irq_data *data)
471{ 469{
472 unsigned long dev_handle, dev_ino; 470 unsigned long dev_handle, dev_ino;
473 int err; 471 int err;
474 472
475 dev_handle = virt_irq_table[virt_irq].dev_handle; 473 dev_handle = virt_irq_table[data->irq].dev_handle;
476 dev_ino = virt_irq_table[virt_irq].dev_ino; 474 dev_ino = virt_irq_table[data->irq].dev_ino;
477 475
478 err = sun4v_vintr_set_valid(dev_handle, dev_ino, 476 err = sun4v_vintr_set_valid(dev_handle, dev_ino,
479 HV_INTR_DISABLED); 477 HV_INTR_DISABLED);
@@ -483,17 +481,17 @@ static void sun4v_virq_disable(unsigned int virt_irq)
483 dev_handle, dev_ino, err); 481 dev_handle, dev_ino, err);
484} 482}
485 483
486static void sun4v_virq_eoi(unsigned int virt_irq) 484static void sun4v_virq_eoi(struct irq_data *data)
487{ 485{
488 struct irq_desc *desc = irq_desc + virt_irq; 486 struct irq_desc *desc = irq_desc + data->irq;
489 unsigned long dev_handle, dev_ino; 487 unsigned long dev_handle, dev_ino;
490 int err; 488 int err;
491 489
492 if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))) 490 if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS)))
493 return; 491 return;
494 492
495 dev_handle = virt_irq_table[virt_irq].dev_handle; 493 dev_handle = virt_irq_table[data->irq].dev_handle;
496 dev_ino = virt_irq_table[virt_irq].dev_ino; 494 dev_ino = virt_irq_table[data->irq].dev_ino;
497 495
498 err = sun4v_vintr_set_state(dev_handle, dev_ino, 496 err = sun4v_vintr_set_state(dev_handle, dev_ino,
499 HV_INTR_STATE_IDLE); 497 HV_INTR_STATE_IDLE);
@@ -504,27 +502,27 @@ static void sun4v_virq_eoi(unsigned int virt_irq)
504} 502}
505 503
506static struct irq_chip sun4u_irq = { 504static struct irq_chip sun4u_irq = {
507 .name = "sun4u", 505 .name = "sun4u",
508 .enable = sun4u_irq_enable, 506 .irq_enable = sun4u_irq_enable,
509 .disable = sun4u_irq_disable, 507 .irq_disable = sun4u_irq_disable,
510 .eoi = sun4u_irq_eoi, 508 .irq_eoi = sun4u_irq_eoi,
511 .set_affinity = sun4u_set_affinity, 509 .irq_set_affinity = sun4u_set_affinity,
512}; 510};
513 511
514static struct irq_chip sun4v_irq = { 512static struct irq_chip sun4v_irq = {
515 .name = "sun4v", 513 .name = "sun4v",
516 .enable = sun4v_irq_enable, 514 .irq_enable = sun4v_irq_enable,
517 .disable = sun4v_irq_disable, 515 .irq_disable = sun4v_irq_disable,
518 .eoi = sun4v_irq_eoi, 516 .irq_eoi = sun4v_irq_eoi,
519 .set_affinity = sun4v_set_affinity, 517 .irq_set_affinity = sun4v_set_affinity,
520}; 518};
521 519
522static struct irq_chip sun4v_virq = { 520static struct irq_chip sun4v_virq = {
523 .name = "vsun4v", 521 .name = "vsun4v",
524 .enable = sun4v_virq_enable, 522 .irq_enable = sun4v_virq_enable,
525 .disable = sun4v_virq_disable, 523 .irq_disable = sun4v_virq_disable,
526 .eoi = sun4v_virq_eoi, 524 .irq_eoi = sun4v_virq_eoi,
527 .set_affinity = sun4v_virt_set_affinity, 525 .irq_set_affinity = sun4v_virt_set_affinity,
528}; 526};
529 527
530static void pre_flow_handler(unsigned int virt_irq, 528static void pre_flow_handler(unsigned int virt_irq,
@@ -798,9 +796,12 @@ void fixup_irqs(void)
798 raw_spin_lock_irqsave(&irq_desc[irq].lock, flags); 796 raw_spin_lock_irqsave(&irq_desc[irq].lock, flags);
799 if (irq_desc[irq].action && 797 if (irq_desc[irq].action &&
800 !(irq_desc[irq].status & IRQ_PER_CPU)) { 798 !(irq_desc[irq].status & IRQ_PER_CPU)) {
801 if (irq_desc[irq].irq_data.chip->set_affinity) 799 struct irq_data *data = irq_get_irq_data(irq);
802 irq_desc[irq].irq_data.chip->set_affinity(irq, 800
803 irq_desc[irq].irq_data.affinity); 801 if (data->chip->irq_set_affinity)
802 data->chip->irq_set_affinity(data,
803 data->affinity,
804 false);
804 } 805 }
805 raw_spin_unlock_irqrestore(&irq_desc[irq].lock, flags); 806 raw_spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
806 } 807 }