diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-03 22:06:19 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-03 22:06:19 -0400 |
commit | 3c8c7b2f32c52b259daa7564fefd582146799b23 (patch) | |
tree | 59ff1ad0d6b7821d474d8fccafd884703684b6d7 /arch/ppc64 | |
parent | 7cb3cd090c2725b80561958a362c2ba15a7a8c86 (diff) | |
parent | 9123e0d78990246304fe681167b8d8097f1e02d7 (diff) |
Merge branch 'upstream-fixes'
Diffstat (limited to 'arch/ppc64')
-rw-r--r-- | arch/ppc64/kernel/bpa_iommu.c | 6 | ||||
-rw-r--r-- | arch/ppc64/kernel/kprobes.c | 8 | ||||
-rw-r--r-- | arch/ppc64/kernel/machine_kexec.c | 1 | ||||
-rw-r--r-- | arch/ppc64/kernel/of_device.c | 7 | ||||
-rw-r--r-- | arch/ppc64/kernel/pSeries_iommu.c | 16 | ||||
-rw-r--r-- | arch/ppc64/kernel/pmac_setup.c | 18 | ||||
-rw-r--r-- | arch/ppc64/kernel/pmac_time.c | 4 | ||||
-rw-r--r-- | arch/ppc64/kernel/ptrace.c | 1 | ||||
-rw-r--r-- | arch/ppc64/mm/hash_native.c | 6 | ||||
-rw-r--r-- | arch/ppc64/mm/hugetlbpage.c | 7 | ||||
-rw-r--r-- | arch/ppc64/mm/tlb.c | 4 |
11 files changed, 49 insertions, 29 deletions
diff --git a/arch/ppc64/kernel/bpa_iommu.c b/arch/ppc64/kernel/bpa_iommu.c index f33a7bccb0d7..507eb9d0223f 100644 --- a/arch/ppc64/kernel/bpa_iommu.c +++ b/arch/ppc64/kernel/bpa_iommu.c | |||
@@ -99,7 +99,11 @@ get_iost_entry(unsigned long iopt_base, unsigned long io_address, unsigned page_ | |||
99 | break; | 99 | break; |
100 | 100 | ||
101 | default: /* not a known compile time constant */ | 101 | default: /* not a known compile time constant */ |
102 | BUILD_BUG_ON(1); | 102 | { |
103 | /* BUILD_BUG_ON() is not usable here */ | ||
104 | extern void __get_iost_entry_bad_page_size(void); | ||
105 | __get_iost_entry_bad_page_size(); | ||
106 | } | ||
103 | break; | 107 | break; |
104 | } | 108 | } |
105 | 109 | ||
diff --git a/arch/ppc64/kernel/kprobes.c b/arch/ppc64/kernel/kprobes.c index 7e80d49c589a..9c6facc24f70 100644 --- a/arch/ppc64/kernel/kprobes.c +++ b/arch/ppc64/kernel/kprobes.c | |||
@@ -59,9 +59,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) | |||
59 | 59 | ||
60 | /* insn must be on a special executable page on ppc64 */ | 60 | /* insn must be on a special executable page on ppc64 */ |
61 | if (!ret) { | 61 | if (!ret) { |
62 | up(&kprobe_mutex); | ||
63 | p->ainsn.insn = get_insn_slot(); | ||
64 | down(&kprobe_mutex); | 62 | down(&kprobe_mutex); |
63 | p->ainsn.insn = get_insn_slot(); | ||
64 | up(&kprobe_mutex); | ||
65 | if (!p->ainsn.insn) | 65 | if (!p->ainsn.insn) |
66 | ret = -ENOMEM; | 66 | ret = -ENOMEM; |
67 | } | 67 | } |
@@ -90,9 +90,9 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p) | |||
90 | 90 | ||
91 | void __kprobes arch_remove_kprobe(struct kprobe *p) | 91 | void __kprobes arch_remove_kprobe(struct kprobe *p) |
92 | { | 92 | { |
93 | up(&kprobe_mutex); | ||
94 | free_insn_slot(p->ainsn.insn); | ||
95 | down(&kprobe_mutex); | 93 | down(&kprobe_mutex); |
94 | free_insn_slot(p->ainsn.insn); | ||
95 | up(&kprobe_mutex); | ||
96 | } | 96 | } |
97 | 97 | ||
98 | static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | 98 | static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) |
diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c index 4775f12a013c..bf7cc4f8210f 100644 --- a/arch/ppc64/kernel/machine_kexec.c +++ b/arch/ppc64/kernel/machine_kexec.c | |||
@@ -205,6 +205,7 @@ static void kexec_prepare_cpus(void) | |||
205 | continue; | 205 | continue; |
206 | 206 | ||
207 | while (paca[i].hw_cpu_id != -1) { | 207 | while (paca[i].hw_cpu_id != -1) { |
208 | barrier(); | ||
208 | if (!cpu_possible(i)) { | 209 | if (!cpu_possible(i)) { |
209 | printk("kexec: cpu %d hw_cpu_id %d is not" | 210 | printk("kexec: cpu %d hw_cpu_id %d is not" |
210 | " possible, ignoring\n", | 211 | " possible, ignoring\n", |
diff --git a/arch/ppc64/kernel/of_device.c b/arch/ppc64/kernel/of_device.c index da580812ddfe..9f200f0f2ad5 100644 --- a/arch/ppc64/kernel/of_device.c +++ b/arch/ppc64/kernel/of_device.c | |||
@@ -233,7 +233,9 @@ void of_device_unregister(struct of_device *ofdev) | |||
233 | device_unregister(&ofdev->dev); | 233 | device_unregister(&ofdev->dev); |
234 | } | 234 | } |
235 | 235 | ||
236 | struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id) | 236 | struct of_device* of_platform_device_create(struct device_node *np, |
237 | const char *bus_id, | ||
238 | struct device *parent) | ||
237 | { | 239 | { |
238 | struct of_device *dev; | 240 | struct of_device *dev; |
239 | 241 | ||
@@ -245,7 +247,7 @@ struct of_device* of_platform_device_create(struct device_node *np, const char * | |||
245 | dev->node = np; | 247 | dev->node = np; |
246 | dev->dma_mask = 0xffffffffUL; | 248 | dev->dma_mask = 0xffffffffUL; |
247 | dev->dev.dma_mask = &dev->dma_mask; | 249 | dev->dev.dma_mask = &dev->dma_mask; |
248 | dev->dev.parent = NULL; | 250 | dev->dev.parent = parent; |
249 | dev->dev.bus = &of_platform_bus_type; | 251 | dev->dev.bus = &of_platform_bus_type; |
250 | dev->dev.release = of_release_dev; | 252 | dev->dev.release = of_release_dev; |
251 | 253 | ||
@@ -259,6 +261,7 @@ struct of_device* of_platform_device_create(struct device_node *np, const char * | |||
259 | return dev; | 261 | return dev; |
260 | } | 262 | } |
261 | 263 | ||
264 | |||
262 | EXPORT_SYMBOL(of_match_device); | 265 | EXPORT_SYMBOL(of_match_device); |
263 | EXPORT_SYMBOL(of_platform_bus_type); | 266 | EXPORT_SYMBOL(of_platform_bus_type); |
264 | EXPORT_SYMBOL(of_register_driver); | 267 | EXPORT_SYMBOL(of_register_driver); |
diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c index 8c6313e7e145..d17f0108a032 100644 --- a/arch/ppc64/kernel/pSeries_iommu.c +++ b/arch/ppc64/kernel/pSeries_iommu.c | |||
@@ -364,7 +364,8 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus) | |||
364 | 364 | ||
365 | while (pci->phb->dma_window_size * children > 0x80000000ul) | 365 | while (pci->phb->dma_window_size * children > 0x80000000ul) |
366 | pci->phb->dma_window_size >>= 1; | 366 | pci->phb->dma_window_size >>= 1; |
367 | DBG("No ISA/IDE, window size is %x\n", pci->phb->dma_window_size); | 367 | DBG("No ISA/IDE, window size is 0x%lx\n", |
368 | pci->phb->dma_window_size); | ||
368 | pci->phb->dma_window_base_cur = 0; | 369 | pci->phb->dma_window_base_cur = 0; |
369 | 370 | ||
370 | return; | 371 | return; |
@@ -388,7 +389,7 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus) | |||
388 | while (pci->phb->dma_window_size * children > 0x70000000ul) | 389 | while (pci->phb->dma_window_size * children > 0x70000000ul) |
389 | pci->phb->dma_window_size >>= 1; | 390 | pci->phb->dma_window_size >>= 1; |
390 | 391 | ||
391 | DBG("ISA/IDE, window size is %x\n", pci->phb->dma_window_size); | 392 | DBG("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size); |
392 | 393 | ||
393 | } | 394 | } |
394 | 395 | ||
@@ -442,7 +443,7 @@ static void iommu_dev_setup_pSeries(struct pci_dev *dev) | |||
442 | struct device_node *dn, *mydn; | 443 | struct device_node *dn, *mydn; |
443 | struct iommu_table *tbl; | 444 | struct iommu_table *tbl; |
444 | 445 | ||
445 | DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, dev->pretty_name); | 446 | DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, pci_name(dev)); |
446 | 447 | ||
447 | mydn = dn = pci_device_to_OF_node(dev); | 448 | mydn = dn = pci_device_to_OF_node(dev); |
448 | 449 | ||
@@ -469,7 +470,7 @@ static void iommu_dev_setup_pSeries(struct pci_dev *dev) | |||
469 | if (dn && dn->data) { | 470 | if (dn && dn->data) { |
470 | PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table; | 471 | PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table; |
471 | } else { | 472 | } else { |
472 | DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, dev->pretty_name); | 473 | DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, pci_name(dev)); |
473 | } | 474 | } |
474 | } | 475 | } |
475 | 476 | ||
@@ -503,7 +504,7 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev) | |||
503 | int *dma_window = NULL; | 504 | int *dma_window = NULL; |
504 | struct pci_dn *pci; | 505 | struct pci_dn *pci; |
505 | 506 | ||
506 | DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, dev->pretty_name); | 507 | DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, pci_name(dev)); |
507 | 508 | ||
508 | /* dev setup for LPAR is a little tricky, since the device tree might | 509 | /* dev setup for LPAR is a little tricky, since the device tree might |
509 | * contain the dma-window properties per-device and not neccesarily | 510 | * contain the dma-window properties per-device and not neccesarily |
@@ -525,9 +526,8 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev) | |||
525 | * slots on POWER4 machines. | 526 | * slots on POWER4 machines. |
526 | */ | 527 | */ |
527 | if (dma_window == NULL || pdn->parent == NULL) { | 528 | if (dma_window == NULL || pdn->parent == NULL) { |
528 | /* Fall back to regular (non-LPAR) dev setup */ | 529 | DBG("No dma window for device, linking to parent\n"); |
529 | DBG("No dma window for device, falling back to regular setup\n"); | 530 | PCI_DN(dn)->iommu_table = PCI_DN(pdn)->iommu_table; |
530 | iommu_dev_setup_pSeries(dev); | ||
531 | return; | 531 | return; |
532 | } else { | 532 | } else { |
533 | DBG("Found DMA window, allocating table\n"); | 533 | DBG("Found DMA window, allocating table\n"); |
diff --git a/arch/ppc64/kernel/pmac_setup.c b/arch/ppc64/kernel/pmac_setup.c index 325426c7bed0..25755252067a 100644 --- a/arch/ppc64/kernel/pmac_setup.c +++ b/arch/ppc64/kernel/pmac_setup.c | |||
@@ -434,15 +434,23 @@ static int pmac_check_legacy_ioport(unsigned int baseport) | |||
434 | 434 | ||
435 | static int __init pmac_declare_of_platform_devices(void) | 435 | static int __init pmac_declare_of_platform_devices(void) |
436 | { | 436 | { |
437 | struct device_node *np; | 437 | struct device_node *np, *npp; |
438 | 438 | ||
439 | np = find_devices("u3"); | 439 | npp = of_find_node_by_name(NULL, "u3"); |
440 | if (np) { | 440 | if (npp) { |
441 | for (np = np->child; np != NULL; np = np->sibling) | 441 | for (np = NULL; (np = of_get_next_child(npp, np)) != NULL;) { |
442 | if (strncmp(np->name, "i2c", 3) == 0) { | 442 | if (strncmp(np->name, "i2c", 3) == 0) { |
443 | of_platform_device_create(np, "u3-i2c"); | 443 | of_platform_device_create(np, "u3-i2c", NULL); |
444 | of_node_put(np); | ||
444 | break; | 445 | break; |
445 | } | 446 | } |
447 | } | ||
448 | of_node_put(npp); | ||
449 | } | ||
450 | npp = of_find_node_by_type(NULL, "smu"); | ||
451 | if (npp) { | ||
452 | of_platform_device_create(npp, "smu", NULL); | ||
453 | of_node_put(npp); | ||
446 | } | 454 | } |
447 | 455 | ||
448 | return 0; | 456 | return 0; |
diff --git a/arch/ppc64/kernel/pmac_time.c b/arch/ppc64/kernel/pmac_time.c index 3059edb09cc8..41bbb8c59697 100644 --- a/arch/ppc64/kernel/pmac_time.c +++ b/arch/ppc64/kernel/pmac_time.c | |||
@@ -84,7 +84,7 @@ void __pmac pmac_get_rtc_time(struct rtc_time *tm) | |||
84 | 84 | ||
85 | #ifdef CONFIG_PMAC_SMU | 85 | #ifdef CONFIG_PMAC_SMU |
86 | case SYS_CTRLER_SMU: | 86 | case SYS_CTRLER_SMU: |
87 | smu_get_rtc_time(tm); | 87 | smu_get_rtc_time(tm, 1); |
88 | break; | 88 | break; |
89 | #endif /* CONFIG_PMAC_SMU */ | 89 | #endif /* CONFIG_PMAC_SMU */ |
90 | default: | 90 | default: |
@@ -128,7 +128,7 @@ int __pmac pmac_set_rtc_time(struct rtc_time *tm) | |||
128 | 128 | ||
129 | #ifdef CONFIG_PMAC_SMU | 129 | #ifdef CONFIG_PMAC_SMU |
130 | case SYS_CTRLER_SMU: | 130 | case SYS_CTRLER_SMU: |
131 | return smu_set_rtc_time(tm); | 131 | return smu_set_rtc_time(tm, 1); |
132 | #endif /* CONFIG_PMAC_SMU */ | 132 | #endif /* CONFIG_PMAC_SMU */ |
133 | default: | 133 | default: |
134 | return -ENODEV; | 134 | return -ENODEV; |
diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c index 85ed3188a91d..b1c044ca5756 100644 --- a/arch/ppc64/kernel/ptrace.c +++ b/arch/ppc64/kernel/ptrace.c | |||
@@ -219,6 +219,7 @@ int sys_ptrace(long request, long pid, long addr, long data) | |||
219 | 219 | ||
220 | case PTRACE_SET_DEBUGREG: | 220 | case PTRACE_SET_DEBUGREG: |
221 | ret = ptrace_set_debugreg(child, addr, data); | 221 | ret = ptrace_set_debugreg(child, addr, data); |
222 | break; | ||
222 | 223 | ||
223 | case PTRACE_DETACH: | 224 | case PTRACE_DETACH: |
224 | ret = ptrace_detach(child, data); | 225 | ret = ptrace_detach(child, data); |
diff --git a/arch/ppc64/mm/hash_native.c b/arch/ppc64/mm/hash_native.c index 7626bb59954d..bfd385b7713c 100644 --- a/arch/ppc64/mm/hash_native.c +++ b/arch/ppc64/mm/hash_native.c | |||
@@ -343,9 +343,7 @@ static void native_flush_hash_range(unsigned long context, | |||
343 | hpte_t *hptep; | 343 | hpte_t *hptep; |
344 | unsigned long hpte_v; | 344 | unsigned long hpte_v; |
345 | struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); | 345 | struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); |
346 | 346 | unsigned long large = batch->large; | |
347 | /* XXX fix for large ptes */ | ||
348 | unsigned long large = 0; | ||
349 | 347 | ||
350 | local_irq_save(flags); | 348 | local_irq_save(flags); |
351 | 349 | ||
@@ -407,7 +405,7 @@ static void native_flush_hash_range(unsigned long context, | |||
407 | asm volatile("ptesync":::"memory"); | 405 | asm volatile("ptesync":::"memory"); |
408 | 406 | ||
409 | for (i = 0; i < j; i++) | 407 | for (i = 0; i < j; i++) |
410 | __tlbie(batch->vaddr[i], 0); | 408 | __tlbie(batch->vaddr[i], large); |
411 | 409 | ||
412 | asm volatile("eieio; tlbsync; ptesync":::"memory"); | 410 | asm volatile("eieio; tlbsync; ptesync":::"memory"); |
413 | 411 | ||
diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c index 338771ec70d7..0ea0994ed974 100644 --- a/arch/ppc64/mm/hugetlbpage.c +++ b/arch/ppc64/mm/hugetlbpage.c | |||
@@ -710,10 +710,13 @@ repeat: | |||
710 | hpte_group = ((~hash & htab_hash_mask) * | 710 | hpte_group = ((~hash & htab_hash_mask) * |
711 | HPTES_PER_GROUP) & ~0x7UL; | 711 | HPTES_PER_GROUP) & ~0x7UL; |
712 | slot = ppc_md.hpte_insert(hpte_group, va, prpn, | 712 | slot = ppc_md.hpte_insert(hpte_group, va, prpn, |
713 | HPTE_V_LARGE, rflags); | 713 | HPTE_V_LARGE | |
714 | HPTE_V_SECONDARY, | ||
715 | rflags); | ||
714 | if (slot == -1) { | 716 | if (slot == -1) { |
715 | if (mftb() & 0x1) | 717 | if (mftb() & 0x1) |
716 | hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; | 718 | hpte_group = ((hash & htab_hash_mask) * |
719 | HPTES_PER_GROUP)&~0x7UL; | ||
717 | 720 | ||
718 | ppc_md.hpte_remove(hpte_group); | 721 | ppc_md.hpte_remove(hpte_group); |
719 | goto repeat; | 722 | goto repeat; |
diff --git a/arch/ppc64/mm/tlb.c b/arch/ppc64/mm/tlb.c index d8a6593a13f0..21fbffb23a43 100644 --- a/arch/ppc64/mm/tlb.c +++ b/arch/ppc64/mm/tlb.c | |||
@@ -143,7 +143,8 @@ void hpte_update(struct mm_struct *mm, unsigned long addr, | |||
143 | * up scanning and resetting referenced bits then our batch context | 143 | * up scanning and resetting referenced bits then our batch context |
144 | * will change mid stream. | 144 | * will change mid stream. |
145 | */ | 145 | */ |
146 | if (unlikely(i != 0 && context != batch->context)) { | 146 | if (i != 0 && (context != batch->context || |
147 | batch->large != pte_huge(pte))) { | ||
147 | flush_tlb_pending(); | 148 | flush_tlb_pending(); |
148 | i = 0; | 149 | i = 0; |
149 | } | 150 | } |
@@ -151,6 +152,7 @@ void hpte_update(struct mm_struct *mm, unsigned long addr, | |||
151 | if (i == 0) { | 152 | if (i == 0) { |
152 | batch->context = context; | 153 | batch->context = context; |
153 | batch->mm = mm; | 154 | batch->mm = mm; |
155 | batch->large = pte_huge(pte); | ||
154 | } | 156 | } |
155 | batch->pte[i] = __pte(pte); | 157 | batch->pte[i] = __pte(pte); |
156 | batch->addr[i] = addr; | 158 | batch->addr[i] = addr; |