Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: Fix vio_bus_probe oops on probe error
powerpc/ibmebus: Restore "name" sysfs attribute on ibmebus devices
powerpc: Fix /dev/oldmem interface for kdump
powerpc/spufs: Remove invalid semicolon after if statement
powerpc/spufs: reference context while dropping state mutex in scheduler
powerpc/spufs: fix npc setting for NOSCHED contexts

+50 -31
+22 -9
arch/powerpc/kernel/crash_dump.c
··· 86 } 87 __setup("savemaxmem=", parse_savemaxmem); 88 89 /** 90 * copy_oldmem_page - copy one page from "oldmem" 91 * @pfn: page frame number to be copied ··· 120 if (!csize) 121 return 0; 122 123 - vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0); 124 125 - if (userbuf) { 126 - if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) { 127 - iounmap(vaddr); 128 - return -EFAULT; 129 - } 130 - } else 131 - memcpy(buf, (vaddr + offset), csize); 132 133 - iounmap(vaddr); 134 return csize; 135 }
··· 86 } 87 __setup("savemaxmem=", parse_savemaxmem); 88 89 + 90 + static 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 + 102 /** 103 * copy_oldmem_page - copy one page from "oldmem" 104 * @pfn: page frame number to be copied ··· 107 if (!csize) 108 return 0; 109 110 + csize = min(csize, PAGE_SIZE); 111 112 + if (pfn < max_pfn) { 113 + vaddr = __va(pfn << PAGE_SHIFT); 114 + csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); 115 + } else { 116 + vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0); 117 + csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); 118 + iounmap(vaddr); 119 + } 120 121 return csize; 122 }
-12
arch/powerpc/kernel/ibmebus.c
··· 233 } 234 EXPORT_SYMBOL(ibmebus_free_irq); 235 236 - static 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 - 242 - static struct device_attribute ibmebus_dev_attrs[] = { 243 - __ATTR_RO(name), 244 - __ATTR_NULL 245 - }; 246 - 247 static char *ibmebus_chomp(const char *in, size_t count) 248 { 249 char *out = kmalloc(count + 1, GFP_KERNEL); ··· 316 317 struct bus_type ibmebus_bus_type = { 318 .uevent = of_device_uevent, 319 - .dev_attrs = ibmebus_dev_attrs, 320 .bus_attrs = ibmebus_bus_attrs 321 }; 322 EXPORT_SYMBOL(ibmebus_bus_type);
··· 233 } 234 EXPORT_SYMBOL(ibmebus_free_irq); 235 236 static char *ibmebus_chomp(const char *in, size_t count) 237 { 238 char *out = kmalloc(count + 1, GFP_KERNEL); ··· 327 328 struct bus_type ibmebus_bus_type = { 329 .uevent = of_device_uevent, 330 .bus_attrs = ibmebus_bus_attrs 331 }; 332 EXPORT_SYMBOL(ibmebus_bus_type);
+1 -1
arch/powerpc/kernel/vio.c
··· 1113 return error; 1114 } 1115 error = viodrv->probe(viodev, id); 1116 - if (error) 1117 vio_cmo_bus_remove(viodev); 1118 } 1119
··· 1113 return error; 1114 } 1115 error = viodrv->probe(viodev, id); 1116 + if (error && firmware_has_feature(FW_FEATURE_CMO)) 1117 vio_cmo_bus_remove(viodev); 1118 } 1119
+8 -7
arch/powerpc/platforms/cell/spufs/run.c
··· 206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); 207 if (runcntl == 0) 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 { 215 unsigned long privcntl; 216 ··· 214 else 215 privcntl = SPU_PRIVCNTL_MODE_NORMAL; 216 217 - ctx->ops->npc_write(ctx, *npc); 218 ctx->ops->privcntl_write(ctx, privcntl); 219 - ctx->ops->runcntl_write(ctx, runcntl); 220 221 if (ctx->state == SPU_STATE_SAVED) { 222 ret = spu_activate(ctx, 0);
··· 206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); 207 if (runcntl == 0) 208 runcntl = SPU_RUNCNTL_RUNNABLE; 209 } else { 210 unsigned long privcntl; 211 ··· 219 else 220 privcntl = SPU_PRIVCNTL_MODE_NORMAL; 221 222 ctx->ops->privcntl_write(ctx, privcntl); 223 + ctx->ops->npc_write(ctx, *npc); 224 + } 225 + 226 + ctx->ops->runcntl_write(ctx, runcntl); 227 + 228 + if (ctx->flags & SPU_CREATE_NOSCHED) { 229 + spuctx_switch_state(ctx, SPU_UTIL_USER); 230 + } else { 231 232 if (ctx->state == SPU_STATE_SAVED) { 233 ret = spu_activate(ctx, 0);
+9 -2
arch/powerpc/platforms/cell/spufs/sched.c
··· 641 642 if (tmp && tmp->prio > ctx->prio && 643 !(tmp->flags & SPU_CREATE_NOSCHED) && 644 - (!victim || tmp->prio > victim->prio)) 645 victim = spu->ctx; 646 } 647 mutex_unlock(&cbe_spu_info[node].list_mutex); 648 ··· 660 * look at another context or give up after X retries. 661 */ 662 if (!mutex_trylock(&victim->state_mutex)) { 663 victim = NULL; 664 goto restart; 665 } ··· 673 * restart the search. 674 */ 675 mutex_unlock(&victim->state_mutex); 676 victim = NULL; 677 goto restart; 678 } ··· 691 spu_add_to_rq(victim); 692 693 mutex_unlock(&victim->state_mutex); 694 695 return spu; 696 } ··· 990 struct spu_context *ctx = spu->ctx; 991 992 if (ctx) { 993 mutex_unlock(mtx); 994 spusched_tick(ctx); 995 mutex_lock(mtx); 996 } 997 } 998 mutex_unlock(mtx); ··· 1037 node = spu->node; 1038 if (old_state == SPU_UTIL_USER) 1039 atomic_dec(&cbe_spu_info[node].busy_spus); 1040 - if (new_state == SPU_UTIL_USER); 1041 atomic_inc(&cbe_spu_info[node].busy_spus); 1042 } 1043 }
··· 641 642 if (tmp && tmp->prio > ctx->prio && 643 !(tmp->flags & SPU_CREATE_NOSCHED) && 644 + (!victim || tmp->prio > victim->prio)) { 645 victim = spu->ctx; 646 + get_spu_context(victim); 647 + } 648 } 649 mutex_unlock(&cbe_spu_info[node].list_mutex); 650 ··· 658 * look at another context or give up after X retries. 659 */ 660 if (!mutex_trylock(&victim->state_mutex)) { 661 + put_spu_context(victim); 662 victim = NULL; 663 goto restart; 664 } ··· 670 * restart the search. 671 */ 672 mutex_unlock(&victim->state_mutex); 673 + put_spu_context(victim); 674 victim = NULL; 675 goto restart; 676 } ··· 687 spu_add_to_rq(victim); 688 689 mutex_unlock(&victim->state_mutex); 690 + put_spu_context(victim); 691 692 return spu; 693 } ··· 985 struct spu_context *ctx = spu->ctx; 986 987 if (ctx) { 988 + get_spu_context(ctx); 989 mutex_unlock(mtx); 990 spusched_tick(ctx); 991 mutex_lock(mtx); 992 + put_spu_context(ctx); 993 } 994 } 995 mutex_unlock(mtx); ··· 1030 node = spu->node; 1031 if (old_state == SPU_UTIL_USER) 1032 atomic_dec(&cbe_spu_info[node].busy_spus); 1033 + if (new_state == SPU_UTIL_USER) 1034 atomic_inc(&cbe_spu_info[node].busy_spus); 1035 } 1036 }
+10
drivers/of/device.c
··· 57 return sprintf(buf, "%s\n", ofdev->node->full_name); 58 } 59 60 static ssize_t modalias_show(struct device *dev, 61 struct device_attribute *attr, char *buf) 62 { ··· 80 81 struct device_attribute of_platform_device_attrs[] = { 82 __ATTR_RO(devspec), 83 __ATTR_RO(modalias), 84 __ATTR_NULL 85 };
··· 57 return sprintf(buf, "%s\n", ofdev->node->full_name); 58 } 59 60 + static 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 + 69 static ssize_t modalias_show(struct device *dev, 70 struct device_attribute *attr, char *buf) 71 { ··· 71 72 struct device_attribute of_platform_device_attrs[] = { 73 __ATTR_RO(devspec), 74 + __ATTR_RO(name), 75 __ATTR_RO(modalias), 76 __ATTR_NULL 77 };