diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index e6289ee74ecd400bcfaf606d8f9585191225462f..8bf4ae1150be6775b2c348af2ee56a2786dd320c 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -200,11 +200,13 @@ static noinline __init void find_memory_chunks(unsigned long memsize) cc = __tprot(addr); while (cc == old_cc) { addr += CHUNK_INCR; - cc = __tprot(addr); + if (addr >= memsize) + break; #ifndef CONFIG_64BIT if (addr == ADDR2G) break; #endif + cc = __tprot(addr); } if (old_addr != addr && diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 96492cf2d491d38d4d6000cddb1a38fb4b1463fb..29f7884b4ffad57c3f709f714959dc8c52c7f3f1 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -92,6 +92,7 @@ EXPORT_SYMBOL(unregister_idle_notifier); void do_monitor_call(struct pt_regs *regs, long interruption_code) { +#ifdef CONFIG_SMP struct s390_idle_data *idle; idle = &__get_cpu_var(s390_idle); @@ -99,7 +100,7 @@ void do_monitor_call(struct pt_regs *regs, long interruption_code) idle->idle_time += get_clock() - idle->idle_enter; idle->in_idle = 0; spin_unlock(&idle->lock); - +#endif /* disable monitor call class 0 */ __ctl_clear_bit(8, 15); @@ -114,7 +115,9 @@ extern void s390_handle_mcck(void); static void default_idle(void) { int cpu, rc; +#ifdef CONFIG_SMP struct s390_idle_data *idle; +#endif /* CPU is going idle. */ cpu = smp_processor_id(); @@ -151,13 +154,14 @@ static void default_idle(void) s390_handle_mcck(); return; } - +#ifdef CONFIG_SMP idle = &__get_cpu_var(s390_idle); spin_lock(&idle->lock); idle->idle_count++; idle->in_idle = 1; idle->idle_enter = get_clock(); spin_unlock(&idle->lock); +#endif trace_hardirqs_on(); /* Wait for external, I/O or machine check interrupt. */ __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 1d97fe1c0e538d1df29aebd133522d09dfcf08c3..b05ae8584258e3f9081da0e60f2733d8fea54436 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -788,14 +788,14 @@ static ssize_t show_idle_time(struct sys_device *dev, char *buf) } new_time = idle->idle_time; spin_unlock_irq(&idle->lock); - return sprintf(buf, "%llu us\n", new_time >> 12); + return sprintf(buf, "%llu\n", new_time >> 12); } -static SYSDEV_ATTR(idle_time, 0444, show_idle_time, NULL); +static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); static struct attribute *cpu_attrs[] = { &attr_capability.attr, &attr_idle_count.attr, - &attr_idle_time.attr, + &attr_idle_time_us.attr, NULL, }; diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 48dae49bc1ec474ffe80f3eed427a610f48d48bf..a963fe81359e5bc2795ee0540b4fef600121fa20 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -307,7 +307,7 @@ static cycle_t read_tod_clock(void) static struct clocksource clocksource_tod = { .name = "tod", - .rating = 100, + .rating = 400, .read = read_tod_clock, .mask = -1ULL, .mult = 1000, diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 859f870552e3e019752e20274ec5144d7e556d8b..5e083d1f57e70a115dac935895d4e40bcd6a5624 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -193,6 +193,12 @@ dcssblk_segment_warn(int rc, char* seg_name) } } +static void dcssblk_unregister_callback(struct device *dev) +{ + device_unregister(dev); + put_device(dev); +} + /* * device attribute for switching shared/nonshared (exclusive) * operation (show + store) @@ -276,8 +282,7 @@ dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const ch blk_cleanup_queue(dev_info->dcssblk_queue); dev_info->gd->queue = NULL; put_disk(dev_info->gd); - device_unregister(dev); - put_device(dev); + rc = device_schedule_callback(dev, dcssblk_unregister_callback); out: up_write(&dcssblk_devices_sem); return rc; diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c index 725b0dd142699f0f613aece0341cb67af9036867..f4c132ab39edef112c72faad0c492dd3971d0ed7 100644 --- a/drivers/s390/cio/cmf.c +++ b/drivers/s390/cio/cmf.c @@ -343,10 +343,10 @@ static int cmf_copy_block(struct ccw_device *cdev) if (sch->schib.scsw.fctl & SCSW_FCTL_START_FUNC) { /* Don't copy if a start function is in progress. */ - if ((!sch->schib.scsw.actl & SCSW_ACTL_SUSPENDED) && + if ((!(sch->schib.scsw.actl & SCSW_ACTL_SUSPENDED)) && (sch->schib.scsw.actl & (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) && - (!sch->schib.scsw.stctl & SCSW_STCTL_SEC_STATUS)) + (!(sch->schib.scsw.stctl & SCSW_STCTL_SEC_STATUS))) return -EBUSY; } cmb_data = cdev->private->cmb; diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 7ee57f084a89cd79c6f7afcd2caea817633f5877..74f6b539974a1d0310875e3cad4298ea3cf7ba82 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -738,7 +738,7 @@ static int io_subchannel_initialize_dev(struct subchannel *sch, atomic_set(&cdev->private->onoff, 0); cdev->dev.parent = &sch->dev; cdev->dev.release = ccw_device_release; - INIT_LIST_HEAD(&cdev->private->kick_work.entry); + INIT_WORK(&cdev->private->kick_work, NULL); cdev->dev.groups = ccwdev_attr_groups; /* Do first half of device_register. */ device_initialize(&cdev->dev); diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index 3ccca5871fdfc002a922e17fea4c4dcb574808cb..47bb47b485814497e12201b3e4dd2f0697859504 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c @@ -148,6 +148,10 @@ static int __init smsg_init(void) { int rc; + if (!MACHINE_IS_VM) { + rc = -EPROTONOSUPPORT; + goto out; + } rc = driver_register(&smsg_driver); if (rc != 0) goto out;