aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-18 09:31:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-18 09:31:43 -0400
commit0a95d92c0054e74fb79607ac2df958b7bf295706 (patch)
treee2c5f836e799dcfd72904949be47595af91432e7 /arch/powerpc/kernel
parent08351fc6a75731226e1112fc7254542bd3a2912e (diff)
parent831532035b12a5f7b600515a6f4da0b207b82d6e (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (62 commits) powerpc/85xx: Fix signedness bug in cache-sram powerpc/fsl: 85xx: document cache sram bindings powerpc/fsl: define binding for fsl mpic interrupt controllers powerpc/fsl_msi: Handle msi-available-ranges better drivers/serial/ucc_uart.c: Add of_node_put to avoid memory leak powerpc/85xx: Fix SPE float to integer conversion failure powerpc/85xx: Update sata controller compatible for p1022ds board ATA: Add FSL sata v2 controller support powerpc/mpc8xxx_gpio: simplify searching for 'fsl, qoriq-gpio' compatiable powerpc/8xx: remove obsolete mgsuvd board powerpc/82xx: rename and update mgcoge board support powerpc/83xx: rename and update kmeter1 powerpc/85xx: Workaroudn e500 CPU erratum A005 powerpc/fsl_pci: Add support for FSL PCIe controllers v2.x powerpc/85xx: Fix writing to spin table 'cpu-release-addr' on ppc64e powerpc/pseries: Disable MSI using new interface if possible powerpc: Enable GENERIC_HARDIRQS_NO_DEPRECATED. powerpc: core irq_data conversion. powerpc: sysdev/xilinx_intc irq_data conversion. powerpc: sysdev/uic irq_data conversion. ... Fix up conflicts in arch/powerpc/sysdev/fsl_msi.c (due to getting rid of of_platform_driver in arch/powerpc)
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/cputable.c22
-rw-r--r--arch/powerpc/kernel/irq.c55
-rw-r--r--arch/powerpc/kernel/machine_kexec.c21
-rw-r--r--arch/powerpc/kernel/nvram_64.c31
-rw-r--r--arch/powerpc/kernel/prom.c2
-rw-r--r--arch/powerpc/kernel/rtasd.c3
6 files changed, 85 insertions, 49 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index e8e915ce3d8d..c9b68d07ac4f 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1811,11 +1811,11 @@ static struct cpu_spec __initdata cpu_specs[] = {
1811 .machine_check = machine_check_440A, 1811 .machine_check = machine_check_440A,
1812 .platform = "ppc440", 1812 .platform = "ppc440",
1813 }, 1813 },
1814 { /* 476 core */ 1814 { /* 476 DD2 core */
1815 .pvr_mask = 0xffff0000, 1815 .pvr_mask = 0xffffffff,
1816 .pvr_value = 0x11a50000, 1816 .pvr_value = 0x11a52080,
1817 .cpu_name = "476", 1817 .cpu_name = "476",
1818 .cpu_features = CPU_FTRS_47X, 1818 .cpu_features = CPU_FTRS_47X | CPU_FTR_476_DD2,
1819 .cpu_user_features = COMMON_USER_BOOKE | 1819 .cpu_user_features = COMMON_USER_BOOKE |
1820 PPC_FEATURE_HAS_FPU, 1820 PPC_FEATURE_HAS_FPU,
1821 .mmu_features = MMU_FTR_TYPE_47x | 1821 .mmu_features = MMU_FTR_TYPE_47x |
@@ -1839,6 +1839,20 @@ static struct cpu_spec __initdata cpu_specs[] = {
1839 .machine_check = machine_check_47x, 1839 .machine_check = machine_check_47x,
1840 .platform = "ppc470", 1840 .platform = "ppc470",
1841 }, 1841 },
1842 { /* 476 others */
1843 .pvr_mask = 0xffff0000,
1844 .pvr_value = 0x11a50000,
1845 .cpu_name = "476",
1846 .cpu_features = CPU_FTRS_47X,
1847 .cpu_user_features = COMMON_USER_BOOKE |
1848 PPC_FEATURE_HAS_FPU,
1849 .mmu_features = MMU_FTR_TYPE_47x |
1850 MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
1851 .icache_bsize = 32,
1852 .dcache_bsize = 128,
1853 .machine_check = machine_check_47x,
1854 .platform = "ppc470",
1855 },
1842 { /* default match */ 1856 { /* default match */
1843 .pvr_mask = 0x00000000, 1857 .pvr_mask = 0x00000000,
1844 .pvr_value = 0x00000000, 1858 .pvr_value = 0x00000000,
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index ce557f6f00fc..0a5570338b96 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -237,6 +237,7 @@ int show_interrupts(struct seq_file *p, void *v)
237 int i = *(loff_t *) v, j, prec; 237 int i = *(loff_t *) v, j, prec;
238 struct irqaction *action; 238 struct irqaction *action;
239 struct irq_desc *desc; 239 struct irq_desc *desc;
240 struct irq_chip *chip;
240 241
241 if (i > nr_irqs) 242 if (i > nr_irqs)
242 return 0; 243 return 0;
@@ -270,8 +271,9 @@ int show_interrupts(struct seq_file *p, void *v)
270 for_each_online_cpu(j) 271 for_each_online_cpu(j)
271 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 272 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
272 273
273 if (desc->chip) 274 chip = get_irq_desc_chip(desc);
274 seq_printf(p, " %-16s", desc->chip->name); 275 if (chip)
276 seq_printf(p, " %-16s", chip->name);
275 else 277 else
276 seq_printf(p, " %-16s", "None"); 278 seq_printf(p, " %-16s", "None");
277 seq_printf(p, " %-8s", (desc->status & IRQ_LEVEL) ? "Level" : "Edge"); 279 seq_printf(p, " %-8s", (desc->status & IRQ_LEVEL) ? "Level" : "Edge");
@@ -313,6 +315,8 @@ void fixup_irqs(const struct cpumask *map)
313 alloc_cpumask_var(&mask, GFP_KERNEL); 315 alloc_cpumask_var(&mask, GFP_KERNEL);
314 316
315 for_each_irq(irq) { 317 for_each_irq(irq) {
318 struct irq_chip *chip;
319
316 desc = irq_to_desc(irq); 320 desc = irq_to_desc(irq);
317 if (!desc) 321 if (!desc)
318 continue; 322 continue;
@@ -320,13 +324,15 @@ void fixup_irqs(const struct cpumask *map)
320 if (desc->status & IRQ_PER_CPU) 324 if (desc->status & IRQ_PER_CPU)
321 continue; 325 continue;
322 326
323 cpumask_and(mask, desc->affinity, map); 327 chip = get_irq_desc_chip(desc);
328
329 cpumask_and(mask, desc->irq_data.affinity, map);
324 if (cpumask_any(mask) >= nr_cpu_ids) { 330 if (cpumask_any(mask) >= nr_cpu_ids) {
325 printk("Breaking affinity for irq %i\n", irq); 331 printk("Breaking affinity for irq %i\n", irq);
326 cpumask_copy(mask, map); 332 cpumask_copy(mask, map);
327 } 333 }
328 if (desc->chip->set_affinity) 334 if (chip->irq_set_affinity)
329 desc->chip->set_affinity(irq, mask); 335 chip->irq_set_affinity(&desc->irq_data, mask, true);
330 else if (desc->action && !(warned++)) 336 else if (desc->action && !(warned++))
331 printk("Cannot set affinity for irq %i\n", irq); 337 printk("Cannot set affinity for irq %i\n", irq);
332 } 338 }
@@ -678,16 +684,15 @@ void irq_set_virq_count(unsigned int count)
678static int irq_setup_virq(struct irq_host *host, unsigned int virq, 684static int irq_setup_virq(struct irq_host *host, unsigned int virq,
679 irq_hw_number_t hwirq) 685 irq_hw_number_t hwirq)
680{ 686{
681 struct irq_desc *desc; 687 int res;
682 688
683 desc = irq_to_desc_alloc_node(virq, 0); 689 res = irq_alloc_desc_at(virq, 0);
684 if (!desc) { 690 if (res != virq) {
685 pr_debug("irq: -> allocating desc failed\n"); 691 pr_debug("irq: -> allocating desc failed\n");
686 goto error; 692 goto error;
687 } 693 }
688 694
689 /* Clear IRQ_NOREQUEST flag */ 695 irq_clear_status_flags(virq, IRQ_NOREQUEST);
690 desc->status &= ~IRQ_NOREQUEST;
691 696
692 /* map it */ 697 /* map it */
693 smp_wmb(); 698 smp_wmb();
@@ -696,11 +701,13 @@ static int irq_setup_virq(struct irq_host *host, unsigned int virq,
696 701
697 if (host->ops->map(host, virq, hwirq)) { 702 if (host->ops->map(host, virq, hwirq)) {
698 pr_debug("irq: -> mapping failed, freeing\n"); 703 pr_debug("irq: -> mapping failed, freeing\n");
699 goto error; 704 goto errdesc;
700 } 705 }
701 706
702 return 0; 707 return 0;
703 708
709errdesc:
710 irq_free_descs(virq, 1);
704error: 711error:
705 irq_free_virt(virq, 1); 712 irq_free_virt(virq, 1);
706 return -1; 713 return -1;
@@ -879,9 +886,9 @@ void irq_dispose_mapping(unsigned int virq)
879 smp_mb(); 886 smp_mb();
880 irq_map[virq].hwirq = host->inval_irq; 887 irq_map[virq].hwirq = host->inval_irq;
881 888
882 /* Set some flags */ 889 irq_set_status_flags(virq, IRQ_NOREQUEST);
883 irq_to_desc(virq)->status |= IRQ_NOREQUEST;
884 890
891 irq_free_descs(virq, 1);
885 /* Free it */ 892 /* Free it */
886 irq_free_virt(virq, 1); 893 irq_free_virt(virq, 1);
887} 894}
@@ -1074,21 +1081,6 @@ void irq_free_virt(unsigned int virq, unsigned int count)
1074 1081
1075int arch_early_irq_init(void) 1082int arch_early_irq_init(void)
1076{ 1083{
1077 struct irq_desc *desc;
1078 int i;
1079
1080 for (i = 0; i < NR_IRQS; i++) {
1081 desc = irq_to_desc(i);
1082 if (desc)
1083 desc->status |= IRQ_NOREQUEST;
1084 }
1085
1086 return 0;
1087}
1088
1089int arch_init_chip_data(struct irq_desc *desc, int node)
1090{
1091 desc->status |= IRQ_NOREQUEST;
1092 return 0; 1084 return 0;
1093} 1085}
1094 1086
@@ -1159,11 +1151,14 @@ static int virq_debug_show(struct seq_file *m, void *private)
1159 raw_spin_lock_irqsave(&desc->lock, flags); 1151 raw_spin_lock_irqsave(&desc->lock, flags);
1160 1152
1161 if (desc->action && desc->action->handler) { 1153 if (desc->action && desc->action->handler) {
1154 struct irq_chip *chip;
1155
1162 seq_printf(m, "%5d ", i); 1156 seq_printf(m, "%5d ", i);
1163 seq_printf(m, "0x%05lx ", virq_to_hw(i)); 1157 seq_printf(m, "0x%05lx ", virq_to_hw(i));
1164 1158
1165 if (desc->chip && desc->chip->name) 1159 chip = get_irq_desc_chip(desc);
1166 p = desc->chip->name; 1160 if (chip && chip->name)
1161 p = chip->name;
1167 else 1162 else
1168 p = none; 1163 p = none;
1169 seq_printf(m, "%-15s ", p); 1164 seq_printf(m, "%-15s ", p);
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index a5f8672eeff3..bd1e1ff17b2d 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -26,20 +26,23 @@ void machine_kexec_mask_interrupts(void) {
26 26
27 for_each_irq(i) { 27 for_each_irq(i) {
28 struct irq_desc *desc = irq_to_desc(i); 28 struct irq_desc *desc = irq_to_desc(i);
29 struct irq_chip *chip;
29 30
30 if (!desc || !desc->chip) 31 if (!desc)
31 continue; 32 continue;
32 33
33 if (desc->chip->eoi && 34 chip = get_irq_desc_chip(desc);
34 desc->status & IRQ_INPROGRESS) 35 if (!chip)
35 desc->chip->eoi(i); 36 continue;
37
38 if (chip->irq_eoi && desc->status & IRQ_INPROGRESS)
39 chip->irq_eoi(&desc->irq_data);
36 40
37 if (desc->chip->mask) 41 if (chip->irq_mask)
38 desc->chip->mask(i); 42 chip->irq_mask(&desc->irq_data);
39 43
40 if (desc->chip->disable && 44 if (chip->irq_disable && !(desc->status & IRQ_DISABLED))
41 !(desc->status & IRQ_DISABLED)) 45 chip->irq_disable(&desc->irq_data);
42 desc->chip->disable(i);
43 } 46 }
44} 47}
45 48
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index bb12b3248f13..bec1e930ed73 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -237,22 +237,45 @@ static unsigned char __init nvram_checksum(struct nvram_header *p)
237 return c_sum; 237 return c_sum;
238} 238}
239 239
240/*
241 * Per the criteria passed via nvram_remove_partition(), should this
242 * partition be removed? 1=remove, 0=keep
243 */
244static int nvram_can_remove_partition(struct nvram_partition *part,
245 const char *name, int sig, const char *exceptions[])
246{
247 if (part->header.signature != sig)
248 return 0;
249 if (name) {
250 if (strncmp(name, part->header.name, 12))
251 return 0;
252 } else if (exceptions) {
253 const char **except;
254 for (except = exceptions; *except; except++) {
255 if (!strncmp(*except, part->header.name, 12))
256 return 0;
257 }
258 }
259 return 1;
260}
261
240/** 262/**
241 * nvram_remove_partition - Remove one or more partitions in nvram 263 * nvram_remove_partition - Remove one or more partitions in nvram
242 * @name: name of the partition to remove, or NULL for a 264 * @name: name of the partition to remove, or NULL for a
243 * signature only match 265 * signature only match
244 * @sig: signature of the partition(s) to remove 266 * @sig: signature of the partition(s) to remove
267 * @exceptions: When removing all partitions with a matching signature,
268 * leave these alone.
245 */ 269 */
246 270
247int __init nvram_remove_partition(const char *name, int sig) 271int __init nvram_remove_partition(const char *name, int sig,
272 const char *exceptions[])
248{ 273{
249 struct nvram_partition *part, *prev, *tmp; 274 struct nvram_partition *part, *prev, *tmp;
250 int rc; 275 int rc;
251 276
252 list_for_each_entry(part, &nvram_partitions, partition) { 277 list_for_each_entry(part, &nvram_partitions, partition) {
253 if (part->header.signature != sig) 278 if (!nvram_can_remove_partition(part, name, sig, exceptions))
254 continue;
255 if (name && strncmp(name, part->header.name, 12))
256 continue; 279 continue;
257 280
258 /* Make partition a free partition */ 281 /* Make partition a free partition */
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 7185f0da7dc3..05b7139d6a27 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -97,7 +97,7 @@ static void __init move_device_tree(void)
97 start = __pa(initial_boot_params); 97 start = __pa(initial_boot_params);
98 size = be32_to_cpu(initial_boot_params->totalsize); 98 size = be32_to_cpu(initial_boot_params->totalsize);
99 99
100 if ((memory_limit && (start + size) > memory_limit) || 100 if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
101 overlaps_crashkernel(start, size)) { 101 overlaps_crashkernel(start, size)) {
102 p = __va(memblock_alloc(size, PAGE_SIZE)); 102 p = __va(memblock_alloc(size, PAGE_SIZE));
103 memcpy(p, initial_boot_params, size); 103 memcpy(p, initial_boot_params, size);
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index 049dbecb5dbc..7980ec0e1e1a 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -412,7 +412,8 @@ static void rtas_event_scan(struct work_struct *w)
412 412
413 get_online_cpus(); 413 get_online_cpus();
414 414
415 cpu = cpumask_next(smp_processor_id(), cpu_online_mask); 415 /* raw_ OK because just using CPU as starting point. */
416 cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
416 if (cpu >= nr_cpu_ids) { 417 if (cpu >= nr_cpu_ids) {
417 cpu = cpumask_first(cpu_online_mask); 418 cpu = cpumask_first(cpu_online_mask);
418 419