diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/spu_base.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index a8fa1eeeb174..269dda4fd0b4 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -111,7 +111,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea) | |||
111 | extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); //XXX | 111 | extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); //XXX |
112 | static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr) | 112 | static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr) |
113 | { | 113 | { |
114 | pr_debug("%s\n", __FUNCTION__); | 114 | pr_debug("%s, %lx, %lx\n", __FUNCTION__, dsisr, ea); |
115 | 115 | ||
116 | /* Handle kernel space hash faults immediately. | 116 | /* Handle kernel space hash faults immediately. |
117 | User hash faults need to be deferred to process context. */ | 117 | User hash faults need to be deferred to process context. */ |
@@ -168,7 +168,7 @@ static int __spu_trap_halt(struct spu *spu) | |||
168 | static int __spu_trap_tag_group(struct spu *spu) | 168 | static int __spu_trap_tag_group(struct spu *spu) |
169 | { | 169 | { |
170 | pr_debug("%s\n", __FUNCTION__); | 170 | pr_debug("%s\n", __FUNCTION__); |
171 | /* wake_up(&spu->dma_wq); */ | 171 | spu->mfc_callback(spu); |
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
@@ -242,6 +242,8 @@ spu_irq_class_1(int irq, void *data, struct pt_regs *regs) | |||
242 | spu_mfc_dsisr_set(spu, 0ul); | 242 | spu_mfc_dsisr_set(spu, 0ul); |
243 | spu_int_stat_clear(spu, 1, stat); | 243 | spu_int_stat_clear(spu, 1, stat); |
244 | spin_unlock(&spu->register_lock); | 244 | spin_unlock(&spu->register_lock); |
245 | pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat, | ||
246 | dar, dsisr); | ||
245 | 247 | ||
246 | if (stat & 1) /* segment fault */ | 248 | if (stat & 1) /* segment fault */ |
247 | __spu_trap_data_seg(spu, dar); | 249 | __spu_trap_data_seg(spu, dar); |
@@ -484,14 +486,13 @@ int spu_irq_class_1_bottom(struct spu *spu) | |||
484 | 486 | ||
485 | ea = spu->dar; | 487 | ea = spu->dar; |
486 | dsisr = spu->dsisr; | 488 | dsisr = spu->dsisr; |
487 | if (dsisr & MFC_DSISR_PTE_NOT_FOUND) { | 489 | if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)) { |
488 | access = (_PAGE_PRESENT | _PAGE_USER); | 490 | access = (_PAGE_PRESENT | _PAGE_USER); |
489 | access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL; | 491 | access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL; |
490 | if (hash_page(ea, access, 0x300) != 0) | 492 | if (hash_page(ea, access, 0x300) != 0) |
491 | error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; | 493 | error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; |
492 | } | 494 | } |
493 | if ((error & CLASS1_ENABLE_STORAGE_FAULT_INTR) || | 495 | if (error & CLASS1_ENABLE_STORAGE_FAULT_INTR) { |
494 | (dsisr & MFC_DSISR_ACCESS_DENIED)) { | ||
495 | if ((ret = spu_handle_mm_fault(spu)) != 0) | 496 | if ((ret = spu_handle_mm_fault(spu)) != 0) |
496 | error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; | 497 | error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; |
497 | else | 498 | else |
@@ -568,6 +569,11 @@ static int __init spu_map_device(struct spu *spu, struct device_node *spe) | |||
568 | if (!spu->local_store) | 569 | if (!spu->local_store) |
569 | goto out; | 570 | goto out; |
570 | 571 | ||
572 | prop = get_property(spe, "problem", NULL); | ||
573 | if (!prop) | ||
574 | goto out_unmap; | ||
575 | spu->problem_phys = *(unsigned long *)prop; | ||
576 | |||
571 | spu->problem= map_spe_prop(spe, "problem"); | 577 | spu->problem= map_spe_prop(spe, "problem"); |
572 | if (!spu->problem) | 578 | if (!spu->problem) |
573 | goto out_unmap; | 579 | goto out_unmap; |
@@ -632,6 +638,7 @@ static int __init create_spu(struct device_node *spe) | |||
632 | spu->ibox_callback = NULL; | 638 | spu->ibox_callback = NULL; |
633 | spu->wbox_callback = NULL; | 639 | spu->wbox_callback = NULL; |
634 | spu->stop_callback = NULL; | 640 | spu->stop_callback = NULL; |
641 | spu->mfc_callback = NULL; | ||
635 | 642 | ||
636 | mutex_lock(&spu_mutex); | 643 | mutex_lock(&spu_mutex); |
637 | spu->number = number++; | 644 | spu->number = number++; |