aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/crash_dump.c31
-rw-r--r--arch/powerpc/kernel/ibmebus.c12
-rw-r--r--arch/powerpc/kernel/vio.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c15
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c11
-rw-r--r--drivers/of/device.c10
6 files changed, 50 insertions, 31 deletions
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index e0debcca0bfa..a323c9b32ee1 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -86,6 +86,19 @@ static int __init parse_savemaxmem(char *p)
86} 86}
87__setup("savemaxmem=", parse_savemaxmem); 87__setup("savemaxmem=", parse_savemaxmem);
88 88
89
90static size_t copy_oldmem_vaddr(void *vaddr, char *buf, size_t csize,
91 unsigned long offset, int userbuf)
92{
93 if (userbuf) {
94 if (copy_to_user((char __user *)buf, (vaddr + offset), csize))
95 return -EFAULT;
96 } else
97 memcpy(buf, (vaddr + offset), csize);
98
99 return csize;
100}
101
89/** 102/**
90 * copy_oldmem_page - copy one page from "oldmem" 103 * copy_oldmem_page - copy one page from "oldmem"
91 * @pfn: page frame number to be copied 104 * @pfn: page frame number to be copied
@@ -107,16 +120,16 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
107 if (!csize) 120 if (!csize)
108 return 0; 121 return 0;
109 122
110 vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0); 123 csize = min(csize, PAGE_SIZE);
111 124
112 if (userbuf) { 125 if (pfn < max_pfn) {
113 if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) { 126 vaddr = __va(pfn << PAGE_SHIFT);
114 iounmap(vaddr); 127 csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
115 return -EFAULT; 128 } else {
116 } 129 vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0);
117 } else 130 csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
118 memcpy(buf, (vaddr + offset), csize); 131 iounmap(vaddr);
132 }
119 133
120 iounmap(vaddr);
121 return csize; 134 return csize;
122} 135}
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index 9d42eb57aea3..a06362223f8d 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -233,17 +233,6 @@ void ibmebus_free_irq(u32 ist, void *dev_id)
233} 233}
234EXPORT_SYMBOL(ibmebus_free_irq); 234EXPORT_SYMBOL(ibmebus_free_irq);
235 235
236static ssize_t name_show(struct device *dev,
237 struct device_attribute *attr, char *buf)
238{
239 return sprintf(buf, "%s\n", to_of_device(dev)->node->name);
240}
241
242static struct device_attribute ibmebus_dev_attrs[] = {
243 __ATTR_RO(name),
244 __ATTR_NULL
245};
246
247static char *ibmebus_chomp(const char *in, size_t count) 236static char *ibmebus_chomp(const char *in, size_t count)
248{ 237{
249 char *out = kmalloc(count + 1, GFP_KERNEL); 238 char *out = kmalloc(count + 1, GFP_KERNEL);
@@ -327,7 +316,6 @@ static struct bus_attribute ibmebus_bus_attrs[] = {
327 316
328struct bus_type ibmebus_bus_type = { 317struct bus_type ibmebus_bus_type = {
329 .uevent = of_device_uevent, 318 .uevent = of_device_uevent,
330 .dev_attrs = ibmebus_dev_attrs,
331 .bus_attrs = ibmebus_bus_attrs 319 .bus_attrs = ibmebus_bus_attrs
332}; 320};
333EXPORT_SYMBOL(ibmebus_bus_type); 321EXPORT_SYMBOL(ibmebus_bus_type);
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 22a3c33fd751..2750fbab1975 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1113,7 +1113,7 @@ static int vio_bus_probe(struct device *dev)
1113 return error; 1113 return error;
1114 } 1114 }
1115 error = viodrv->probe(viodev, id); 1115 error = viodrv->probe(viodev, id);
1116 if (error) 1116 if (error && firmware_has_feature(FW_FEATURE_CMO))
1117 vio_cmo_bus_remove(viodev); 1117 vio_cmo_bus_remove(viodev);
1118 } 1118 }
1119 1119
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index f7edba6cb795..c9bb7cfd3dca 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -206,11 +206,6 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); 206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE);
207 if (runcntl == 0) 207 if (runcntl == 0)
208 runcntl = SPU_RUNCNTL_RUNNABLE; 208 runcntl = SPU_RUNCNTL_RUNNABLE;
209 }
210
211 if (ctx->flags & SPU_CREATE_NOSCHED) {
212 spuctx_switch_state(ctx, SPU_UTIL_USER);
213 ctx->ops->runcntl_write(ctx, runcntl);
214 } else { 209 } else {
215 unsigned long privcntl; 210 unsigned long privcntl;
216 211
@@ -219,9 +214,15 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
219 else 214 else
220 privcntl = SPU_PRIVCNTL_MODE_NORMAL; 215 privcntl = SPU_PRIVCNTL_MODE_NORMAL;
221 216
222 ctx->ops->npc_write(ctx, *npc);
223 ctx->ops->privcntl_write(ctx, privcntl); 217 ctx->ops->privcntl_write(ctx, privcntl);
224 ctx->ops->runcntl_write(ctx, runcntl); 218 ctx->ops->npc_write(ctx, *npc);
219 }
220
221 ctx->ops->runcntl_write(ctx, runcntl);
222
223 if (ctx->flags & SPU_CREATE_NOSCHED) {
224 spuctx_switch_state(ctx, SPU_UTIL_USER);
225 } else {
225 226
226 if (ctx->state == SPU_STATE_SAVED) { 227 if (ctx->state == SPU_STATE_SAVED) {
227 ret = spu_activate(ctx, 0); 228 ret = spu_activate(ctx, 0);
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 2deeeba7eccf..1c1b627ee843 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -641,8 +641,10 @@ static struct spu *find_victim(struct spu_context *ctx)
641 641
642 if (tmp && tmp->prio > ctx->prio && 642 if (tmp && tmp->prio > ctx->prio &&
643 !(tmp->flags & SPU_CREATE_NOSCHED) && 643 !(tmp->flags & SPU_CREATE_NOSCHED) &&
644 (!victim || tmp->prio > victim->prio)) 644 (!victim || tmp->prio > victim->prio)) {
645 victim = spu->ctx; 645 victim = spu->ctx;
646 get_spu_context(victim);
647 }
646 } 648 }
647 mutex_unlock(&cbe_spu_info[node].list_mutex); 649 mutex_unlock(&cbe_spu_info[node].list_mutex);
648 650
@@ -658,6 +660,7 @@ static struct spu *find_victim(struct spu_context *ctx)
658 * look at another context or give up after X retries. 660 * look at another context or give up after X retries.
659 */ 661 */
660 if (!mutex_trylock(&victim->state_mutex)) { 662 if (!mutex_trylock(&victim->state_mutex)) {
663 put_spu_context(victim);
661 victim = NULL; 664 victim = NULL;
662 goto restart; 665 goto restart;
663 } 666 }
@@ -670,6 +673,7 @@ static struct spu *find_victim(struct spu_context *ctx)
670 * restart the search. 673 * restart the search.
671 */ 674 */
672 mutex_unlock(&victim->state_mutex); 675 mutex_unlock(&victim->state_mutex);
676 put_spu_context(victim);
673 victim = NULL; 677 victim = NULL;
674 goto restart; 678 goto restart;
675 } 679 }
@@ -687,6 +691,7 @@ static struct spu *find_victim(struct spu_context *ctx)
687 spu_add_to_rq(victim); 691 spu_add_to_rq(victim);
688 692
689 mutex_unlock(&victim->state_mutex); 693 mutex_unlock(&victim->state_mutex);
694 put_spu_context(victim);
690 695
691 return spu; 696 return spu;
692 } 697 }
@@ -985,9 +990,11 @@ static int spusched_thread(void *unused)
985 struct spu_context *ctx = spu->ctx; 990 struct spu_context *ctx = spu->ctx;
986 991
987 if (ctx) { 992 if (ctx) {
993 get_spu_context(ctx);
988 mutex_unlock(mtx); 994 mutex_unlock(mtx);
989 spusched_tick(ctx); 995 spusched_tick(ctx);
990 mutex_lock(mtx); 996 mutex_lock(mtx);
997 put_spu_context(ctx);
991 } 998 }
992 } 999 }
993 mutex_unlock(mtx); 1000 mutex_unlock(mtx);
@@ -1030,7 +1037,7 @@ void spuctx_switch_state(struct spu_context *ctx,
1030 node = spu->node; 1037 node = spu->node;
1031 if (old_state == SPU_UTIL_USER) 1038 if (old_state == SPU_UTIL_USER)
1032 atomic_dec(&cbe_spu_info[node].busy_spus); 1039 atomic_dec(&cbe_spu_info[node].busy_spus);
1033 if (new_state == SPU_UTIL_USER); 1040 if (new_state == SPU_UTIL_USER)
1034 atomic_inc(&cbe_spu_info[node].busy_spus); 1041 atomic_inc(&cbe_spu_info[node].busy_spus);
1035 } 1042 }
1036} 1043}
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 8a1d93a2bb81..51e5214071da 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -57,6 +57,15 @@ static ssize_t devspec_show(struct device *dev,
57 return sprintf(buf, "%s\n", ofdev->node->full_name); 57 return sprintf(buf, "%s\n", ofdev->node->full_name);
58} 58}
59 59
60static ssize_t name_show(struct device *dev,
61 struct device_attribute *attr, char *buf)
62{
63 struct of_device *ofdev;
64
65 ofdev = to_of_device(dev);
66 return sprintf(buf, "%s\n", ofdev->node->name);
67}
68
60static ssize_t modalias_show(struct device *dev, 69static ssize_t modalias_show(struct device *dev,
61 struct device_attribute *attr, char *buf) 70 struct device_attribute *attr, char *buf)
62{ 71{
@@ -71,6 +80,7 @@ static ssize_t modalias_show(struct device *dev,
71 80
72struct device_attribute of_platform_device_attrs[] = { 81struct device_attribute of_platform_device_attrs[] = {
73 __ATTR_RO(devspec), 82 __ATTR_RO(devspec),
83 __ATTR_RO(name),
74 __ATTR_RO(modalias), 84 __ATTR_RO(modalias),
75 __ATTR_NULL 85 __ATTR_NULL
76}; 86};