Commit 7d531a7e authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
  [S390] smp: fix sigp sense handling
  [S390] smp: fix sigp stop handling
  [S390] cputime: fix overflow on 31 bit systems
  [S390] call home: fix string length handling
  [S390] call home: fix error handling in init function
  [S390] smp: fix prefix handling of offlined cpus
  [S390] s/r: cmm resume fix
  [S390] call home: fix local buffer usage in proc handler
parents a80a66ca b3dcf3de
...@@ -78,7 +78,7 @@ cputime64_to_jiffies64(cputime64_t cputime) ...@@ -78,7 +78,7 @@ cputime64_to_jiffies64(cputime64_t cputime)
static inline unsigned int static inline unsigned int
cputime_to_msecs(const cputime_t cputime) cputime_to_msecs(const cputime_t cputime)
{ {
return __div(cputime, 4096000); return cputime_div(cputime, 4096000);
} }
static inline cputime_t static inline cputime_t
...@@ -160,7 +160,7 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value) ...@@ -160,7 +160,7 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value)
static inline clock_t static inline clock_t
cputime_to_clock_t(cputime_t cputime) cputime_to_clock_t(cputime_t cputime)
{ {
return __div(cputime, 4096000000ULL / USER_HZ); return cputime_div(cputime, 4096000000ULL / USER_HZ);
} }
static inline cputime_t static inline cputime_t
...@@ -175,7 +175,7 @@ clock_t_to_cputime(unsigned long x) ...@@ -175,7 +175,7 @@ clock_t_to_cputime(unsigned long x)
static inline clock_t static inline clock_t
cputime64_to_clock_t(cputime64_t cputime) cputime64_to_clock_t(cputime64_t cputime)
{ {
return __div(cputime, 4096000000ULL / USER_HZ); return cputime_div(cputime, 4096000000ULL / USER_HZ);
} }
struct s390_idle_data { struct s390_idle_data {
......
...@@ -1595,10 +1595,9 @@ static void stop_run(struct shutdown_trigger *trigger) ...@@ -1595,10 +1595,9 @@ static void stop_run(struct shutdown_trigger *trigger)
{ {
if (strcmp(trigger->name, ON_PANIC_STR) == 0) if (strcmp(trigger->name, ON_PANIC_STR) == 0)
disabled_wait((unsigned long) __builtin_return_address(0)); disabled_wait((unsigned long) __builtin_return_address(0));
else { while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy)
signal_processor(smp_processor_id(), sigp_stop); cpu_relax();
for (;;); for (;;);
}
} }
static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR, static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR,
......
...@@ -76,7 +76,6 @@ static int cpu_stopped(int cpu) ...@@ -76,7 +76,6 @@ static int cpu_stopped(int cpu)
__u32 status; __u32 status;
switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) {
case sigp_order_code_accepted:
case sigp_status_stored: case sigp_status_stored:
/* Check for stopped and check stop state */ /* Check for stopped and check stop state */
if (status & 0x50) if (status & 0x50)
...@@ -638,6 +637,8 @@ void __cpu_die(unsigned int cpu) ...@@ -638,6 +637,8 @@ void __cpu_die(unsigned int cpu)
/* Wait until target cpu is down */ /* Wait until target cpu is down */
while (!cpu_stopped(cpu)) while (!cpu_stopped(cpu))
cpu_relax(); cpu_relax();
while (signal_processor_p(0, cpu, sigp_set_prefix) == sigp_busy)
udelay(10);
smp_free_lowcore(cpu); smp_free_lowcore(cpu);
pr_info("Processor %d stopped\n", cpu); pr_info("Processor %d stopped\n", cpu);
} }
...@@ -645,8 +646,8 @@ void __cpu_die(unsigned int cpu) ...@@ -645,8 +646,8 @@ void __cpu_die(unsigned int cpu)
void cpu_die(void) void cpu_die(void)
{ {
idle_task_exit(); idle_task_exit();
signal_processor(smp_processor_id(), sigp_stop); while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy)
BUG(); cpu_relax();
for (;;); for (;;);
} }
......
...@@ -199,6 +199,7 @@ pgm_check_entry: ...@@ -199,6 +199,7 @@ pgm_check_entry:
brc 2,4b /* busy, try again */ brc 2,4b /* busy, try again */
5: 5:
sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */ sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */
brc 2,5b /* busy, try again */
6: j 6b 6: j 6b
restart_suspend: restart_suspend:
...@@ -206,6 +207,7 @@ restart_suspend: ...@@ -206,6 +207,7 @@ restart_suspend:
llgh %r2,0(%r1) llgh %r2,0(%r1)
7: 7:
sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */ sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */
brc 8,7b /* accepted, status 0, still running */
brc 2,7b /* busy, try again */ brc 2,7b /* busy, try again */
tmll %r9,0x40 /* Test if resume CPU is stopped */ tmll %r9,0x40 /* Test if resume CPU is stopped */
jz 7b jz 7b
......
...@@ -26,7 +26,6 @@ static struct sclp_async_sccb *sccb; ...@@ -26,7 +26,6 @@ static struct sclp_async_sccb *sccb;
static int sclp_async_send_wait(char *message); static int sclp_async_send_wait(char *message);
static struct ctl_table_header *callhome_sysctl_header; static struct ctl_table_header *callhome_sysctl_header;
static DEFINE_SPINLOCK(sclp_async_lock); static DEFINE_SPINLOCK(sclp_async_lock);
static char nodename[64];
#define SCLP_NORMAL_WRITE 0x00 #define SCLP_NORMAL_WRITE 0x00
struct async_evbuf { struct async_evbuf {
...@@ -52,9 +51,10 @@ static struct sclp_register sclp_async_register = { ...@@ -52,9 +51,10 @@ static struct sclp_register sclp_async_register = {
static int call_home_on_panic(struct notifier_block *self, static int call_home_on_panic(struct notifier_block *self,
unsigned long event, void *data) unsigned long event, void *data)
{ {
strncat(data, nodename, strlen(nodename)); strncat(data, init_utsname()->nodename,
sclp_async_send_wait(data); sizeof(init_utsname()->nodename));
return NOTIFY_DONE; sclp_async_send_wait(data);
return NOTIFY_DONE;
} }
static struct notifier_block call_home_panic_nb = { static struct notifier_block call_home_panic_nb = {
...@@ -68,15 +68,14 @@ static int proc_handler_callhome(struct ctl_table *ctl, int write, ...@@ -68,15 +68,14 @@ static int proc_handler_callhome(struct ctl_table *ctl, int write,
{ {
unsigned long val; unsigned long val;
int len, rc; int len, rc;
char buf[2]; char buf[3];
if (!*count | (*ppos && !write)) { if (!*count || (*ppos && !write)) {
*count = 0; *count = 0;
return 0; return 0;
} }
if (!write) { if (!write) {
len = sprintf(buf, "%d\n", callhome_enabled); len = snprintf(buf, sizeof(buf), "%d\n", callhome_enabled);
buf[len] = '\0';
rc = copy_to_user(buffer, buf, sizeof(buf)); rc = copy_to_user(buffer, buf, sizeof(buf));
if (rc != 0) if (rc != 0)
return -EFAULT; return -EFAULT;
...@@ -171,39 +170,29 @@ static int __init sclp_async_init(void) ...@@ -171,39 +170,29 @@ static int __init sclp_async_init(void)
rc = sclp_register(&sclp_async_register); rc = sclp_register(&sclp_async_register);
if (rc) if (rc)
return rc; return rc;
callhome_sysctl_header = register_sysctl_table(kern_dir_table); rc = -EOPNOTSUPP;
if (!callhome_sysctl_header) { if (!(sclp_async_register.sclp_receive_mask & EVTYP_ASYNC_MASK))
rc = -ENOMEM;
goto out_sclp;
}
if (!(sclp_async_register.sclp_receive_mask & EVTYP_ASYNC_MASK)) {
rc = -EOPNOTSUPP;
goto out_sclp; goto out_sclp;
}
rc = -ENOMEM; rc = -ENOMEM;
callhome_sysctl_header = register_sysctl_table(kern_dir_table);
if (!callhome_sysctl_header)
goto out_sclp;
request = kzalloc(sizeof(struct sclp_req), GFP_KERNEL); request = kzalloc(sizeof(struct sclp_req), GFP_KERNEL);
if (!request)
goto out_sys;
sccb = (struct sclp_async_sccb *) get_zeroed_page(GFP_KERNEL | GFP_DMA); sccb = (struct sclp_async_sccb *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
if (!sccb) if (!request || !sccb)
goto out_mem; goto out_mem;
rc = atomic_notifier_chain_register(&panic_notifier_list, rc = atomic_notifier_chain_register(&panic_notifier_list,
&call_home_panic_nb); &call_home_panic_nb);
if (rc) if (!rc)
goto out_mem; goto out;
strncpy(nodename, init_utsname()->nodename, 64);
return 0;
out_mem: out_mem:
kfree(request); kfree(request);
free_page((unsigned long) sccb); free_page((unsigned long) sccb);
out_sys:
unregister_sysctl_table(callhome_sysctl_header); unregister_sysctl_table(callhome_sysctl_header);
out_sclp: out_sclp:
sclp_unregister(&sclp_async_register); sclp_unregister(&sclp_async_register);
out:
return rc; return rc;
} }
module_init(sclp_async_init); module_init(sclp_async_init);
......
...@@ -158,7 +158,12 @@ static int smsg_pm_restore_thaw(struct device *dev) ...@@ -158,7 +158,12 @@ static int smsg_pm_restore_thaw(struct device *dev)
smsg_path->flags = 0; smsg_path->flags = 0;
rc = iucv_path_connect(smsg_path, &smsg_handler, "*MSG ", rc = iucv_path_connect(smsg_path, &smsg_handler, "*MSG ",
NULL, NULL, NULL); NULL, NULL, NULL);
printk(KERN_ERR "iucv_path_connect returned with rc %i\n", rc); #ifdef CONFIG_PM_DEBUG
if (rc)
printk(KERN_ERR
"iucv_path_connect returned with rc %i\n", rc);
#endif
cpcmd("SET SMSG IUCV", NULL, 0, NULL);
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment