aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/ibmebus.c30
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c24
-rw-r--r--arch/powerpc/platforms/ps3/platform.h1
-rw-r--r--arch/powerpc/platforms/ps3/repository.c29
-rw-r--r--arch/powerpc/platforms/ps3/spu.c2
5 files changed, 56 insertions, 30 deletions
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index 9a8c9af43b22..d6a38cd5018e 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -188,33 +188,21 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node(
188 struct device_node *dn) 188 struct device_node *dn)
189{ 189{
190 struct ibmebus_dev *dev; 190 struct ibmebus_dev *dev;
191 const char *loc_code; 191 int i, len, bus_len;
192 int length;
193
194 loc_code = of_get_property(dn, "ibm,loc-code", NULL);
195 if (!loc_code) {
196 printk(KERN_WARNING "%s: node %s missing 'ibm,loc-code'\n",
197 __FUNCTION__, dn->name ? dn->name : "<unknown>");
198 return ERR_PTR(-EINVAL);
199 }
200
201 if (strlen(loc_code) == 0) {
202 printk(KERN_WARNING "%s: 'ibm,loc-code' is invalid\n",
203 __FUNCTION__);
204 return ERR_PTR(-EINVAL);
205 }
206 192
207 dev = kzalloc(sizeof(struct ibmebus_dev), GFP_KERNEL); 193 dev = kzalloc(sizeof(struct ibmebus_dev), GFP_KERNEL);
208 if (!dev) { 194 if (!dev)
209 return ERR_PTR(-ENOMEM); 195 return ERR_PTR(-ENOMEM);
210 }
211 196
212 dev->ofdev.node = of_node_get(dn); 197 dev->ofdev.node = of_node_get(dn);
213 198
214 length = strlen(loc_code); 199 len = strlen(dn->full_name + 1);
215 memcpy(dev->ofdev.dev.bus_id, loc_code 200 bus_len = min(len, BUS_ID_SIZE - 1);
216 + (length - min(length, BUS_ID_SIZE - 1)), 201 memcpy(dev->ofdev.dev.bus_id, dn->full_name + 1
217 min(length, BUS_ID_SIZE - 1)); 202 + (len - bus_len), bus_len);
203 for (i = 0; i < bus_len; i++)
204 if (dev->ofdev.dev.bus_id[i] == '/')
205 dev->ofdev.dev.bus_id[i] = '_';
218 206
219 /* Register with generic device framework. */ 207 /* Register with generic device framework. */
220 if (ibmebus_register_device_common(dev, dn->name) != 0) { 208 if (ibmebus_register_device_common(dev, dn->name) != 0) {
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 095a30304c56..106d2921e2d9 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -236,27 +236,34 @@ static irqreturn_t
236spu_irq_class_0(int irq, void *data) 236spu_irq_class_0(int irq, void *data)
237{ 237{
238 struct spu *spu; 238 struct spu *spu;
239 unsigned long stat, mask;
239 240
240 spu = data; 241 spu = data;
241 spu->class_0_pending = 1; 242
243 mask = spu_int_mask_get(spu, 0);
244 stat = spu_int_stat_get(spu, 0);
245 stat &= mask;
246
247 spin_lock(&spu->register_lock);
248 spu->class_0_pending |= stat;
249 spin_unlock(&spu->register_lock);
250
242 spu->stop_callback(spu); 251 spu->stop_callback(spu);
243 252
253 spu_int_stat_clear(spu, 0, stat);
254
244 return IRQ_HANDLED; 255 return IRQ_HANDLED;
245} 256}
246 257
247int 258int
248spu_irq_class_0_bottom(struct spu *spu) 259spu_irq_class_0_bottom(struct spu *spu)
249{ 260{
250 unsigned long stat, mask;
251 unsigned long flags; 261 unsigned long flags;
252 262 unsigned long stat;
253 spu->class_0_pending = 0;
254 263
255 spin_lock_irqsave(&spu->register_lock, flags); 264 spin_lock_irqsave(&spu->register_lock, flags);
256 mask = spu_int_mask_get(spu, 0); 265 stat = spu->class_0_pending;
257 stat = spu_int_stat_get(spu, 0); 266 spu->class_0_pending = 0;
258
259 stat &= mask;
260 267
261 if (stat & 1) /* invalid DMA alignment */ 268 if (stat & 1) /* invalid DMA alignment */
262 __spu_trap_dma_align(spu); 269 __spu_trap_dma_align(spu);
@@ -267,7 +274,6 @@ spu_irq_class_0_bottom(struct spu *spu)
267 if (stat & 4) /* error on SPU */ 274 if (stat & 4) /* error on SPU */
268 __spu_trap_error(spu); 275 __spu_trap_error(spu);
269 276
270 spu_int_stat_clear(spu, 0, stat);
271 spin_unlock_irqrestore(&spu->register_lock, flags); 277 spin_unlock_irqrestore(&spu->register_lock, flags);
272 278
273 return (stat & 0x7) ? -EIO : 0; 279 return (stat & 0x7) ? -EIO : 0;
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
index 87d52060fec0..2eb8f92704b4 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -83,6 +83,7 @@ enum ps3_dev_type {
83 PS3_DEV_TYPE_STOR_ROM = TYPE_ROM, /* 5 */ 83 PS3_DEV_TYPE_STOR_ROM = TYPE_ROM, /* 5 */
84 PS3_DEV_TYPE_SB_GPIO = 6, 84 PS3_DEV_TYPE_SB_GPIO = 6,
85 PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC, /* 14 */ 85 PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC, /* 14 */
86 PS3_DEV_TYPE_STOR_DUMMY = 32,
86 PS3_DEV_TYPE_NOACCESS = 255, 87 PS3_DEV_TYPE_NOACCESS = 255,
87}; 88};
88 89
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c
index 8cc37cfea0f2..1c94824f7b63 100644
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -349,6 +349,35 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
349 return result; 349 return result;
350 } 350 }
351 351
352 if (tmp.bus_type == PS3_BUS_TYPE_STORAGE) {
353 /*
354 * A storage device may show up in the repository before the
355 * hypervisor has finished probing its type and regions
356 */
357 unsigned int num_regions;
358
359 if (tmp.dev_type == PS3_DEV_TYPE_STOR_DUMMY) {
360 pr_debug("%s:%u storage device not ready\n", __func__,
361 __LINE__);
362 return -ENODEV;
363 }
364
365 result = ps3_repository_read_stor_dev_num_regions(tmp.bus_index,
366 tmp.dev_index,
367 &num_regions);
368 if (result) {
369 pr_debug("%s:%d read_stor_dev_num_regions failed\n",
370 __func__, __LINE__);
371 return result;
372 }
373
374 if (!num_regions) {
375 pr_debug("%s:%u storage device has no regions yet\n",
376 __func__, __LINE__);
377 return -ENODEV;
378 }
379 }
380
352 result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index, 381 result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
353 &tmp.dev_id); 382 &tmp.dev_id);
354 383
diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
index ac2a4b8a4c14..d1630a074acf 100644
--- a/arch/powerpc/platforms/ps3/spu.c
+++ b/arch/powerpc/platforms/ps3/spu.c
@@ -505,6 +505,8 @@ static void mfc_sr1_set(struct spu *spu, u64 sr1)
505 static const u64 allowed = ~(MFC_STATE1_LOCAL_STORAGE_DECODE_MASK 505 static const u64 allowed = ~(MFC_STATE1_LOCAL_STORAGE_DECODE_MASK
506 | MFC_STATE1_PROBLEM_STATE_MASK); 506 | MFC_STATE1_PROBLEM_STATE_MASK);
507 507
508 sr1 |= MFC_STATE1_MASTER_RUN_CONTROL_MASK;
509
508 BUG_ON((sr1 & allowed) != (spu_pdata(spu)->cache.sr1 & allowed)); 510 BUG_ON((sr1 & allowed) != (spu_pdata(spu)->cache.sr1 & allowed));
509 511
510 spu_pdata(spu)->cache.sr1 = sr1; 512 spu_pdata(spu)->cache.sr1 = sr1;