diff options
Diffstat (limited to 'arch/powerpc')
29 files changed, 414 insertions, 250 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index e16eb2a33173..6ff3cf506088 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -191,6 +191,37 @@ exception_marker: | |||
191 | ori reg,reg,(label)@l; /* virt addr of handler ... */ | 191 | ori reg,reg,(label)@l; /* virt addr of handler ... */ |
192 | #endif | 192 | #endif |
193 | 193 | ||
194 | /* | ||
195 | * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode. | ||
196 | * The firmware calls the registered system_reset_fwnmi and | ||
197 | * machine_check_fwnmi handlers in 32bit mode if the cpu happens to run | ||
198 | * a 32bit application at the time of the event. | ||
199 | * This firmware bug is present on POWER4 and JS20. | ||
200 | */ | ||
201 | #define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label) \ | ||
202 | mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ | ||
203 | std r9,area+EX_R9(r13); /* save r9 - r12 */ \ | ||
204 | std r10,area+EX_R10(r13); \ | ||
205 | std r11,area+EX_R11(r13); \ | ||
206 | std r12,area+EX_R12(r13); \ | ||
207 | mfspr r9,SPRN_SPRG1; \ | ||
208 | std r9,area+EX_R13(r13); \ | ||
209 | mfcr r9; \ | ||
210 | clrrdi r12,r13,32; /* get high part of &label */ \ | ||
211 | mfmsr r10; \ | ||
212 | /* force 64bit mode */ \ | ||
213 | li r11,5; /* MSR_SF_LG|MSR_ISF_LG */ \ | ||
214 | rldimi r10,r11,61,0; /* insert into top 3 bits */ \ | ||
215 | /* done 64bit mode */ \ | ||
216 | mfspr r11,SPRN_SRR0; /* save SRR0 */ \ | ||
217 | LOAD_HANDLER(r12,label) \ | ||
218 | ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \ | ||
219 | mtspr SPRN_SRR0,r12; \ | ||
220 | mfspr r12,SPRN_SRR1; /* and SRR1 */ \ | ||
221 | mtspr SPRN_SRR1,r10; \ | ||
222 | rfid; \ | ||
223 | b . /* prevent speculative execution */ | ||
224 | |||
194 | #define EXCEPTION_PROLOG_PSERIES(area, label) \ | 225 | #define EXCEPTION_PROLOG_PSERIES(area, label) \ |
195 | mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ | 226 | mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ |
196 | std r9,area+EX_R9(r13); /* save r9 - r12 */ \ | 227 | std r9,area+EX_R9(r13); /* save r9 - r12 */ \ |
@@ -604,14 +635,14 @@ slb_miss_user_pseries: | |||
604 | system_reset_fwnmi: | 635 | system_reset_fwnmi: |
605 | HMT_MEDIUM | 636 | HMT_MEDIUM |
606 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 637 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
607 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) | 638 | EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXGEN, system_reset_common) |
608 | 639 | ||
609 | .globl machine_check_fwnmi | 640 | .globl machine_check_fwnmi |
610 | .align 7 | 641 | .align 7 |
611 | machine_check_fwnmi: | 642 | machine_check_fwnmi: |
612 | HMT_MEDIUM | 643 | HMT_MEDIUM |
613 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 644 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
614 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) | 645 | EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXMC, machine_check_common) |
615 | 646 | ||
616 | #ifdef CONFIG_PPC_ISERIES | 647 | #ifdef CONFIG_PPC_ISERIES |
617 | /*** ISeries-LPAR interrupt handlers ***/ | 648 | /*** ISeries-LPAR interrupt handlers ***/ |
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index d9a0b087fa7f..124dbcba94a8 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -323,7 +323,7 @@ int ibmebus_request_irq(struct ibmebus_dev *dev, | |||
323 | unsigned long irq_flags, const char * devname, | 323 | unsigned long irq_flags, const char * devname, |
324 | void *dev_id) | 324 | void *dev_id) |
325 | { | 325 | { |
326 | unsigned int irq = irq_create_mapping(NULL, ist, 0); | 326 | unsigned int irq = irq_create_mapping(NULL, ist); |
327 | 327 | ||
328 | if (irq == NO_IRQ) | 328 | if (irq == NO_IRQ) |
329 | return -EINVAL; | 329 | return -EINVAL; |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 8cf987809c66..01bdae35cb55 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -391,15 +391,14 @@ struct irq_host *irq_alloc_host(unsigned int revmap_type, | |||
391 | irq_map[i].host = host; | 391 | irq_map[i].host = host; |
392 | smp_wmb(); | 392 | smp_wmb(); |
393 | 393 | ||
394 | /* Clear some flags */ | 394 | /* Clear norequest flags */ |
395 | get_irq_desc(i)->status | 395 | get_irq_desc(i)->status &= ~IRQ_NOREQUEST; |
396 | &= ~(IRQ_NOREQUEST | IRQ_LEVEL); | ||
397 | 396 | ||
398 | /* Legacy flags are left to default at this point, | 397 | /* Legacy flags are left to default at this point, |
399 | * one can then use irq_create_mapping() to | 398 | * one can then use irq_create_mapping() to |
400 | * explicitely change them | 399 | * explicitely change them |
401 | */ | 400 | */ |
402 | ops->map(host, i, i, 0); | 401 | ops->map(host, i, i); |
403 | } | 402 | } |
404 | break; | 403 | break; |
405 | case IRQ_HOST_MAP_LINEAR: | 404 | case IRQ_HOST_MAP_LINEAR: |
@@ -457,13 +456,11 @@ void irq_set_virq_count(unsigned int count) | |||
457 | } | 456 | } |
458 | 457 | ||
459 | unsigned int irq_create_mapping(struct irq_host *host, | 458 | unsigned int irq_create_mapping(struct irq_host *host, |
460 | irq_hw_number_t hwirq, | 459 | irq_hw_number_t hwirq) |
461 | unsigned int flags) | ||
462 | { | 460 | { |
463 | unsigned int virq, hint; | 461 | unsigned int virq, hint; |
464 | 462 | ||
465 | pr_debug("irq: irq_create_mapping(0x%p, 0x%lx, 0x%x)\n", | 463 | pr_debug("irq: irq_create_mapping(0x%p, 0x%lx)\n", host, hwirq); |
466 | host, hwirq, flags); | ||
467 | 464 | ||
468 | /* Look for default host if nececssary */ | 465 | /* Look for default host if nececssary */ |
469 | if (host == NULL) | 466 | if (host == NULL) |
@@ -482,7 +479,6 @@ unsigned int irq_create_mapping(struct irq_host *host, | |||
482 | virq = irq_find_mapping(host, hwirq); | 479 | virq = irq_find_mapping(host, hwirq); |
483 | if (virq != IRQ_NONE) { | 480 | if (virq != IRQ_NONE) { |
484 | pr_debug("irq: -> existing mapping on virq %d\n", virq); | 481 | pr_debug("irq: -> existing mapping on virq %d\n", virq); |
485 | host->ops->map(host, virq, hwirq, flags); | ||
486 | return virq; | 482 | return virq; |
487 | } | 483 | } |
488 | 484 | ||
@@ -504,18 +500,18 @@ unsigned int irq_create_mapping(struct irq_host *host, | |||
504 | } | 500 | } |
505 | pr_debug("irq: -> obtained virq %d\n", virq); | 501 | pr_debug("irq: -> obtained virq %d\n", virq); |
506 | 502 | ||
507 | /* Clear some flags */ | 503 | /* Clear IRQ_NOREQUEST flag */ |
508 | get_irq_desc(virq)->status &= ~(IRQ_NOREQUEST | IRQ_LEVEL); | 504 | get_irq_desc(virq)->status &= ~IRQ_NOREQUEST; |
509 | 505 | ||
510 | /* map it */ | 506 | /* map it */ |
511 | if (host->ops->map(host, virq, hwirq, flags)) { | 507 | smp_wmb(); |
508 | irq_map[virq].hwirq = hwirq; | ||
509 | smp_mb(); | ||
510 | if (host->ops->map(host, virq, hwirq)) { | ||
512 | pr_debug("irq: -> mapping failed, freeing\n"); | 511 | pr_debug("irq: -> mapping failed, freeing\n"); |
513 | irq_free_virt(virq, 1); | 512 | irq_free_virt(virq, 1); |
514 | return NO_IRQ; | 513 | return NO_IRQ; |
515 | } | 514 | } |
516 | smp_wmb(); | ||
517 | irq_map[virq].hwirq = hwirq; | ||
518 | smp_mb(); | ||
519 | return virq; | 515 | return virq; |
520 | } | 516 | } |
521 | EXPORT_SYMBOL_GPL(irq_create_mapping); | 517 | EXPORT_SYMBOL_GPL(irq_create_mapping); |
@@ -525,25 +521,38 @@ extern unsigned int irq_create_of_mapping(struct device_node *controller, | |||
525 | { | 521 | { |
526 | struct irq_host *host; | 522 | struct irq_host *host; |
527 | irq_hw_number_t hwirq; | 523 | irq_hw_number_t hwirq; |
528 | unsigned int flags = IRQ_TYPE_NONE; | 524 | unsigned int type = IRQ_TYPE_NONE; |
525 | unsigned int virq; | ||
529 | 526 | ||
530 | if (controller == NULL) | 527 | if (controller == NULL) |
531 | host = irq_default_host; | 528 | host = irq_default_host; |
532 | else | 529 | else |
533 | host = irq_find_host(controller); | 530 | host = irq_find_host(controller); |
534 | if (host == NULL) | 531 | if (host == NULL) { |
532 | printk(KERN_WARNING "irq: no irq host found for %s !\n", | ||
533 | controller->full_name); | ||
535 | return NO_IRQ; | 534 | return NO_IRQ; |
535 | } | ||
536 | 536 | ||
537 | /* If host has no translation, then we assume interrupt line */ | 537 | /* If host has no translation, then we assume interrupt line */ |
538 | if (host->ops->xlate == NULL) | 538 | if (host->ops->xlate == NULL) |
539 | hwirq = intspec[0]; | 539 | hwirq = intspec[0]; |
540 | else { | 540 | else { |
541 | if (host->ops->xlate(host, controller, intspec, intsize, | 541 | if (host->ops->xlate(host, controller, intspec, intsize, |
542 | &hwirq, &flags)) | 542 | &hwirq, &type)) |
543 | return NO_IRQ; | 543 | return NO_IRQ; |
544 | } | 544 | } |
545 | 545 | ||
546 | return irq_create_mapping(host, hwirq, flags); | 546 | /* Create mapping */ |
547 | virq = irq_create_mapping(host, hwirq); | ||
548 | if (virq == NO_IRQ) | ||
549 | return virq; | ||
550 | |||
551 | /* Set type if specified and different than the current one */ | ||
552 | if (type != IRQ_TYPE_NONE && | ||
553 | type != (get_irq_desc(virq)->status & IRQF_TRIGGER_MASK)) | ||
554 | set_irq_type(virq, type); | ||
555 | return virq; | ||
547 | } | 556 | } |
548 | EXPORT_SYMBOL_GPL(irq_create_of_mapping); | 557 | EXPORT_SYMBOL_GPL(irq_create_of_mapping); |
549 | 558 | ||
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index bfb407fc1aa1..e3ed21cd3d94 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -687,7 +687,7 @@ _GLOBAL(kexec_sequence) | |||
687 | /* clear out hardware hash page table and tlb */ | 687 | /* clear out hardware hash page table and tlb */ |
688 | ld r5,0(r27) /* deref function descriptor */ | 688 | ld r5,0(r27) /* deref function descriptor */ |
689 | mtctr r5 | 689 | mtctr r5 |
690 | bctrl /* ppc_md.hash_clear_all(void); */ | 690 | bctrl /* ppc_md.hpte_clear_all(void); */ |
691 | 691 | ||
692 | /* | 692 | /* |
693 | * kexec image calling is: | 693 | * kexec image calling is: |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 3f6bd36e9e14..9b49f8691d29 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/bootmem.h> | 13 | #include <linux/bootmem.h> |
14 | #include <linux/irq.h> | ||
14 | 15 | ||
15 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
16 | #include <asm/io.h> | 17 | #include <asm/io.h> |
@@ -18,7 +19,6 @@ | |||
18 | #include <asm/sections.h> | 19 | #include <asm/sections.h> |
19 | #include <asm/pci-bridge.h> | 20 | #include <asm/pci-bridge.h> |
20 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
21 | #include <asm/irq.h> | ||
22 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
23 | #include <asm/machdep.h> | 23 | #include <asm/machdep.h> |
24 | 24 | ||
@@ -1423,15 +1423,37 @@ int pci_read_irq_line(struct pci_dev *pci_dev) | |||
1423 | 1423 | ||
1424 | DBG("Try to map irq for %s...\n", pci_name(pci_dev)); | 1424 | DBG("Try to map irq for %s...\n", pci_name(pci_dev)); |
1425 | 1425 | ||
1426 | /* Try to get a mapping from the device-tree */ | ||
1426 | if (of_irq_map_pci(pci_dev, &oirq)) { | 1427 | if (of_irq_map_pci(pci_dev, &oirq)) { |
1427 | DBG(" -> failed !\n"); | 1428 | u8 line, pin; |
1428 | return -1; | 1429 | |
1429 | } | 1430 | /* If that fails, lets fallback to what is in the config |
1431 | * space and map that through the default controller. We | ||
1432 | * also set the type to level low since that's what PCI | ||
1433 | * interrupts are. If your platform does differently, then | ||
1434 | * either provide a proper interrupt tree or don't use this | ||
1435 | * function. | ||
1436 | */ | ||
1437 | if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin)) | ||
1438 | return -1; | ||
1439 | if (pin == 0) | ||
1440 | return -1; | ||
1441 | if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) || | ||
1442 | line == 0xff) { | ||
1443 | return -1; | ||
1444 | } | ||
1445 | DBG(" -> no map ! Using irq line %d from PCI config\n", line); | ||
1430 | 1446 | ||
1431 | DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", | 1447 | virq = irq_create_mapping(NULL, line); |
1432 | oirq.size, oirq.specifier[0], oirq.controller->full_name); | 1448 | if (virq != NO_IRQ) |
1449 | set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); | ||
1450 | } else { | ||
1451 | DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", | ||
1452 | oirq.size, oirq.specifier[0], oirq.controller->full_name); | ||
1433 | 1453 | ||
1434 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); | 1454 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, |
1455 | oirq.size); | ||
1456 | } | ||
1435 | if(virq == NO_IRQ) { | 1457 | if(virq == NO_IRQ) { |
1436 | DBG(" -> failed to map !\n"); | 1458 | DBG(" -> failed to map !\n"); |
1437 | return -1; | 1459 | return -1; |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index e795a7e2a38e..d51be7c7a2ef 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -21,13 +21,13 @@ | |||
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
22 | #include <linux/list.h> | 22 | #include <linux/list.h> |
23 | #include <linux/syscalls.h> | 23 | #include <linux/syscalls.h> |
24 | #include <linux/irq.h> | ||
24 | 25 | ||
25 | #include <asm/processor.h> | 26 | #include <asm/processor.h> |
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | #include <asm/prom.h> | 28 | #include <asm/prom.h> |
28 | #include <asm/pci-bridge.h> | 29 | #include <asm/pci-bridge.h> |
29 | #include <asm/byteorder.h> | 30 | #include <asm/byteorder.h> |
30 | #include <asm/irq.h> | ||
31 | #include <asm/machdep.h> | 31 | #include <asm/machdep.h> |
32 | #include <asm/ppc-pci.h> | 32 | #include <asm/ppc-pci.h> |
33 | 33 | ||
@@ -1254,15 +1254,37 @@ int pci_read_irq_line(struct pci_dev *pci_dev) | |||
1254 | 1254 | ||
1255 | DBG("Try to map irq for %s...\n", pci_name(pci_dev)); | 1255 | DBG("Try to map irq for %s...\n", pci_name(pci_dev)); |
1256 | 1256 | ||
1257 | /* Try to get a mapping from the device-tree */ | ||
1257 | if (of_irq_map_pci(pci_dev, &oirq)) { | 1258 | if (of_irq_map_pci(pci_dev, &oirq)) { |
1258 | DBG(" -> failed !\n"); | 1259 | u8 line, pin; |
1259 | return -1; | 1260 | |
1260 | } | 1261 | /* If that fails, lets fallback to what is in the config |
1262 | * space and map that through the default controller. We | ||
1263 | * also set the type to level low since that's what PCI | ||
1264 | * interrupts are. If your platform does differently, then | ||
1265 | * either provide a proper interrupt tree or don't use this | ||
1266 | * function. | ||
1267 | */ | ||
1268 | if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin)) | ||
1269 | return -1; | ||
1270 | if (pin == 0) | ||
1271 | return -1; | ||
1272 | if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) || | ||
1273 | line == 0xff) { | ||
1274 | return -1; | ||
1275 | } | ||
1276 | DBG(" -> no map ! Using irq line %d from PCI config\n", line); | ||
1261 | 1277 | ||
1262 | DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", | 1278 | virq = irq_create_mapping(NULL, line); |
1263 | oirq.size, oirq.specifier[0], oirq.controller->full_name); | 1279 | if (virq != NO_IRQ) |
1280 | set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); | ||
1281 | } else { | ||
1282 | DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", | ||
1283 | oirq.size, oirq.specifier[0], oirq.controller->full_name); | ||
1264 | 1284 | ||
1265 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); | 1285 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, |
1286 | oirq.size); | ||
1287 | } | ||
1266 | if(virq == NO_IRQ) { | 1288 | if(virq == NO_IRQ) { |
1267 | DBG(" -> failed to map !\n"); | 1289 | DBG(" -> failed to map !\n"); |
1268 | return -1; | 1290 | return -1; |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index e3b80f71748e..f6a05f090b25 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/elfcore.h> | 5 | #include <linux/elfcore.h> |
6 | #include <linux/string.h> | 6 | #include <linux/string.h> |
7 | #include <linux/interrupt.h> | 7 | #include <linux/interrupt.h> |
8 | #include <linux/tty.h> | 8 | #include <linux/screen_info.h> |
9 | #include <linux/vt_kern.h> | 9 | #include <linux/vt_kern.h> |
10 | #include <linux/nvram.h> | 10 | #include <linux/nvram.h> |
11 | #include <linux/console.h> | 11 | #include <linux/console.h> |
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index cdcd5d665468..59f69d34cb67 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c | |||
@@ -885,7 +885,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq | |||
885 | intsize = *tmp; | 885 | intsize = *tmp; |
886 | 886 | ||
887 | /* Check index */ | 887 | /* Check index */ |
888 | if (index * intsize >= intlen) | 888 | if ((index + 1) * intsize > intlen) |
889 | return -EINVAL; | 889 | return -EINVAL; |
890 | 890 | ||
891 | /* Get new specifier and map it */ | 891 | /* Get new specifier and map it */ |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index aaf1727b3570..d57930d86faa 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/ioport.h> | 26 | #include <linux/ioport.h> |
27 | #include <linux/console.h> | 27 | #include <linux/console.h> |
28 | #include <linux/utsname.h> | 28 | #include <linux/utsname.h> |
29 | #include <linux/tty.h> | 29 | #include <linux/screen_info.h> |
30 | #include <linux/root_dev.h> | 30 | #include <linux/root_dev.h> |
31 | #include <linux/notifier.h> | 31 | #include <linux/notifier.h> |
32 | #include <linux/cpu.h> | 32 | #include <linux/cpu.h> |
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 1d724aef438a..ae927a4e46e4 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -277,7 +277,7 @@ static void unregister_cpu_online(unsigned int cpu) | |||
277 | } | 277 | } |
278 | #endif /* CONFIG_HOTPLUG_CPU */ | 278 | #endif /* CONFIG_HOTPLUG_CPU */ |
279 | 279 | ||
280 | static int __devinit sysfs_cpu_notify(struct notifier_block *self, | 280 | static int __cpuinit sysfs_cpu_notify(struct notifier_block *self, |
281 | unsigned long action, void *hcpu) | 281 | unsigned long action, void *hcpu) |
282 | { | 282 | { |
283 | unsigned int cpu = (unsigned int)(long)hcpu; | 283 | unsigned int cpu = (unsigned int)(long)hcpu; |
@@ -295,7 +295,7 @@ static int __devinit sysfs_cpu_notify(struct notifier_block *self, | |||
295 | return NOTIFY_OK; | 295 | return NOTIFY_OK; |
296 | } | 296 | } |
297 | 297 | ||
298 | static struct notifier_block __devinitdata sysfs_cpu_nb = { | 298 | static struct notifier_block __cpuinitdata sysfs_cpu_nb = { |
299 | .notifier_call = sysfs_cpu_notify, | 299 | .notifier_call = sysfs_cpu_notify, |
300 | }; | 300 | }; |
301 | 301 | ||
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 3c668078e524..2105767fcc57 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -150,13 +150,9 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
150 | if (in_interrupt()) | 150 | if (in_interrupt()) |
151 | panic("Fatal exception in interrupt"); | 151 | panic("Fatal exception in interrupt"); |
152 | 152 | ||
153 | if (panic_on_oops) { | 153 | if (panic_on_oops) |
154 | #ifdef CONFIG_PPC64 | 154 | panic("Fatal exception: panic_on_oops"); |
155 | printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); | 155 | |
156 | ssleep(5); | ||
157 | #endif | ||
158 | panic("Fatal exception"); | ||
159 | } | ||
160 | do_exit(err); | 156 | do_exit(err); |
161 | 157 | ||
162 | return 0; | 158 | return 0; |
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile index 8a3bed5f143a..3726358faae8 100644 --- a/arch/powerpc/kernel/vdso32/Makefile +++ b/arch/powerpc/kernel/vdso32/Makefile | |||
@@ -14,7 +14,8 @@ obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32)) | |||
14 | 14 | ||
15 | 15 | ||
16 | EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin | 16 | EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin |
17 | EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 | 17 | EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ |
18 | $(call ld-option, -Wl$(comma)--hash-style=sysv) | ||
18 | EXTRA_AFLAGS := -D__VDSO32__ -s | 19 | EXTRA_AFLAGS := -D__VDSO32__ -s |
19 | 20 | ||
20 | obj-y += vdso32_wrapper.o | 21 | obj-y += vdso32_wrapper.o |
diff --git a/arch/powerpc/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S index f4bad720cb0a..6187af2d54c3 100644 --- a/arch/powerpc/kernel/vdso32/vdso32.lds.S +++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S | |||
@@ -14,6 +14,7 @@ SECTIONS | |||
14 | { | 14 | { |
15 | . = VDSO32_LBASE + SIZEOF_HEADERS; | 15 | . = VDSO32_LBASE + SIZEOF_HEADERS; |
16 | .hash : { *(.hash) } :text | 16 | .hash : { *(.hash) } :text |
17 | .gnu.hash : { *(.gnu.hash) } | ||
17 | .dynsym : { *(.dynsym) } | 18 | .dynsym : { *(.dynsym) } |
18 | .dynstr : { *(.dynstr) } | 19 | .dynstr : { *(.dynstr) } |
19 | .gnu.version : { *(.gnu.version) } | 20 | .gnu.version : { *(.gnu.version) } |
diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile index ab39988452cc..43af9b2a6f3b 100644 --- a/arch/powerpc/kernel/vdso64/Makefile +++ b/arch/powerpc/kernel/vdso64/Makefile | |||
@@ -8,7 +8,8 @@ targets := $(obj-vdso64) vdso64.so | |||
8 | obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) | 8 | obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) |
9 | 9 | ||
10 | EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin | 10 | EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin |
11 | EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 | 11 | EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ |
12 | $(call ld-option, -Wl$(comma)--hash-style=sysv) | ||
12 | EXTRA_AFLAGS := -D__VDSO64__ -s | 13 | EXTRA_AFLAGS := -D__VDSO64__ -s |
13 | 14 | ||
14 | obj-y += vdso64_wrapper.o | 15 | obj-y += vdso64_wrapper.o |
diff --git a/arch/powerpc/kernel/vdso64/vdso64.lds.S b/arch/powerpc/kernel/vdso64/vdso64.lds.S index 4bdf224464ab..4a2b6dc0960c 100644 --- a/arch/powerpc/kernel/vdso64/vdso64.lds.S +++ b/arch/powerpc/kernel/vdso64/vdso64.lds.S | |||
@@ -12,6 +12,7 @@ SECTIONS | |||
12 | { | 12 | { |
13 | . = VDSO64_LBASE + SIZEOF_HEADERS; | 13 | . = VDSO64_LBASE + SIZEOF_HEADERS; |
14 | .hash : { *(.hash) } :text | 14 | .hash : { *(.hash) } :text |
15 | .gnu.hash : { *(.gnu.hash) } | ||
15 | .dynsym : { *(.dynsym) } | 16 | .dynsym : { *(.dynsym) } |
16 | .dynstr : { *(.dynstr) } | 17 | .dynstr : { *(.dynstr) } |
17 | .gnu.version : { *(.gnu.version) } | 18 | .gnu.version : { *(.gnu.version) } |
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index b26b496f6548..7813a58e0db4 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c | |||
@@ -159,7 +159,7 @@ static void iic_request_ipi(int ipi, const char *name) | |||
159 | if (iic_hosts[node] == NULL) | 159 | if (iic_hosts[node] == NULL) |
160 | continue; | 160 | continue; |
161 | virq = irq_create_mapping(iic_hosts[node], | 161 | virq = irq_create_mapping(iic_hosts[node], |
162 | iic_ipi_to_irq(ipi), 0); | 162 | iic_ipi_to_irq(ipi)); |
163 | if (virq == NO_IRQ) { | 163 | if (virq == NO_IRQ) { |
164 | printk(KERN_ERR | 164 | printk(KERN_ERR |
165 | "iic: failed to map IPI %s on node %d\n", | 165 | "iic: failed to map IPI %s on node %d\n", |
@@ -197,7 +197,7 @@ static int iic_host_match(struct irq_host *h, struct device_node *node) | |||
197 | } | 197 | } |
198 | 198 | ||
199 | static int iic_host_map(struct irq_host *h, unsigned int virq, | 199 | static int iic_host_map(struct irq_host *h, unsigned int virq, |
200 | irq_hw_number_t hw, unsigned int flags) | 200 | irq_hw_number_t hw) |
201 | { | 201 | { |
202 | if (hw < IIC_IRQ_IPI0) | 202 | if (hw < IIC_IRQ_IPI0) |
203 | set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq); | 203 | set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq); |
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index ab4c252a4d9b..742a03282b44 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -85,9 +85,6 @@ static void spider_unmask_irq(unsigned int virq) | |||
85 | struct spider_pic *pic = spider_virq_to_pic(virq); | 85 | struct spider_pic *pic = spider_virq_to_pic(virq); |
86 | void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); | 86 | void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); |
87 | 87 | ||
88 | /* We use no locking as we should be covered by the descriptor lock | ||
89 | * for access to invidual source configuration registers | ||
90 | */ | ||
91 | out_be32(cfg, in_be32(cfg) | 0x30000000u); | 88 | out_be32(cfg, in_be32(cfg) | 0x30000000u); |
92 | } | 89 | } |
93 | 90 | ||
@@ -96,9 +93,6 @@ static void spider_mask_irq(unsigned int virq) | |||
96 | struct spider_pic *pic = spider_virq_to_pic(virq); | 93 | struct spider_pic *pic = spider_virq_to_pic(virq); |
97 | void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); | 94 | void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); |
98 | 95 | ||
99 | /* We use no locking as we should be covered by the descriptor lock | ||
100 | * for access to invidual source configuration registers | ||
101 | */ | ||
102 | out_be32(cfg, in_be32(cfg) & ~0x30000000u); | 96 | out_be32(cfg, in_be32(cfg) & ~0x30000000u); |
103 | } | 97 | } |
104 | 98 | ||
@@ -120,26 +114,14 @@ static void spider_ack_irq(unsigned int virq) | |||
120 | out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf)); | 114 | out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf)); |
121 | } | 115 | } |
122 | 116 | ||
123 | static struct irq_chip spider_pic = { | 117 | static int spider_set_irq_type(unsigned int virq, unsigned int type) |
124 | .typename = " SPIDER ", | ||
125 | .unmask = spider_unmask_irq, | ||
126 | .mask = spider_mask_irq, | ||
127 | .ack = spider_ack_irq, | ||
128 | }; | ||
129 | |||
130 | static int spider_host_match(struct irq_host *h, struct device_node *node) | ||
131 | { | ||
132 | struct spider_pic *pic = h->host_data; | ||
133 | return node == pic->of_node; | ||
134 | } | ||
135 | |||
136 | static int spider_host_map(struct irq_host *h, unsigned int virq, | ||
137 | irq_hw_number_t hw, unsigned int flags) | ||
138 | { | 118 | { |
139 | unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; | 119 | unsigned int sense = type & IRQ_TYPE_SENSE_MASK; |
140 | struct spider_pic *pic = h->host_data; | 120 | struct spider_pic *pic = spider_virq_to_pic(virq); |
121 | unsigned int hw = irq_map[virq].hwirq; | ||
141 | void __iomem *cfg = spider_get_irq_config(pic, hw); | 122 | void __iomem *cfg = spider_get_irq_config(pic, hw); |
142 | int level = 0; | 123 | struct irq_desc *desc = get_irq_desc(virq); |
124 | u32 old_mask; | ||
143 | u32 ic; | 125 | u32 ic; |
144 | 126 | ||
145 | /* Note that only level high is supported for most interrupts */ | 127 | /* Note that only level high is supported for most interrupts */ |
@@ -157,29 +139,57 @@ static int spider_host_map(struct irq_host *h, unsigned int virq, | |||
157 | break; | 139 | break; |
158 | case IRQ_TYPE_LEVEL_LOW: | 140 | case IRQ_TYPE_LEVEL_LOW: |
159 | ic = 0x0; | 141 | ic = 0x0; |
160 | level = 1; | ||
161 | break; | 142 | break; |
162 | case IRQ_TYPE_LEVEL_HIGH: | 143 | case IRQ_TYPE_LEVEL_HIGH: |
163 | case IRQ_TYPE_NONE: | 144 | case IRQ_TYPE_NONE: |
164 | ic = 0x1; | 145 | ic = 0x1; |
165 | level = 1; | ||
166 | break; | 146 | break; |
167 | default: | 147 | default: |
168 | return -EINVAL; | 148 | return -EINVAL; |
169 | } | 149 | } |
170 | 150 | ||
151 | /* Update irq_desc */ | ||
152 | desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); | ||
153 | desc->status |= type & IRQ_TYPE_SENSE_MASK; | ||
154 | if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) | ||
155 | desc->status |= IRQ_LEVEL; | ||
156 | |||
171 | /* Configure the source. One gross hack that was there before and | 157 | /* Configure the source. One gross hack that was there before and |
172 | * that I've kept around is the priority to the BE which I set to | 158 | * that I've kept around is the priority to the BE which I set to |
173 | * be the same as the interrupt source number. I don't know wether | 159 | * be the same as the interrupt source number. I don't know wether |
174 | * that's supposed to make any kind of sense however, we'll have to | 160 | * that's supposed to make any kind of sense however, we'll have to |
175 | * decide that, but for now, I'm not changing the behaviour. | 161 | * decide that, but for now, I'm not changing the behaviour. |
176 | */ | 162 | */ |
177 | out_be32(cfg, (ic << 24) | (0x7 << 16) | (pic->node_id << 4) | 0xe); | 163 | old_mask = in_be32(cfg) & 0x30000000u; |
164 | out_be32(cfg, old_mask | (ic << 24) | (0x7 << 16) | | ||
165 | (pic->node_id << 4) | 0xe); | ||
178 | out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff)); | 166 | out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff)); |
179 | 167 | ||
180 | if (level) | 168 | return 0; |
181 | get_irq_desc(virq)->status |= IRQ_LEVEL; | 169 | } |
170 | |||
171 | static struct irq_chip spider_pic = { | ||
172 | .typename = " SPIDER ", | ||
173 | .unmask = spider_unmask_irq, | ||
174 | .mask = spider_mask_irq, | ||
175 | .ack = spider_ack_irq, | ||
176 | .set_type = spider_set_irq_type, | ||
177 | }; | ||
178 | |||
179 | static int spider_host_match(struct irq_host *h, struct device_node *node) | ||
180 | { | ||
181 | struct spider_pic *pic = h->host_data; | ||
182 | return node == pic->of_node; | ||
183 | } | ||
184 | |||
185 | static int spider_host_map(struct irq_host *h, unsigned int virq, | ||
186 | irq_hw_number_t hw) | ||
187 | { | ||
182 | set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq); | 188 | set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq); |
189 | |||
190 | /* Set default irq type */ | ||
191 | set_irq_type(virq, IRQ_TYPE_NONE); | ||
192 | |||
183 | return 0; | 193 | return 0; |
184 | } | 194 | } |
185 | 195 | ||
@@ -283,7 +293,7 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) | |||
283 | if (iic_host == NULL) | 293 | if (iic_host == NULL) |
284 | return NO_IRQ; | 294 | return NO_IRQ; |
285 | /* Manufacture an IIC interrupt number of class 2 */ | 295 | /* Manufacture an IIC interrupt number of class 2 */ |
286 | virq = irq_create_mapping(iic_host, 0x20 | unit, 0); | 296 | virq = irq_create_mapping(iic_host, 0x20 | unit); |
287 | if (virq == NO_IRQ) | 297 | if (virq == NO_IRQ) |
288 | printk(KERN_ERR "spider_pic: failed to map cascade !"); | 298 | printk(KERN_ERR "spider_pic: failed to map cascade !"); |
289 | return virq; | 299 | return virq; |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 86d55675e1d2..3bd36d46ab4a 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -583,9 +583,9 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) | |||
583 | spu->isrc = isrc = tmp[0]; | 583 | spu->isrc = isrc = tmp[0]; |
584 | 584 | ||
585 | /* Now map interrupts of all 3 classes */ | 585 | /* Now map interrupts of all 3 classes */ |
586 | spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc, 0); | 586 | spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc); |
587 | spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc, 0); | 587 | spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc); |
588 | spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc, 0); | 588 | spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc); |
589 | 589 | ||
590 | /* Right now, we only fail if class 2 failed */ | 590 | /* Right now, we only fail if class 2 failed */ |
591 | return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; | 591 | return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; |
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index 2275e64f3152..e32446877e78 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c | |||
@@ -300,7 +300,7 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus, | |||
300 | realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3) | 300 | realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3) |
301 | + function; | 301 | + function; |
302 | 302 | ||
303 | return irq_create_mapping(NULL, realirq, IRQ_TYPE_NONE); | 303 | return irq_create_mapping(NULL, realirq); |
304 | } | 304 | } |
305 | 305 | ||
306 | #endif /* CONFIG_PCI */ | 306 | #endif /* CONFIG_PCI */ |
@@ -341,7 +341,7 @@ unsigned int iSeries_get_irq(struct pt_regs *regs) | |||
341 | } | 341 | } |
342 | 342 | ||
343 | static int iseries_irq_host_map(struct irq_host *h, unsigned int virq, | 343 | static int iseries_irq_host_map(struct irq_host *h, unsigned int virq, |
344 | irq_hw_number_t hw, unsigned int flags) | 344 | irq_hw_number_t hw) |
345 | { | 345 | { |
346 | set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq); | 346 | set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq); |
347 | 347 | ||
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index ecc764a3ff3a..fe6b9bff61b9 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c | |||
@@ -215,10 +215,17 @@ static void __init maple_init_IRQ(void) | |||
215 | * in Maple device-tree where the type of the controller is | 215 | * in Maple device-tree where the type of the controller is |
216 | * open-pic and not interrupt-controller | 216 | * open-pic and not interrupt-controller |
217 | */ | 217 | */ |
218 | for_each_node_by_type(np, "open-pic") { | 218 | |
219 | mpic_node = np; | 219 | for_each_node_by_type(np, "interrupt-controller") |
220 | break; | 220 | if (device_is_compatible(np, "open-pic")) { |
221 | } | 221 | mpic_node = np; |
222 | break; | ||
223 | } | ||
224 | if (mpic_node == NULL) | ||
225 | for_each_node_by_type(np, "open-pic") { | ||
226 | mpic_node = np; | ||
227 | break; | ||
228 | } | ||
222 | if (mpic_node == NULL) { | 229 | if (mpic_node == NULL) { |
223 | printk(KERN_ERR | 230 | printk(KERN_ERR |
224 | "Failed to locate the MPIC interrupt controller\n"); | 231 | "Failed to locate the MPIC interrupt controller\n"); |
@@ -245,6 +252,8 @@ static void __init maple_init_IRQ(void) | |||
245 | 252 | ||
246 | /* XXX Maple specific bits */ | 253 | /* XXX Maple specific bits */ |
247 | flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET; | 254 | flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET; |
255 | /* All U3/U4 are big-endian, older SLOF firmware doesn't encode this */ | ||
256 | flags |= MPIC_BIG_ENDIAN; | ||
248 | 257 | ||
249 | /* Setup the openpic driver. More device-tree junks, we hard code no | 258 | /* Setup the openpic driver. More device-tree junks, we hard code no |
250 | * ISUs for now. I'll have to revisit some stuffs with the folks doing | 259 | * ISUs for now. I'll have to revisit some stuffs with the folks doing |
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c index 205b4a392862..afa593a8544a 100644 --- a/arch/powerpc/platforms/powermac/backlight.c +++ b/arch/powerpc/platforms/powermac/backlight.c | |||
@@ -10,11 +10,33 @@ | |||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/fb.h> | 11 | #include <linux/fb.h> |
12 | #include <linux/backlight.h> | 12 | #include <linux/backlight.h> |
13 | #include <linux/adb.h> | ||
14 | #include <linux/pmu.h> | ||
15 | #include <asm/atomic.h> | ||
13 | #include <asm/prom.h> | 16 | #include <asm/prom.h> |
14 | #include <asm/backlight.h> | 17 | #include <asm/backlight.h> |
15 | 18 | ||
16 | #define OLD_BACKLIGHT_MAX 15 | 19 | #define OLD_BACKLIGHT_MAX 15 |
17 | 20 | ||
21 | static void pmac_backlight_key_worker(void *data); | ||
22 | static void pmac_backlight_set_legacy_worker(void *data); | ||
23 | |||
24 | static DECLARE_WORK(pmac_backlight_key_work, pmac_backlight_key_worker, NULL); | ||
25 | static DECLARE_WORK(pmac_backlight_set_legacy_work, pmac_backlight_set_legacy_worker, NULL); | ||
26 | |||
27 | /* Although these variables are used in interrupt context, it makes no sense to | ||
28 | * protect them. No user is able to produce enough key events per second and | ||
29 | * notice the errors that might happen. | ||
30 | */ | ||
31 | static int pmac_backlight_key_queued; | ||
32 | static int pmac_backlight_set_legacy_queued; | ||
33 | |||
34 | /* The via-pmu code allows the backlight to be grabbed, in which case the | ||
35 | * in-kernel control of the brightness needs to be disabled. This should | ||
36 | * only be used by really old PowerBooks. | ||
37 | */ | ||
38 | static atomic_t kernel_backlight_disabled = ATOMIC_INIT(0); | ||
39 | |||
18 | /* Protect the pmac_backlight variable */ | 40 | /* Protect the pmac_backlight variable */ |
19 | DEFINE_MUTEX(pmac_backlight_mutex); | 41 | DEFINE_MUTEX(pmac_backlight_mutex); |
20 | 42 | ||
@@ -72,8 +94,11 @@ int pmac_backlight_curve_lookup(struct fb_info *info, int value) | |||
72 | return level; | 94 | return level; |
73 | } | 95 | } |
74 | 96 | ||
75 | static void pmac_backlight_key(int direction) | 97 | static void pmac_backlight_key_worker(void *data) |
76 | { | 98 | { |
99 | if (atomic_read(&kernel_backlight_disabled)) | ||
100 | return; | ||
101 | |||
77 | mutex_lock(&pmac_backlight_mutex); | 102 | mutex_lock(&pmac_backlight_mutex); |
78 | if (pmac_backlight) { | 103 | if (pmac_backlight) { |
79 | struct backlight_properties *props; | 104 | struct backlight_properties *props; |
@@ -83,7 +108,8 @@ static void pmac_backlight_key(int direction) | |||
83 | props = pmac_backlight->props; | 108 | props = pmac_backlight->props; |
84 | 109 | ||
85 | brightness = props->brightness + | 110 | brightness = props->brightness + |
86 | ((direction?-1:1) * (props->max_brightness / 15)); | 111 | ((pmac_backlight_key_queued?-1:1) * |
112 | (props->max_brightness / 15)); | ||
87 | 113 | ||
88 | if (brightness < 0) | 114 | if (brightness < 0) |
89 | brightness = 0; | 115 | brightness = 0; |
@@ -98,17 +124,20 @@ static void pmac_backlight_key(int direction) | |||
98 | mutex_unlock(&pmac_backlight_mutex); | 124 | mutex_unlock(&pmac_backlight_mutex); |
99 | } | 125 | } |
100 | 126 | ||
101 | void pmac_backlight_key_up() | 127 | /* This function is called in interrupt context */ |
128 | void pmac_backlight_key(int direction) | ||
102 | { | 129 | { |
103 | pmac_backlight_key(0); | 130 | if (atomic_read(&kernel_backlight_disabled)) |
131 | return; | ||
132 | |||
133 | /* we can receive multiple interrupts here, but the scheduled work | ||
134 | * will run only once, with the last value | ||
135 | */ | ||
136 | pmac_backlight_key_queued = direction; | ||
137 | schedule_work(&pmac_backlight_key_work); | ||
104 | } | 138 | } |
105 | 139 | ||
106 | void pmac_backlight_key_down() | 140 | static int __pmac_backlight_set_legacy_brightness(int brightness) |
107 | { | ||
108 | pmac_backlight_key(1); | ||
109 | } | ||
110 | |||
111 | int pmac_backlight_set_legacy_brightness(int brightness) | ||
112 | { | 141 | { |
113 | int error = -ENXIO; | 142 | int error = -ENXIO; |
114 | 143 | ||
@@ -137,6 +166,28 @@ int pmac_backlight_set_legacy_brightness(int brightness) | |||
137 | return error; | 166 | return error; |
138 | } | 167 | } |
139 | 168 | ||
169 | static void pmac_backlight_set_legacy_worker(void *data) | ||
170 | { | ||
171 | if (atomic_read(&kernel_backlight_disabled)) | ||
172 | return; | ||
173 | |||
174 | __pmac_backlight_set_legacy_brightness(pmac_backlight_set_legacy_queued); | ||
175 | } | ||
176 | |||
177 | /* This function is called in interrupt context */ | ||
178 | void pmac_backlight_set_legacy_brightness_pmu(int brightness) { | ||
179 | if (atomic_read(&kernel_backlight_disabled)) | ||
180 | return; | ||
181 | |||
182 | pmac_backlight_set_legacy_queued = brightness; | ||
183 | schedule_work(&pmac_backlight_set_legacy_work); | ||
184 | } | ||
185 | |||
186 | int pmac_backlight_set_legacy_brightness(int brightness) | ||
187 | { | ||
188 | return __pmac_backlight_set_legacy_brightness(brightness); | ||
189 | } | ||
190 | |||
140 | int pmac_backlight_get_legacy_brightness() | 191 | int pmac_backlight_get_legacy_brightness() |
141 | { | 192 | { |
142 | int result = -ENXIO; | 193 | int result = -ENXIO; |
@@ -158,3 +209,17 @@ int pmac_backlight_get_legacy_brightness() | |||
158 | 209 | ||
159 | return result; | 210 | return result; |
160 | } | 211 | } |
212 | |||
213 | void pmac_backlight_disable() | ||
214 | { | ||
215 | atomic_inc(&kernel_backlight_disabled); | ||
216 | } | ||
217 | |||
218 | void pmac_backlight_enable() | ||
219 | { | ||
220 | atomic_dec(&kernel_backlight_disabled); | ||
221 | } | ||
222 | |||
223 | EXPORT_SYMBOL_GPL(pmac_backlight); | ||
224 | EXPORT_SYMBOL_GPL(pmac_backlight_mutex); | ||
225 | EXPORT_SYMBOL_GPL(pmac_has_backlight_type); | ||
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c index c364c89adb4e..167cd3ce8a13 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_64.c +++ b/arch/powerpc/platforms/powermac/cpufreq_64.c | |||
@@ -87,9 +87,9 @@ static int (*g5_query_freq)(void); | |||
87 | static DEFINE_MUTEX(g5_switch_mutex); | 87 | static DEFINE_MUTEX(g5_switch_mutex); |
88 | 88 | ||
89 | 89 | ||
90 | #ifdef CONFIG_PPC_SMU | 90 | #ifdef CONFIG_PMAC_SMU |
91 | 91 | ||
92 | static const u32 *g5_pmode_data; | 92 | static u32 *g5_pmode_data; |
93 | static int g5_pmode_max; | 93 | static int g5_pmode_max; |
94 | 94 | ||
95 | static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */ | 95 | static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */ |
@@ -216,7 +216,7 @@ static void g5_dummy_switch_volt(int speed_mode) | |||
216 | { | 216 | { |
217 | } | 217 | } |
218 | 218 | ||
219 | #endif /* CONFIG_PPC_SMU */ | 219 | #endif /* CONFIG_PMAC_SMU */ |
220 | 220 | ||
221 | /* | 221 | /* |
222 | * Platform function based voltage switching for PowerMac7,2 & 7,3 | 222 | * Platform function based voltage switching for PowerMac7,2 & 7,3 |
@@ -383,7 +383,7 @@ static struct cpufreq_driver g5_cpufreq_driver = { | |||
383 | }; | 383 | }; |
384 | 384 | ||
385 | 385 | ||
386 | #ifdef CONFIG_PPC_SMU | 386 | #ifdef CONFIG_PMAC_SMU |
387 | 387 | ||
388 | static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | 388 | static int __init g5_neo2_cpufreq_init(struct device_node *cpus) |
389 | { | 389 | { |
@@ -535,7 +535,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
535 | return rc; | 535 | return rc; |
536 | } | 536 | } |
537 | 537 | ||
538 | #endif /* CONFIG_PPC_SMU */ | 538 | #endif /* CONFIG_PMAC_SMU */ |
539 | 539 | ||
540 | 540 | ||
541 | static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | 541 | static int __init g5_pm72_cpufreq_init(struct device_node *cpus) |
@@ -731,10 +731,10 @@ static int __init g5_cpufreq_init(void) | |||
731 | machine_is_compatible("PowerMac7,3") || | 731 | machine_is_compatible("PowerMac7,3") || |
732 | machine_is_compatible("RackMac3,1")) | 732 | machine_is_compatible("RackMac3,1")) |
733 | rc = g5_pm72_cpufreq_init(cpus); | 733 | rc = g5_pm72_cpufreq_init(cpus); |
734 | #ifdef CONFIG_PPC_SMU | 734 | #ifdef CONFIG_PMAC_SMU |
735 | else | 735 | else |
736 | rc = g5_neo2_cpufreq_init(cpus); | 736 | rc = g5_neo2_cpufreq_init(cpus); |
737 | #endif /* CONFIG_PPC_SMU */ | 737 | #endif /* CONFIG_PMAC_SMU */ |
738 | 738 | ||
739 | of_node_put(cpus); | 739 | of_node_put(cpus); |
740 | return rc; | 740 | return rc; |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 787ffd999bc2..9923adc5248e 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/bootmem.h> | 18 | #include <linux/bootmem.h> |
19 | #include <linux/irq.h> | ||
19 | 20 | ||
20 | #include <asm/sections.h> | 21 | #include <asm/sections.h> |
21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
@@ -24,10 +25,7 @@ | |||
24 | #include <asm/machdep.h> | 25 | #include <asm/machdep.h> |
25 | #include <asm/pmac_feature.h> | 26 | #include <asm/pmac_feature.h> |
26 | #include <asm/grackle.h> | 27 | #include <asm/grackle.h> |
27 | #ifdef CONFIG_PPC64 | ||
28 | //#include <asm/iommu.h> | ||
29 | #include <asm/ppc-pci.h> | 28 | #include <asm/ppc-pci.h> |
30 | #endif | ||
31 | 29 | ||
32 | #undef DEBUG | 30 | #undef DEBUG |
33 | 31 | ||
@@ -46,7 +44,6 @@ static int has_uninorth; | |||
46 | static struct pci_controller *u3_agp; | 44 | static struct pci_controller *u3_agp; |
47 | static struct pci_controller *u4_pcie; | 45 | static struct pci_controller *u4_pcie; |
48 | static struct pci_controller *u3_ht; | 46 | static struct pci_controller *u3_ht; |
49 | #define has_second_ohare 0 | ||
50 | #else | 47 | #else |
51 | static int has_second_ohare; | 48 | static int has_second_ohare; |
52 | #endif /* CONFIG_PPC64 */ | 49 | #endif /* CONFIG_PPC64 */ |
@@ -996,6 +993,7 @@ void __init pmac_pcibios_fixup(void) | |||
996 | /* Read interrupt from the device-tree */ | 993 | /* Read interrupt from the device-tree */ |
997 | pci_read_irq_line(dev); | 994 | pci_read_irq_line(dev); |
998 | 995 | ||
996 | #ifdef CONFIG_PPC32 | ||
999 | /* Fixup interrupt for the modem/ethernet combo controller. | 997 | /* Fixup interrupt for the modem/ethernet combo controller. |
1000 | * on machines with a second ohare chip. | 998 | * on machines with a second ohare chip. |
1001 | * The number in the device tree (27) is bogus (correct for | 999 | * The number in the device tree (27) is bogus (correct for |
@@ -1005,8 +1003,11 @@ void __init pmac_pcibios_fixup(void) | |||
1005 | */ | 1003 | */ |
1006 | if (has_second_ohare && | 1004 | if (has_second_ohare && |
1007 | dev->vendor == PCI_VENDOR_ID_DEC && | 1005 | dev->vendor == PCI_VENDOR_ID_DEC && |
1008 | dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) | 1006 | dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) { |
1009 | dev->irq = irq_create_mapping(NULL, 60, 0); | 1007 | dev->irq = irq_create_mapping(NULL, 60); |
1008 | set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW); | ||
1009 | } | ||
1010 | #endif /* CONFIG_PPC32 */ | ||
1010 | } | 1011 | } |
1011 | } | 1012 | } |
1012 | 1013 | ||
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 3d328bc1f7e0..060789e31c67 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -291,7 +291,7 @@ static int pmac_pic_host_match(struct irq_host *h, struct device_node *node) | |||
291 | } | 291 | } |
292 | 292 | ||
293 | static int pmac_pic_host_map(struct irq_host *h, unsigned int virq, | 293 | static int pmac_pic_host_map(struct irq_host *h, unsigned int virq, |
294 | irq_hw_number_t hw, unsigned int flags) | 294 | irq_hw_number_t hw) |
295 | { | 295 | { |
296 | struct irq_desc *desc = get_irq_desc(virq); | 296 | struct irq_desc *desc = get_irq_desc(virq); |
297 | int level; | 297 | int level; |
@@ -318,6 +318,7 @@ static int pmac_pic_host_xlate(struct irq_host *h, struct device_node *ct, | |||
318 | unsigned int *out_flags) | 318 | unsigned int *out_flags) |
319 | 319 | ||
320 | { | 320 | { |
321 | *out_flags = IRQ_TYPE_NONE; | ||
321 | *out_hwirq = *intspec; | 322 | *out_hwirq = *intspec; |
322 | return 0; | 323 | return 0; |
323 | } | 324 | } |
@@ -434,7 +435,7 @@ static void __init pmac_pic_probe_oldstyle(void) | |||
434 | 435 | ||
435 | printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); | 436 | printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); |
436 | #ifdef CONFIG_XMON | 437 | #ifdef CONFIG_XMON |
437 | setup_irq(irq_create_mapping(NULL, 20, 0), &xmon_action); | 438 | setup_irq(irq_create_mapping(NULL, 20), &xmon_action); |
438 | #endif | 439 | #endif |
439 | } | 440 | } |
440 | #endif /* CONFIG_PPC32 */ | 441 | #endif /* CONFIG_PPC32 */ |
@@ -579,9 +580,10 @@ void __init pmac_pic_init(void) | |||
579 | flags |= OF_IMAP_OLDWORLD_MAC; | 580 | flags |= OF_IMAP_OLDWORLD_MAC; |
580 | if (get_property(of_chosen, "linux,bootx", NULL) != NULL) | 581 | if (get_property(of_chosen, "linux,bootx", NULL) != NULL) |
581 | flags |= OF_IMAP_NO_PHANDLE; | 582 | flags |= OF_IMAP_NO_PHANDLE; |
582 | of_irq_map_init(flags); | ||
583 | #endif /* CONFIG_PPC_32 */ | 583 | #endif /* CONFIG_PPC_32 */ |
584 | 584 | ||
585 | of_irq_map_init(flags); | ||
586 | |||
585 | /* We first try to detect Apple's new Core99 chipset, since mac-io | 587 | /* We first try to detect Apple's new Core99 chipset, since mac-io |
586 | * is quite different on those machines and contains an IBM MPIC2. | 588 | * is quite different on those machines and contains an IBM MPIC2. |
587 | */ | 589 | */ |
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index 0e6339ee45a1..903115d67fdc 100644 --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c | |||
@@ -93,8 +93,7 @@ static void request_ras_irqs(struct device_node *np, | |||
93 | for (i = 0; i < opicplen; i++) { | 93 | for (i = 0; i < opicplen; i++) { |
94 | if (count > 15) | 94 | if (count > 15) |
95 | break; | 95 | break; |
96 | virqs[count] = irq_create_mapping(NULL, *(opicprop++), | 96 | virqs[count] = irq_create_mapping(NULL, *(opicprop++)); |
97 | IRQ_TYPE_NONE); | ||
98 | if (virqs[count] == NO_IRQ) | 97 | if (virqs[count] == NO_IRQ) |
99 | printk(KERN_ERR "Unable to allocate interrupt " | 98 | printk(KERN_ERR "Unable to allocate interrupt " |
100 | "number for %s\n", np->full_name); | 99 | "number for %s\n", np->full_name); |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 927e0a423b87..de214d86ff44 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -501,7 +501,8 @@ static void pseries_dedicated_idle_sleep(void) | |||
501 | } | 501 | } |
502 | 502 | ||
503 | /* | 503 | /* |
504 | * Cede if the other thread is not idle, so that it can | 504 | * If not SMT, cede processor. If CPU is running SMT |
505 | * cede if the other thread is not idle, so that it can | ||
505 | * go single-threaded. If the other thread is idle, | 506 | * go single-threaded. If the other thread is idle, |
506 | * we ask the hypervisor if it has pending work it | 507 | * we ask the hypervisor if it has pending work it |
507 | * wants to do and cede if it does. Otherwise we keep | 508 | * wants to do and cede if it does. Otherwise we keep |
@@ -514,7 +515,8 @@ static void pseries_dedicated_idle_sleep(void) | |||
514 | * very low priority. The cede enables interrupts, which | 515 | * very low priority. The cede enables interrupts, which |
515 | * doesn't matter here. | 516 | * doesn't matter here. |
516 | */ | 517 | */ |
517 | if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING) | 518 | if (!cpu_has_feature(CPU_FTR_SMT) || !lppaca[cpu ^ 1].idle |
519 | || poll_pending() == H_PENDING) | ||
518 | cede_processor(); | 520 | cede_processor(); |
519 | 521 | ||
520 | out: | 522 | out: |
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index 756421049441..1eab4688be17 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c | |||
@@ -502,16 +502,9 @@ static int xics_host_match(struct irq_host *h, struct device_node *node) | |||
502 | } | 502 | } |
503 | 503 | ||
504 | static int xics_host_map_direct(struct irq_host *h, unsigned int virq, | 504 | static int xics_host_map_direct(struct irq_host *h, unsigned int virq, |
505 | irq_hw_number_t hw, unsigned int flags) | 505 | irq_hw_number_t hw) |
506 | { | 506 | { |
507 | unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; | 507 | pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw); |
508 | |||
509 | pr_debug("xics: map_direct virq %d, hwirq 0x%lx, flags: 0x%x\n", | ||
510 | virq, hw, flags); | ||
511 | |||
512 | if (sense && sense != IRQ_TYPE_LEVEL_LOW) | ||
513 | printk(KERN_WARNING "xics: using unsupported sense 0x%x" | ||
514 | " for irq %d (h: 0x%lx)\n", flags, virq, hw); | ||
515 | 508 | ||
516 | get_irq_desc(virq)->status |= IRQ_LEVEL; | 509 | get_irq_desc(virq)->status |= IRQ_LEVEL; |
517 | set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq); | 510 | set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq); |
@@ -519,16 +512,9 @@ static int xics_host_map_direct(struct irq_host *h, unsigned int virq, | |||
519 | } | 512 | } |
520 | 513 | ||
521 | static int xics_host_map_lpar(struct irq_host *h, unsigned int virq, | 514 | static int xics_host_map_lpar(struct irq_host *h, unsigned int virq, |
522 | irq_hw_number_t hw, unsigned int flags) | 515 | irq_hw_number_t hw) |
523 | { | 516 | { |
524 | unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; | 517 | pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw); |
525 | |||
526 | pr_debug("xics: map_lpar virq %d, hwirq 0x%lx, flags: 0x%x\n", | ||
527 | virq, hw, flags); | ||
528 | |||
529 | if (sense && sense != IRQ_TYPE_LEVEL_LOW) | ||
530 | printk(KERN_WARNING "xics: using unsupported sense 0x%x" | ||
531 | " for irq %d (h: 0x%lx)\n", flags, virq, hw); | ||
532 | 518 | ||
533 | get_irq_desc(virq)->status |= IRQ_LEVEL; | 519 | get_irq_desc(virq)->status |= IRQ_LEVEL; |
534 | set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq); | 520 | set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq); |
@@ -757,7 +743,7 @@ void xics_request_IPIs(void) | |||
757 | { | 743 | { |
758 | unsigned int ipi; | 744 | unsigned int ipi; |
759 | 745 | ||
760 | ipi = irq_create_mapping(xics_host, XICS_IPI, 0); | 746 | ipi = irq_create_mapping(xics_host, XICS_IPI); |
761 | BUG_ON(ipi == NO_IRQ); | 747 | BUG_ON(ipi == NO_IRQ); |
762 | 748 | ||
763 | /* | 749 | /* |
@@ -783,6 +769,14 @@ void xics_teardown_cpu(int secondary) | |||
783 | xics_set_cpu_priority(cpu, 0); | 769 | xics_set_cpu_priority(cpu, 0); |
784 | 770 | ||
785 | /* | 771 | /* |
772 | * Clear IPI | ||
773 | */ | ||
774 | if (firmware_has_feature(FW_FEATURE_LPAR)) | ||
775 | lpar_qirr_info(cpu, 0xff); | ||
776 | else | ||
777 | direct_qirr_info(cpu, 0xff); | ||
778 | |||
779 | /* | ||
786 | * we need to EOI the IPI if we got here from kexec down IPI | 780 | * we need to EOI the IPI if we got here from kexec down IPI |
787 | * | 781 | * |
788 | * probably need to check all the other interrupts too | 782 | * probably need to check all the other interrupts too |
@@ -795,7 +789,7 @@ void xics_teardown_cpu(int secondary) | |||
795 | return; | 789 | return; |
796 | desc = get_irq_desc(ipi); | 790 | desc = get_irq_desc(ipi); |
797 | if (desc->chip && desc->chip->eoi) | 791 | if (desc->chip && desc->chip->eoi) |
798 | desc->chip->eoi(XICS_IPI); | 792 | desc->chip->eoi(ipi); |
799 | 793 | ||
800 | /* | 794 | /* |
801 | * Some machines need to have at least one cpu in the GIQ, | 795 | * Some machines need to have at least one cpu in the GIQ, |
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c index 72c73a6105cd..9855820b9548 100644 --- a/arch/powerpc/sysdev/i8259.c +++ b/arch/powerpc/sysdev/i8259.c | |||
@@ -169,7 +169,7 @@ static int i8259_host_match(struct irq_host *h, struct device_node *node) | |||
169 | } | 169 | } |
170 | 170 | ||
171 | static int i8259_host_map(struct irq_host *h, unsigned int virq, | 171 | static int i8259_host_map(struct irq_host *h, unsigned int virq, |
172 | irq_hw_number_t hw, unsigned int flags) | 172 | irq_hw_number_t hw) |
173 | { | 173 | { |
174 | pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw); | 174 | pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw); |
175 | 175 | ||
@@ -177,7 +177,7 @@ static int i8259_host_map(struct irq_host *h, unsigned int virq, | |||
177 | if (hw == 2) | 177 | if (hw == 2) |
178 | get_irq_desc(virq)->status |= IRQ_NOREQUEST; | 178 | get_irq_desc(virq)->status |= IRQ_NOREQUEST; |
179 | 179 | ||
180 | /* We use the level stuff only for now, we might want to | 180 | /* We use the level handler only for now, we might want to |
181 | * be more cautious here but that works for now | 181 | * be more cautious here but that works for now |
182 | */ | 182 | */ |
183 | get_irq_desc(virq)->status |= IRQ_LEVEL; | 183 | get_irq_desc(virq)->status |= IRQ_LEVEL; |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 9cecebaa0360..6e0281afa6c3 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -204,7 +204,7 @@ static void mpic_startup_ht_interrupt(struct mpic *mpic, unsigned int source, | |||
204 | if (fixup->base == NULL) | 204 | if (fixup->base == NULL) |
205 | return; | 205 | return; |
206 | 206 | ||
207 | DBG("startup_ht_interrupt(%u, %u) index: %d\n", | 207 | DBG("startup_ht_interrupt(0x%x, 0x%x) index: %d\n", |
208 | source, irqflags, fixup->index); | 208 | source, irqflags, fixup->index); |
209 | spin_lock_irqsave(&mpic->fixup_lock, flags); | 209 | spin_lock_irqsave(&mpic->fixup_lock, flags); |
210 | /* Enable and configure */ | 210 | /* Enable and configure */ |
@@ -227,7 +227,7 @@ static void mpic_shutdown_ht_interrupt(struct mpic *mpic, unsigned int source, | |||
227 | if (fixup->base == NULL) | 227 | if (fixup->base == NULL) |
228 | return; | 228 | return; |
229 | 229 | ||
230 | DBG("shutdown_ht_interrupt(%u, %u)\n", source, irqflags); | 230 | DBG("shutdown_ht_interrupt(0x%x, 0x%x)\n", source, irqflags); |
231 | 231 | ||
232 | /* Disable */ | 232 | /* Disable */ |
233 | spin_lock_irqsave(&mpic->fixup_lock, flags); | 233 | spin_lock_irqsave(&mpic->fixup_lock, flags); |
@@ -337,6 +337,17 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic) | |||
337 | } | 337 | } |
338 | } | 338 | } |
339 | 339 | ||
340 | #else /* CONFIG_MPIC_BROKEN_U3 */ | ||
341 | |||
342 | static inline int mpic_is_ht_interrupt(struct mpic *mpic, unsigned int source) | ||
343 | { | ||
344 | return 0; | ||
345 | } | ||
346 | |||
347 | static void __init mpic_scan_ht_pics(struct mpic *mpic) | ||
348 | { | ||
349 | } | ||
350 | |||
340 | #endif /* CONFIG_MPIC_BROKEN_U3 */ | 351 | #endif /* CONFIG_MPIC_BROKEN_U3 */ |
341 | 352 | ||
342 | 353 | ||
@@ -405,11 +416,9 @@ static void mpic_unmask_irq(unsigned int irq) | |||
405 | unsigned int loops = 100000; | 416 | unsigned int loops = 100000; |
406 | struct mpic *mpic = mpic_from_irq(irq); | 417 | struct mpic *mpic = mpic_from_irq(irq); |
407 | unsigned int src = mpic_irq_to_hw(irq); | 418 | unsigned int src = mpic_irq_to_hw(irq); |
408 | unsigned long flags; | ||
409 | 419 | ||
410 | DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); | 420 | DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); |
411 | 421 | ||
412 | spin_lock_irqsave(&mpic_lock, flags); | ||
413 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, | 422 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, |
414 | mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & | 423 | mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & |
415 | ~MPIC_VECPRI_MASK); | 424 | ~MPIC_VECPRI_MASK); |
@@ -420,7 +429,6 @@ static void mpic_unmask_irq(unsigned int irq) | |||
420 | break; | 429 | break; |
421 | } | 430 | } |
422 | } while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK); | 431 | } while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK); |
423 | spin_unlock_irqrestore(&mpic_lock, flags); | ||
424 | } | 432 | } |
425 | 433 | ||
426 | static void mpic_mask_irq(unsigned int irq) | 434 | static void mpic_mask_irq(unsigned int irq) |
@@ -428,11 +436,9 @@ static void mpic_mask_irq(unsigned int irq) | |||
428 | unsigned int loops = 100000; | 436 | unsigned int loops = 100000; |
429 | struct mpic *mpic = mpic_from_irq(irq); | 437 | struct mpic *mpic = mpic_from_irq(irq); |
430 | unsigned int src = mpic_irq_to_hw(irq); | 438 | unsigned int src = mpic_irq_to_hw(irq); |
431 | unsigned long flags; | ||
432 | 439 | ||
433 | DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); | 440 | DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); |
434 | 441 | ||
435 | spin_lock_irqsave(&mpic_lock, flags); | ||
436 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, | 442 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, |
437 | mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) | | 443 | mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) | |
438 | MPIC_VECPRI_MASK); | 444 | MPIC_VECPRI_MASK); |
@@ -444,7 +450,6 @@ static void mpic_mask_irq(unsigned int irq) | |||
444 | break; | 450 | break; |
445 | } | 451 | } |
446 | } while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK)); | 452 | } while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK)); |
447 | spin_unlock_irqrestore(&mpic_lock, flags); | ||
448 | } | 453 | } |
449 | 454 | ||
450 | static void mpic_end_irq(unsigned int irq) | 455 | static void mpic_end_irq(unsigned int irq) |
@@ -512,8 +517,7 @@ static void mpic_end_ht_irq(unsigned int irq) | |||
512 | mpic_ht_end_irq(mpic, src); | 517 | mpic_ht_end_irq(mpic, src); |
513 | mpic_eoi(mpic); | 518 | mpic_eoi(mpic); |
514 | } | 519 | } |
515 | 520 | #endif /* !CONFIG_MPIC_BROKEN_U3 */ | |
516 | #endif /* CONFIG_MPIC_BROKEN_U3 */ | ||
517 | 521 | ||
518 | #ifdef CONFIG_SMP | 522 | #ifdef CONFIG_SMP |
519 | 523 | ||
@@ -560,47 +564,74 @@ static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask) | |||
560 | mpic_physmask(cpus_addr(tmp)[0])); | 564 | mpic_physmask(cpus_addr(tmp)[0])); |
561 | } | 565 | } |
562 | 566 | ||
563 | static unsigned int mpic_flags_to_vecpri(unsigned int flags, int *level) | 567 | static unsigned int mpic_type_to_vecpri(unsigned int type) |
564 | { | 568 | { |
565 | unsigned int vecpri; | ||
566 | |||
567 | /* Now convert sense value */ | 569 | /* Now convert sense value */ |
568 | switch(flags & IRQ_TYPE_SENSE_MASK) { | 570 | switch(type & IRQ_TYPE_SENSE_MASK) { |
569 | case IRQ_TYPE_EDGE_RISING: | 571 | case IRQ_TYPE_EDGE_RISING: |
570 | vecpri = MPIC_VECPRI_SENSE_EDGE | | 572 | return MPIC_VECPRI_SENSE_EDGE | MPIC_VECPRI_POLARITY_POSITIVE; |
571 | MPIC_VECPRI_POLARITY_POSITIVE; | ||
572 | *level = 0; | ||
573 | break; | ||
574 | case IRQ_TYPE_EDGE_FALLING: | 573 | case IRQ_TYPE_EDGE_FALLING: |
575 | vecpri = MPIC_VECPRI_SENSE_EDGE | | 574 | case IRQ_TYPE_EDGE_BOTH: |
576 | MPIC_VECPRI_POLARITY_NEGATIVE; | 575 | return MPIC_VECPRI_SENSE_EDGE | MPIC_VECPRI_POLARITY_NEGATIVE; |
577 | *level = 0; | ||
578 | break; | ||
579 | case IRQ_TYPE_LEVEL_HIGH: | 576 | case IRQ_TYPE_LEVEL_HIGH: |
580 | vecpri = MPIC_VECPRI_SENSE_LEVEL | | 577 | return MPIC_VECPRI_SENSE_LEVEL | MPIC_VECPRI_POLARITY_POSITIVE; |
581 | MPIC_VECPRI_POLARITY_POSITIVE; | ||
582 | *level = 1; | ||
583 | break; | ||
584 | case IRQ_TYPE_LEVEL_LOW: | 578 | case IRQ_TYPE_LEVEL_LOW: |
585 | default: | 579 | default: |
586 | vecpri = MPIC_VECPRI_SENSE_LEVEL | | 580 | return MPIC_VECPRI_SENSE_LEVEL | MPIC_VECPRI_POLARITY_NEGATIVE; |
587 | MPIC_VECPRI_POLARITY_NEGATIVE; | ||
588 | *level = 1; | ||
589 | } | 581 | } |
590 | return vecpri; | 582 | } |
583 | |||
584 | static int mpic_set_irq_type(unsigned int virq, unsigned int flow_type) | ||
585 | { | ||
586 | struct mpic *mpic = mpic_from_irq(virq); | ||
587 | unsigned int src = mpic_irq_to_hw(virq); | ||
588 | struct irq_desc *desc = get_irq_desc(virq); | ||
589 | unsigned int vecpri, vold, vnew; | ||
590 | |||
591 | DBG("mpic: set_irq_type(mpic:@%p,virq:%d,src:0x%x,type:0x%x)\n", | ||
592 | mpic, virq, src, flow_type); | ||
593 | |||
594 | if (src >= mpic->irq_count) | ||
595 | return -EINVAL; | ||
596 | |||
597 | if (flow_type == IRQ_TYPE_NONE) | ||
598 | if (mpic->senses && src < mpic->senses_count) | ||
599 | flow_type = mpic->senses[src]; | ||
600 | if (flow_type == IRQ_TYPE_NONE) | ||
601 | flow_type = IRQ_TYPE_LEVEL_LOW; | ||
602 | |||
603 | desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); | ||
604 | desc->status |= flow_type & IRQ_TYPE_SENSE_MASK; | ||
605 | if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) | ||
606 | desc->status |= IRQ_LEVEL; | ||
607 | |||
608 | if (mpic_is_ht_interrupt(mpic, src)) | ||
609 | vecpri = MPIC_VECPRI_POLARITY_POSITIVE | | ||
610 | MPIC_VECPRI_SENSE_EDGE; | ||
611 | else | ||
612 | vecpri = mpic_type_to_vecpri(flow_type); | ||
613 | |||
614 | vold = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI); | ||
615 | vnew = vold & ~(MPIC_VECPRI_POLARITY_MASK | MPIC_VECPRI_SENSE_MASK); | ||
616 | vnew |= vecpri; | ||
617 | if (vold != vnew) | ||
618 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, vnew); | ||
619 | |||
620 | return 0; | ||
591 | } | 621 | } |
592 | 622 | ||
593 | static struct irq_chip mpic_irq_chip = { | 623 | static struct irq_chip mpic_irq_chip = { |
594 | .mask = mpic_mask_irq, | 624 | .mask = mpic_mask_irq, |
595 | .unmask = mpic_unmask_irq, | 625 | .unmask = mpic_unmask_irq, |
596 | .eoi = mpic_end_irq, | 626 | .eoi = mpic_end_irq, |
627 | .set_type = mpic_set_irq_type, | ||
597 | }; | 628 | }; |
598 | 629 | ||
599 | #ifdef CONFIG_SMP | 630 | #ifdef CONFIG_SMP |
600 | static struct irq_chip mpic_ipi_chip = { | 631 | static struct irq_chip mpic_ipi_chip = { |
601 | .mask = mpic_mask_ipi, | 632 | .mask = mpic_mask_ipi, |
602 | .unmask = mpic_unmask_ipi, | 633 | .unmask = mpic_unmask_ipi, |
603 | .eoi = mpic_end_ipi, | 634 | .eoi = mpic_end_ipi, |
604 | }; | 635 | }; |
605 | #endif /* CONFIG_SMP */ | 636 | #endif /* CONFIG_SMP */ |
606 | 637 | ||
@@ -611,6 +642,7 @@ static struct irq_chip mpic_irq_ht_chip = { | |||
611 | .mask = mpic_mask_irq, | 642 | .mask = mpic_mask_irq, |
612 | .unmask = mpic_unmask_ht_irq, | 643 | .unmask = mpic_unmask_ht_irq, |
613 | .eoi = mpic_end_ht_irq, | 644 | .eoi = mpic_end_ht_irq, |
645 | .set_type = mpic_set_irq_type, | ||
614 | }; | 646 | }; |
615 | #endif /* CONFIG_MPIC_BROKEN_U3 */ | 647 | #endif /* CONFIG_MPIC_BROKEN_U3 */ |
616 | 648 | ||
@@ -624,26 +656,21 @@ static int mpic_host_match(struct irq_host *h, struct device_node *node) | |||
624 | } | 656 | } |
625 | 657 | ||
626 | static int mpic_host_map(struct irq_host *h, unsigned int virq, | 658 | static int mpic_host_map(struct irq_host *h, unsigned int virq, |
627 | irq_hw_number_t hw, unsigned int flags) | 659 | irq_hw_number_t hw) |
628 | { | 660 | { |
629 | struct irq_desc *desc = get_irq_desc(virq); | ||
630 | struct irq_chip *chip; | ||
631 | struct mpic *mpic = h->host_data; | 661 | struct mpic *mpic = h->host_data; |
632 | u32 v, vecpri = MPIC_VECPRI_SENSE_LEVEL | | 662 | struct irq_chip *chip; |
633 | MPIC_VECPRI_POLARITY_NEGATIVE; | ||
634 | int level; | ||
635 | unsigned long iflags; | ||
636 | 663 | ||
637 | pr_debug("mpic: map virq %d, hwirq 0x%lx, flags: 0x%x\n", | 664 | DBG("mpic: map virq %d, hwirq 0x%lx\n", virq, hw); |
638 | virq, hw, flags); | ||
639 | 665 | ||
640 | if (hw == MPIC_VEC_SPURRIOUS) | 666 | if (hw == MPIC_VEC_SPURRIOUS) |
641 | return -EINVAL; | 667 | return -EINVAL; |
668 | |||
642 | #ifdef CONFIG_SMP | 669 | #ifdef CONFIG_SMP |
643 | else if (hw >= MPIC_VEC_IPI_0) { | 670 | else if (hw >= MPIC_VEC_IPI_0) { |
644 | WARN_ON(!(mpic->flags & MPIC_PRIMARY)); | 671 | WARN_ON(!(mpic->flags & MPIC_PRIMARY)); |
645 | 672 | ||
646 | pr_debug("mpic: mapping as IPI\n"); | 673 | DBG("mpic: mapping as IPI\n"); |
647 | set_irq_chip_data(virq, mpic); | 674 | set_irq_chip_data(virq, mpic); |
648 | set_irq_chip_and_handler(virq, &mpic->hc_ipi, | 675 | set_irq_chip_and_handler(virq, &mpic->hc_ipi, |
649 | handle_percpu_irq); | 676 | handle_percpu_irq); |
@@ -654,44 +681,23 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq, | |||
654 | if (hw >= mpic->irq_count) | 681 | if (hw >= mpic->irq_count) |
655 | return -EINVAL; | 682 | return -EINVAL; |
656 | 683 | ||
657 | /* If no sense provided, check default sense array */ | 684 | /* Default chip */ |
658 | if (((flags & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_NONE) && | ||
659 | mpic->senses && hw < mpic->senses_count) | ||
660 | flags |= mpic->senses[hw]; | ||
661 | |||
662 | vecpri = mpic_flags_to_vecpri(flags, &level); | ||
663 | if (level) | ||
664 | desc->status |= IRQ_LEVEL; | ||
665 | chip = &mpic->hc_irq; | 685 | chip = &mpic->hc_irq; |
666 | 686 | ||
667 | #ifdef CONFIG_MPIC_BROKEN_U3 | 687 | #ifdef CONFIG_MPIC_BROKEN_U3 |
668 | /* Check for HT interrupts, override vecpri */ | 688 | /* Check for HT interrupts, override vecpri */ |
669 | if (mpic_is_ht_interrupt(mpic, hw)) { | 689 | if (mpic_is_ht_interrupt(mpic, hw)) |
670 | vecpri &= ~(MPIC_VECPRI_SENSE_MASK | | ||
671 | MPIC_VECPRI_POLARITY_MASK); | ||
672 | vecpri |= MPIC_VECPRI_POLARITY_POSITIVE; | ||
673 | chip = &mpic->hc_ht_irq; | 690 | chip = &mpic->hc_ht_irq; |
674 | } | 691 | #endif /* CONFIG_MPIC_BROKEN_U3 */ |
675 | #endif | ||
676 | 692 | ||
677 | /* Reconfigure irq. We must preserve the mask bit as we can be called | 693 | DBG("mpic: mapping to irq chip @%p\n", chip); |
678 | * while the interrupt is still active (This may change in the future | ||
679 | * but for now, it is the case). | ||
680 | */ | ||
681 | spin_lock_irqsave(&mpic_lock, iflags); | ||
682 | v = mpic_irq_read(hw, MPIC_IRQ_VECTOR_PRI); | ||
683 | vecpri = (v & | ||
684 | ~(MPIC_VECPRI_POLARITY_MASK | MPIC_VECPRI_SENSE_MASK)) | | ||
685 | vecpri; | ||
686 | if (vecpri != v) | ||
687 | mpic_irq_write(hw, MPIC_IRQ_VECTOR_PRI, vecpri); | ||
688 | spin_unlock_irqrestore(&mpic_lock, iflags); | ||
689 | |||
690 | pr_debug("mpic: mapping as IRQ, vecpri = 0x%08x (was 0x%08x)\n", | ||
691 | vecpri, v); | ||
692 | 694 | ||
693 | set_irq_chip_data(virq, mpic); | 695 | set_irq_chip_data(virq, mpic); |
694 | set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq); | 696 | set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq); |
697 | |||
698 | /* Set default irq type */ | ||
699 | set_irq_type(virq, IRQ_TYPE_NONE); | ||
700 | |||
695 | return 0; | 701 | return 0; |
696 | } | 702 | } |
697 | 703 | ||
@@ -708,11 +714,28 @@ static int mpic_host_xlate(struct irq_host *h, struct device_node *ct, | |||
708 | }; | 714 | }; |
709 | 715 | ||
710 | *out_hwirq = intspec[0]; | 716 | *out_hwirq = intspec[0]; |
711 | if (intsize > 1 && intspec[1] < 4) | 717 | if (intsize > 1) { |
712 | *out_flags = map_mpic_senses[intspec[1]]; | 718 | u32 mask = 0x3; |
713 | else | 719 | |
720 | /* Apple invented a new race of encoding on machines with | ||
721 | * an HT APIC. They encode, among others, the index within | ||
722 | * the HT APIC. We don't care about it here since thankfully, | ||
723 | * it appears that they have the APIC already properly | ||
724 | * configured, and thus our current fixup code that reads the | ||
725 | * APIC config works fine. However, we still need to mask out | ||
726 | * bits in the specifier to make sure we only get bit 0 which | ||
727 | * is the level/edge bit (the only sense bit exposed by Apple), | ||
728 | * as their bit 1 means something else. | ||
729 | */ | ||
730 | if (machine_is(powermac)) | ||
731 | mask = 0x1; | ||
732 | *out_flags = map_mpic_senses[intspec[1] & mask]; | ||
733 | } else | ||
714 | *out_flags = IRQ_TYPE_NONE; | 734 | *out_flags = IRQ_TYPE_NONE; |
715 | 735 | ||
736 | DBG("mpic: xlate (%d cells: 0x%08x 0x%08x) to line 0x%lx sense 0x%x\n", | ||
737 | intsize, intspec[0], intspec[1], *out_hwirq, *out_flags); | ||
738 | |||
716 | return 0; | 739 | return 0; |
717 | } | 740 | } |
718 | 741 | ||
@@ -906,41 +929,16 @@ void __init mpic_init(struct mpic *mpic) | |||
906 | if (mpic->irq_count == 0) | 929 | if (mpic->irq_count == 0) |
907 | mpic->irq_count = mpic->num_sources; | 930 | mpic->irq_count = mpic->num_sources; |
908 | 931 | ||
909 | #ifdef CONFIG_MPIC_BROKEN_U3 | ||
910 | /* Do the HT PIC fixups on U3 broken mpic */ | 932 | /* Do the HT PIC fixups on U3 broken mpic */ |
911 | DBG("MPIC flags: %x\n", mpic->flags); | 933 | DBG("MPIC flags: %x\n", mpic->flags); |
912 | if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY)) | 934 | if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY)) |
913 | mpic_scan_ht_pics(mpic); | 935 | mpic_scan_ht_pics(mpic); |
914 | #endif /* CONFIG_MPIC_BROKEN_U3 */ | ||
915 | 936 | ||
916 | for (i = 0; i < mpic->num_sources; i++) { | 937 | for (i = 0; i < mpic->num_sources; i++) { |
917 | /* start with vector = source number, and masked */ | 938 | /* start with vector = source number, and masked */ |
918 | u32 vecpri = MPIC_VECPRI_MASK | i | (8 << MPIC_VECPRI_PRIORITY_SHIFT); | 939 | u32 vecpri = MPIC_VECPRI_MASK | i | |
919 | int level = 1; | 940 | (8 << MPIC_VECPRI_PRIORITY_SHIFT); |
920 | 941 | ||
921 | /* do senses munging */ | ||
922 | if (mpic->senses && i < mpic->senses_count) | ||
923 | vecpri |= mpic_flags_to_vecpri(mpic->senses[i], | ||
924 | &level); | ||
925 | else | ||
926 | vecpri |= MPIC_VECPRI_SENSE_LEVEL; | ||
927 | |||
928 | /* deal with broken U3 */ | ||
929 | if (mpic->flags & MPIC_BROKEN_U3) { | ||
930 | #ifdef CONFIG_MPIC_BROKEN_U3 | ||
931 | if (mpic_is_ht_interrupt(mpic, i)) { | ||
932 | vecpri &= ~(MPIC_VECPRI_SENSE_MASK | | ||
933 | MPIC_VECPRI_POLARITY_MASK); | ||
934 | vecpri |= MPIC_VECPRI_POLARITY_POSITIVE; | ||
935 | } | ||
936 | #else | ||
937 | printk(KERN_ERR "mpic: BROKEN_U3 set, but CONFIG doesn't match\n"); | ||
938 | #endif | ||
939 | } | ||
940 | |||
941 | DBG("setup source %d, vecpri: %08x, level: %d\n", i, vecpri, | ||
942 | (level != 0)); | ||
943 | |||
944 | /* init hw */ | 942 | /* init hw */ |
945 | mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri); | 943 | mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri); |
946 | mpic_irq_write(i, MPIC_IRQ_DESTINATION, | 944 | mpic_irq_write(i, MPIC_IRQ_DESTINATION, |
@@ -1154,7 +1152,7 @@ void mpic_request_ipis(void) | |||
1154 | 1152 | ||
1155 | for (i = 0; i < 4; i++) { | 1153 | for (i = 0; i < 4; i++) { |
1156 | unsigned int vipi = irq_create_mapping(mpic->irqhost, | 1154 | unsigned int vipi = irq_create_mapping(mpic->irqhost, |
1157 | MPIC_VEC_IPI_0 + i, 0); | 1155 | MPIC_VEC_IPI_0 + i); |
1158 | if (vipi == NO_IRQ) { | 1156 | if (vipi == NO_IRQ) { |
1159 | printk(KERN_ERR "Failed to map IPI %d\n", i); | 1157 | printk(KERN_ERR "Failed to map IPI %d\n", i); |
1160 | break; | 1158 | break; |