aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r--arch/powerpc/platforms/cell/Kconfig33
-rw-r--r--arch/powerpc/platforms/cell/Makefile2
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c4
-rw-r--r--arch/powerpc/platforms/cell/io-workarounds.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c9
-rw-r--r--arch/powerpc/platforms/cell/qpace_setup.c15
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c2
-rw-r--r--arch/powerpc/platforms/cell/spu_fault.c48
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c20
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c5
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c3
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h8
14 files changed, 86 insertions, 73 deletions
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
index 5cc3279559a4..40e24c39ad06 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -23,7 +23,7 @@ config PPC_CELL_NATIVE
23 23
24config PPC_IBM_CELL_BLADE 24config PPC_IBM_CELL_BLADE
25 bool "IBM Cell Blade" 25 bool "IBM Cell Blade"
26 depends on PPC_MULTIPLATFORM && PPC64 26 depends on PPC64 && PPC_BOOK3S
27 select PPC_CELL_NATIVE 27 select PPC_CELL_NATIVE
28 select MMIO_NVRAM 28 select MMIO_NVRAM
29 select PPC_UDBG_16550 29 select PPC_UDBG_16550
@@ -31,7 +31,7 @@ config PPC_IBM_CELL_BLADE
31 31
32config PPC_CELLEB 32config PPC_CELLEB
33 bool "Toshiba's Cell Reference Set 'Celleb' Architecture" 33 bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
34 depends on PPC_MULTIPLATFORM && PPC64 34 depends on PPC64 && PPC_BOOK3S
35 select PPC_CELL_NATIVE 35 select PPC_CELL_NATIVE
36 select HAS_TXX9_SERIAL 36 select HAS_TXX9_SERIAL
37 select PPC_UDBG_BEAT 37 select PPC_UDBG_BEAT
@@ -40,9 +40,14 @@ config PPC_CELLEB
40 40
41config PPC_CELL_QPACE 41config PPC_CELL_QPACE
42 bool "IBM Cell - QPACE" 42 bool "IBM Cell - QPACE"
43 depends on PPC_MULTIPLATFORM && PPC64 43 depends on PPC64 && PPC_BOOK3S
44 select PPC_CELL_COMMON 44 select PPC_CELL_COMMON
45 45
46config AXON_MSI
47 bool
48 depends on PPC_IBM_CELL_BLADE && PCI_MSI
49 default y
50
46menu "Cell Broadband Engine options" 51menu "Cell Broadband Engine options"
47 depends on PPC_CELL 52 depends on PPC_CELL
48 53
@@ -98,7 +103,7 @@ config PPC_IBM_CELL_RESETBUTTON
98 103
99config PPC_IBM_CELL_POWERBUTTON 104config PPC_IBM_CELL_POWERBUTTON
100 tristate "IBM Cell Blade power button" 105 tristate "IBM Cell Blade power button"
101 depends on PPC_IBM_CELL_BLADE && PPC_PMI && INPUT_EVDEV 106 depends on PPC_IBM_CELL_BLADE && INPUT_EVDEV
102 default y 107 default y
103 help 108 help
104 Support Powerbutton on IBM Cell blades. 109 Support Powerbutton on IBM Cell blades.
@@ -118,9 +123,9 @@ config CBE_CPUFREQ
118 For details, take a look at <file:Documentation/cpu-freq/>. 123 For details, take a look at <file:Documentation/cpu-freq/>.
119 If you don't have such processor, say N 124 If you don't have such processor, say N
120 125
121config CBE_CPUFREQ_PMI 126config CBE_CPUFREQ_PMI_ENABLE
122 tristate "CBE frequency scaling using PMI interface" 127 bool "CBE frequency scaling using PMI interface"
123 depends on CBE_CPUFREQ && PPC_PMI && EXPERIMENTAL 128 depends on CBE_CPUFREQ && EXPERIMENTAL
124 default n 129 default n
125 help 130 help
126 Select this, if you want to use the PMI interface 131 Select this, if you want to use the PMI interface
@@ -128,6 +133,20 @@ config CBE_CPUFREQ_PMI
128 processor will not only be able to run at lower speed, 133 processor will not only be able to run at lower speed,
129 but also at lower core voltage. 134 but also at lower core voltage.
130 135
136config CBE_CPUFREQ_PMI
137 tristate
138 depends on CBE_CPUFREQ_PMI_ENABLE
139 default CBE_CPUFREQ
140
141config PPC_PMI
142 tristate
143 default y
144 depends on CBE_CPUFREQ_PMI || PPC_IBM_CELL_POWERBUTTON
145 help
146 PMI (Platform Management Interrupt) is a way to
147 communicate with the BMC (Baseboard Management Controller).
148 It is used in some IBM Cell blades.
149
131config CBE_CPUFREQ_SPU_GOVERNOR 150config CBE_CPUFREQ_SPU_GOVERNOR
132 tristate "CBE frequency scaling based on SPU usage" 151 tristate "CBE frequency scaling based on SPU usage"
133 depends on SPU_FS && CPU_FREQ 152 depends on SPU_FS && CPU_FREQ
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile
index 43eccb270301..83fafe922641 100644
--- a/arch/powerpc/platforms/cell/Makefile
+++ b/arch/powerpc/platforms/cell/Makefile
@@ -28,7 +28,7 @@ obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \
28 $(spu-manage-y) \ 28 $(spu-manage-y) \
29 spufs/ 29 spufs/
30 30
31obj-$(CONFIG_PCI_MSI) += axon_msi.o 31obj-$(CONFIG_AXON_MSI) += axon_msi.o
32 32
33# qpace setup 33# qpace setup
34obj-$(CONFIG_PPC_CELL_QPACE) += qpace_setup.o 34obj-$(CONFIG_PPC_CELL_QPACE) += qpace_setup.o
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 28c04dab2633..882e47080e74 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -237,8 +237,6 @@ extern int noirqdebug;
237 237
238static void handle_iic_irq(unsigned int irq, struct irq_desc *desc) 238static void handle_iic_irq(unsigned int irq, struct irq_desc *desc)
239{ 239{
240 const unsigned int cpu = smp_processor_id();
241
242 spin_lock(&desc->lock); 240 spin_lock(&desc->lock);
243 241
244 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); 242 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
@@ -254,7 +252,7 @@ static void handle_iic_irq(unsigned int irq, struct irq_desc *desc)
254 goto out_eoi; 252 goto out_eoi;
255 } 253 }
256 254
257 kstat_cpu(cpu).irqs[irq]++; 255 kstat_incr_irqs_this_cpu(irq, desc);
258 256
259 /* Mark the IRQ currently in progress.*/ 257 /* Mark the IRQ currently in progress.*/
260 desc->status |= IRQ_INPROGRESS; 258 desc->status |= IRQ_INPROGRESS;
diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
index 059cad6c3f69..5c1118e31940 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.c
+++ b/arch/powerpc/platforms/cell/io-workarounds.c
@@ -131,10 +131,10 @@ static const struct ppc_pci_io __devinitconst iowa_pci_io = {
131}; 131};
132 132
133static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size, 133static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
134 unsigned long flags) 134 unsigned long flags, void *caller)
135{ 135{
136 struct iowa_bus *bus; 136 struct iowa_bus *bus;
137 void __iomem *res = __ioremap(addr, size, flags); 137 void __iomem *res = __ioremap_caller(addr, size, flags, caller);
138 int busno; 138 int busno;
139 139
140 bus = iowa_pci_find(0, (unsigned long)addr); 140 bus = iowa_pci_find(0, (unsigned long)addr);
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index ee5033eddf01..5744527a7f2a 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -74,7 +74,7 @@
74#define IOC_IO_ExcpStat_V 0x8000000000000000ul 74#define IOC_IO_ExcpStat_V 0x8000000000000000ul
75#define IOC_IO_ExcpStat_SPF_Mask 0x6000000000000000ul 75#define IOC_IO_ExcpStat_SPF_Mask 0x6000000000000000ul
76#define IOC_IO_ExcpStat_SPF_S 0x6000000000000000ul 76#define IOC_IO_ExcpStat_SPF_S 0x6000000000000000ul
77#define IOC_IO_ExcpStat_SPF_P 0x4000000000000000ul 77#define IOC_IO_ExcpStat_SPF_P 0x2000000000000000ul
78#define IOC_IO_ExcpStat_ADDR_Mask 0x00000007fffff000ul 78#define IOC_IO_ExcpStat_ADDR_Mask 0x00000007fffff000ul
79#define IOC_IO_ExcpStat_RW_Mask 0x0000000000000800ul 79#define IOC_IO_ExcpStat_RW_Mask 0x0000000000000800ul
80#define IOC_IO_ExcpStat_IOID_Mask 0x00000000000007fful 80#define IOC_IO_ExcpStat_IOID_Mask 0x00000000000007fful
@@ -247,17 +247,18 @@ static void tce_free_cell(struct iommu_table *tbl, long index, long npages)
247 247
248static irqreturn_t ioc_interrupt(int irq, void *data) 248static irqreturn_t ioc_interrupt(int irq, void *data)
249{ 249{
250 unsigned long stat; 250 unsigned long stat, spf;
251 struct cbe_iommu *iommu = data; 251 struct cbe_iommu *iommu = data;
252 252
253 stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat); 253 stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat);
254 spf = stat & IOC_IO_ExcpStat_SPF_Mask;
254 255
255 /* Might want to rate limit it */ 256 /* Might want to rate limit it */
256 printk(KERN_ERR "iommu: DMA exception 0x%016lx\n", stat); 257 printk(KERN_ERR "iommu: DMA exception 0x%016lx\n", stat);
257 printk(KERN_ERR " V=%d, SPF=[%c%c], RW=%s, IOID=0x%04x\n", 258 printk(KERN_ERR " V=%d, SPF=[%c%c], RW=%s, IOID=0x%04x\n",
258 !!(stat & IOC_IO_ExcpStat_V), 259 !!(stat & IOC_IO_ExcpStat_V),
259 (stat & IOC_IO_ExcpStat_SPF_S) ? 'S' : ' ', 260 (spf == IOC_IO_ExcpStat_SPF_S) ? 'S' : ' ',
260 (stat & IOC_IO_ExcpStat_SPF_P) ? 'P' : ' ', 261 (spf == IOC_IO_ExcpStat_SPF_P) ? 'P' : ' ',
261 (stat & IOC_IO_ExcpStat_RW_Mask) ? "Read" : "Write", 262 (stat & IOC_IO_ExcpStat_RW_Mask) ? "Read" : "Write",
262 (unsigned int)(stat & IOC_IO_ExcpStat_IOID_Mask)); 263 (unsigned int)(stat & IOC_IO_ExcpStat_IOID_Mask));
263 printk(KERN_ERR " page=0x%016lx\n", 264 printk(KERN_ERR " page=0x%016lx\n",
diff --git a/arch/powerpc/platforms/cell/qpace_setup.c b/arch/powerpc/platforms/cell/qpace_setup.c
index be84e6a16b30..c5ce02e84c8e 100644
--- a/arch/powerpc/platforms/cell/qpace_setup.c
+++ b/arch/powerpc/platforms/cell/qpace_setup.c
@@ -81,16 +81,6 @@ static int __init qpace_publish_devices(void)
81} 81}
82machine_subsys_initcall(qpace, qpace_publish_devices); 82machine_subsys_initcall(qpace, qpace_publish_devices);
83 83
84extern int qpace_notify(struct device *dev)
85{
86 /* set dma_ops for of_platform bus */
87 if (dev->bus && dev->bus->name
88 && !strcmp(dev->bus->name, "of_platform"))
89 set_dma_ops(dev, &dma_direct_ops);
90
91 return 0;
92}
93
94static void __init qpace_setup_arch(void) 84static void __init qpace_setup_arch(void)
95{ 85{
96#ifdef CONFIG_SPU_BASE 86#ifdef CONFIG_SPU_BASE
@@ -115,9 +105,6 @@ static void __init qpace_setup_arch(void)
115#ifdef CONFIG_DUMMY_CONSOLE 105#ifdef CONFIG_DUMMY_CONSOLE
116 conswitchp = &dummy_con; 106 conswitchp = &dummy_con;
117#endif 107#endif
118
119 /* set notifier function */
120 platform_notify = &qpace_notify;
121} 108}
122 109
123static int __init qpace_probe(void) 110static int __init qpace_probe(void)
@@ -141,6 +128,8 @@ define_machine(qpace) {
141 .power_off = rtas_power_off, 128 .power_off = rtas_power_off,
142 .halt = rtas_halt, 129 .halt = rtas_halt,
143 .get_boot_time = rtas_get_boot_time, 130 .get_boot_time = rtas_get_boot_time,
131 .get_rtc_time = rtas_get_rtc_time,
132 .set_rtc_time = rtas_set_rtc_time,
144 .calibrate_decr = generic_calibrate_decr, 133 .calibrate_decr = generic_calibrate_decr,
145 .progress = qpace_progress, 134 .progress = qpace_progress,
146 .init_IRQ = iic_init_IRQ, 135 .init_IRQ = iic_init_IRQ,
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index e487ad68ac11..9abd210d87c1 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -114,7 +114,7 @@ static inline void mm_needs_global_tlbie(struct mm_struct *mm)
114 int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1; 114 int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1;
115 115
116 /* Global TLBIE broadcast required with SPEs. */ 116 /* Global TLBIE broadcast required with SPEs. */
117 __cpus_setall(&mm->cpu_vm_mask, nr); 117 bitmap_fill(cpumask_bits(mm_cpumask(mm)), nr);
118} 118}
119 119
120void spu_associate_mm(struct spu *spu, struct mm_struct *mm) 120void spu_associate_mm(struct spu *spu, struct mm_struct *mm)
diff --git a/arch/powerpc/platforms/cell/spu_fault.c b/arch/powerpc/platforms/cell/spu_fault.c
index c8b1cd42905d..95d8dadf2d87 100644
--- a/arch/powerpc/platforms/cell/spu_fault.c
+++ b/arch/powerpc/platforms/cell/spu_fault.c
@@ -39,60 +39,56 @@ int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
39 unsigned long is_write; 39 unsigned long is_write;
40 int ret; 40 int ret;
41 41
42#if 0 42 if (mm == NULL)
43 if (!IS_VALID_EA(ea)) {
44 return -EFAULT; 43 return -EFAULT;
45 } 44
46#endif /* XXX */ 45 if (mm->pgd == NULL)
47 if (mm == NULL) {
48 return -EFAULT;
49 }
50 if (mm->pgd == NULL) {
51 return -EFAULT; 46 return -EFAULT;
52 }
53 47
54 down_read(&mm->mmap_sem); 48 down_read(&mm->mmap_sem);
49 ret = -EFAULT;
55 vma = find_vma(mm, ea); 50 vma = find_vma(mm, ea);
56 if (!vma) 51 if (!vma)
57 goto bad_area; 52 goto out_unlock;
58 if (vma->vm_start <= ea) 53
59 goto good_area; 54 if (ea < vma->vm_start) {
60 if (!(vma->vm_flags & VM_GROWSDOWN)) 55 if (!(vma->vm_flags & VM_GROWSDOWN))
61 goto bad_area; 56 goto out_unlock;
62 if (expand_stack(vma, ea)) 57 if (expand_stack(vma, ea))
63 goto bad_area; 58 goto out_unlock;
64good_area: 59 }
60
65 is_write = dsisr & MFC_DSISR_ACCESS_PUT; 61 is_write = dsisr & MFC_DSISR_ACCESS_PUT;
66 if (is_write) { 62 if (is_write) {
67 if (!(vma->vm_flags & VM_WRITE)) 63 if (!(vma->vm_flags & VM_WRITE))
68 goto bad_area; 64 goto out_unlock;
69 } else { 65 } else {
70 if (dsisr & MFC_DSISR_ACCESS_DENIED) 66 if (dsisr & MFC_DSISR_ACCESS_DENIED)
71 goto bad_area; 67 goto out_unlock;
72 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 68 if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
73 goto bad_area; 69 goto out_unlock;
74 } 70 }
71
75 ret = 0; 72 ret = 0;
76 *flt = handle_mm_fault(mm, vma, ea, is_write); 73 *flt = handle_mm_fault(mm, vma, ea, is_write);
77 if (unlikely(*flt & VM_FAULT_ERROR)) { 74 if (unlikely(*flt & VM_FAULT_ERROR)) {
78 if (*flt & VM_FAULT_OOM) { 75 if (*flt & VM_FAULT_OOM) {
79 ret = -ENOMEM; 76 ret = -ENOMEM;
80 goto bad_area; 77 goto out_unlock;
81 } else if (*flt & VM_FAULT_SIGBUS) { 78 } else if (*flt & VM_FAULT_SIGBUS) {
82 ret = -EFAULT; 79 ret = -EFAULT;
83 goto bad_area; 80 goto out_unlock;
84 } 81 }
85 BUG(); 82 BUG();
86 } 83 }
84
87 if (*flt & VM_FAULT_MAJOR) 85 if (*flt & VM_FAULT_MAJOR)
88 current->maj_flt++; 86 current->maj_flt++;
89 else 87 else
90 current->min_flt++; 88 current->min_flt++;
91 up_read(&mm->mmap_sem);
92 return ret;
93 89
94bad_area: 90out_unlock:
95 up_read(&mm->mmap_sem); 91 up_read(&mm->mmap_sem);
96 return -EFAULT; 92 return ret;
97} 93}
98EXPORT_SYMBOL_GPL(spu_handle_mm_fault); 94EXPORT_SYMBOL_GPL(spu_handle_mm_fault);
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index 6653ddbed048..db5398c0339f 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -35,6 +35,8 @@ atomic_t nr_spu_contexts = ATOMIC_INIT(0);
35struct spu_context *alloc_spu_context(struct spu_gang *gang) 35struct spu_context *alloc_spu_context(struct spu_gang *gang)
36{ 36{
37 struct spu_context *ctx; 37 struct spu_context *ctx;
38 struct timespec ts;
39
38 ctx = kzalloc(sizeof *ctx, GFP_KERNEL); 40 ctx = kzalloc(sizeof *ctx, GFP_KERNEL);
39 if (!ctx) 41 if (!ctx)
40 goto out; 42 goto out;
@@ -64,6 +66,8 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
64 __spu_update_sched_info(ctx); 66 __spu_update_sched_info(ctx);
65 spu_set_timeslice(ctx); 67 spu_set_timeslice(ctx);
66 ctx->stats.util_state = SPU_UTIL_IDLE_LOADED; 68 ctx->stats.util_state = SPU_UTIL_IDLE_LOADED;
69 ktime_get_ts(&ts);
70 ctx->stats.tstamp = timespec_to_ns(&ts);
67 71
68 atomic_inc(&nr_spu_contexts); 72 atomic_inc(&nr_spu_contexts);
69 goto out; 73 goto out;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 0da7f2bf5ee1..d6a519e6e1c1 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -568,16 +568,17 @@ spufs_regs_write(struct file *file, const char __user *buffer,
568 struct spu_lscsa *lscsa = ctx->csa.lscsa; 568 struct spu_lscsa *lscsa = ctx->csa.lscsa;
569 int ret; 569 int ret;
570 570
571 size = min_t(ssize_t, sizeof lscsa->gprs - *pos, size); 571 if (*pos >= sizeof(lscsa->gprs))
572 if (size <= 0)
573 return -EFBIG; 572 return -EFBIG;
573
574 size = min_t(ssize_t, sizeof(lscsa->gprs) - *pos, size);
574 *pos += size; 575 *pos += size;
575 576
576 ret = spu_acquire_saved(ctx); 577 ret = spu_acquire_saved(ctx);
577 if (ret) 578 if (ret)
578 return ret; 579 return ret;
579 580
580 ret = copy_from_user(lscsa->gprs + *pos - size, 581 ret = copy_from_user((char *)lscsa->gprs + *pos - size,
581 buffer, size) ? -EFAULT : size; 582 buffer, size) ? -EFAULT : size;
582 583
583 spu_release_saved(ctx); 584 spu_release_saved(ctx);
@@ -623,10 +624,11 @@ spufs_fpcr_write(struct file *file, const char __user * buffer,
623 struct spu_lscsa *lscsa = ctx->csa.lscsa; 624 struct spu_lscsa *lscsa = ctx->csa.lscsa;
624 int ret; 625 int ret;
625 626
626 size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size); 627 if (*pos >= sizeof(lscsa->fpcr))
627 if (size <= 0)
628 return -EFBIG; 628 return -EFBIG;
629 629
630 size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
631
630 ret = spu_acquire_saved(ctx); 632 ret = spu_acquire_saved(ctx);
631 if (ret) 633 if (ret)
632 return ret; 634 return ret;
@@ -2665,7 +2667,7 @@ static const struct file_operations spufs_ctx_fops = {
2665 .release = single_release, 2667 .release = single_release,
2666}; 2668};
2667 2669
2668struct spufs_tree_descr spufs_dir_contents[] = { 2670const struct spufs_tree_descr spufs_dir_contents[] = {
2669 { "capabilities", &spufs_caps_fops, 0444, }, 2671 { "capabilities", &spufs_caps_fops, 0444, },
2670 { "mem", &spufs_mem_fops, 0666, LS_SIZE, }, 2672 { "mem", &spufs_mem_fops, 0666, LS_SIZE, },
2671 { "regs", &spufs_regs_fops, 0666, sizeof(struct spu_reg128[128]), }, 2673 { "regs", &spufs_regs_fops, 0666, sizeof(struct spu_reg128[128]), },
@@ -2706,7 +2708,7 @@ struct spufs_tree_descr spufs_dir_contents[] = {
2706 {}, 2708 {},
2707}; 2709};
2708 2710
2709struct spufs_tree_descr spufs_dir_nosched_contents[] = { 2711const struct spufs_tree_descr spufs_dir_nosched_contents[] = {
2710 { "capabilities", &spufs_caps_fops, 0444, }, 2712 { "capabilities", &spufs_caps_fops, 0444, },
2711 { "mem", &spufs_mem_fops, 0666, LS_SIZE, }, 2713 { "mem", &spufs_mem_fops, 0666, LS_SIZE, },
2712 { "mbox", &spufs_mbox_fops, 0444, }, 2714 { "mbox", &spufs_mbox_fops, 0444, },
@@ -2731,12 +2733,12 @@ struct spufs_tree_descr spufs_dir_nosched_contents[] = {
2731 {}, 2733 {},
2732}; 2734};
2733 2735
2734struct spufs_tree_descr spufs_dir_debug_contents[] = { 2736const struct spufs_tree_descr spufs_dir_debug_contents[] = {
2735 { ".ctx", &spufs_ctx_fops, 0444, }, 2737 { ".ctx", &spufs_ctx_fops, 0444, },
2736 {}, 2738 {},
2737}; 2739};
2738 2740
2739struct spufs_coredump_reader spufs_coredump_read[] = { 2741const struct spufs_coredump_reader spufs_coredump_read[] = {
2740 { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])}, 2742 { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])},
2741 { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) }, 2743 { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) },
2742 { "lslr", NULL, spufs_lslr_get, 19 }, 2744 { "lslr", NULL, spufs_lslr_get, 19 },
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index e309ef70a531..64f068540d0d 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -186,8 +186,9 @@ static int spufs_rmdir(struct inode *parent, struct dentry *dir)
186 return simple_rmdir(parent, dir); 186 return simple_rmdir(parent, dir);
187} 187}
188 188
189static int spufs_fill_dir(struct dentry *dir, struct spufs_tree_descr *files, 189static int spufs_fill_dir(struct dentry *dir,
190 int mode, struct spu_context *ctx) 190 const struct spufs_tree_descr *files, int mode,
191 struct spu_context *ctx)
191{ 192{
192 struct dentry *dentry, *tmp; 193 struct dentry *dentry, *tmp;
193 int ret; 194 int ret;
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index c58bd36b0c5b..4ddf769a64e5 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -117,6 +117,9 @@ static int spu_setup_isolated(struct spu_context *ctx)
117 cond_resched(); 117 cond_resched();
118 } 118 }
119 119
120 /* clear purge status */
121 out_be64(mfc_cntl, 0);
122
120 /* put the SPE in kernel mode to allow access to the loader */ 123 /* put the SPE in kernel mode to allow access to the loader */
121 sr1 = spu_mfc_sr1_get(ctx->spu); 124 sr1 = spu_mfc_sr1_get(ctx->spu);
122 sr1 &= ~MFC_STATE1_PROBLEM_STATE_MASK; 125 sr1 &= ~MFC_STATE1_PROBLEM_STATE_MASK;
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 6a0ad196aeb3..f085369301b1 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -508,7 +508,7 @@ static void __spu_add_to_rq(struct spu_context *ctx)
508 list_add_tail(&ctx->rq, &spu_prio->runq[ctx->prio]); 508 list_add_tail(&ctx->rq, &spu_prio->runq[ctx->prio]);
509 set_bit(ctx->prio, spu_prio->bitmap); 509 set_bit(ctx->prio, spu_prio->bitmap);
510 if (!spu_prio->nr_waiting++) 510 if (!spu_prio->nr_waiting++)
511 __mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK); 511 mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
512 } 512 }
513} 513}
514 514
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 3bf908e2873a..ae31573bea4a 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -241,9 +241,9 @@ struct spufs_tree_descr {
241 size_t size; 241 size_t size;
242}; 242};
243 243
244extern struct spufs_tree_descr spufs_dir_contents[]; 244extern const struct spufs_tree_descr spufs_dir_contents[];
245extern struct spufs_tree_descr spufs_dir_nosched_contents[]; 245extern const struct spufs_tree_descr spufs_dir_nosched_contents[];
246extern struct spufs_tree_descr spufs_dir_debug_contents[]; 246extern const struct spufs_tree_descr spufs_dir_debug_contents[];
247 247
248/* system call implementation */ 248/* system call implementation */
249extern struct spufs_calls spufs_calls; 249extern struct spufs_calls spufs_calls;
@@ -358,7 +358,7 @@ struct spufs_coredump_reader {
358 u64 (*get)(struct spu_context *ctx); 358 u64 (*get)(struct spu_context *ctx);
359 size_t size; 359 size_t size;
360}; 360};
361extern struct spufs_coredump_reader spufs_coredump_read[]; 361extern const struct spufs_coredump_reader spufs_coredump_read[];
362extern int spufs_coredump_num_notes; 362extern int spufs_coredump_num_notes;
363 363
364extern int spu_init_csa(struct spu_state *csa); 364extern int spu_init_csa(struct spu_state *csa);