diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-31 15:14:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-31 15:14:56 -0400 |
commit | 7d531a7e519406c4bb2501a66e3da5ba39280739 (patch) | |
tree | c849a010de055dd77b020e40b8fc5c71303ee77e | |
parent | a80a66caf8110fc33af8013353fe0da0ae553a13 (diff) | |
parent | b3dcf3de8e4d71d79235fc67b6c5def6506c27f8 (diff) |
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
-rw-r--r-- | arch/s390/include/asm/cputime.h | 6 | ||||
-rw-r--r-- | arch/s390/kernel/ipl.c | 7 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 7 | ||||
-rw-r--r-- | arch/s390/kernel/swsusp_asm64.S | 2 | ||||
-rw-r--r-- | drivers/s390/char/sclp_async.c | 47 | ||||
-rw-r--r-- | drivers/s390/net/smsgiucv.c | 7 |
6 files changed, 36 insertions, 40 deletions
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 24b1244aadb9..f23961ada7fb 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
@@ -78,7 +78,7 @@ cputime64_to_jiffies64(cputime64_t cputime) | |||
78 | static inline unsigned int | 78 | static inline unsigned int |
79 | cputime_to_msecs(const cputime_t cputime) | 79 | cputime_to_msecs(const cputime_t cputime) |
80 | { | 80 | { |
81 | return __div(cputime, 4096000); | 81 | return cputime_div(cputime, 4096000); |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline cputime_t | 84 | static inline cputime_t |
@@ -160,7 +160,7 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value) | |||
160 | static inline clock_t | 160 | static inline clock_t |
161 | cputime_to_clock_t(cputime_t cputime) | 161 | cputime_to_clock_t(cputime_t cputime) |
162 | { | 162 | { |
163 | return __div(cputime, 4096000000ULL / USER_HZ); | 163 | return cputime_div(cputime, 4096000000ULL / USER_HZ); |
164 | } | 164 | } |
165 | 165 | ||
166 | static inline cputime_t | 166 | static inline cputime_t |
@@ -175,7 +175,7 @@ clock_t_to_cputime(unsigned long x) | |||
175 | static inline clock_t | 175 | static inline clock_t |
176 | cputime64_to_clock_t(cputime64_t cputime) | 176 | cputime64_to_clock_t(cputime64_t cputime) |
177 | { | 177 | { |
178 | return __div(cputime, 4096000000ULL / USER_HZ); | 178 | return cputime_div(cputime, 4096000000ULL / USER_HZ); |
179 | } | 179 | } |
180 | 180 | ||
181 | struct s390_idle_data { | 181 | struct s390_idle_data { |
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index ee57a42e6e93..4890ac6d7faa 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -1595,10 +1595,9 @@ static void stop_run(struct shutdown_trigger *trigger) | |||
1595 | { | 1595 | { |
1596 | if (strcmp(trigger->name, ON_PANIC_STR) == 0) | 1596 | if (strcmp(trigger->name, ON_PANIC_STR) == 0) |
1597 | disabled_wait((unsigned long) __builtin_return_address(0)); | 1597 | disabled_wait((unsigned long) __builtin_return_address(0)); |
1598 | else { | 1598 | while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy) |
1599 | signal_processor(smp_processor_id(), sigp_stop); | 1599 | cpu_relax(); |
1600 | for (;;); | 1600 | for (;;); |
1601 | } | ||
1602 | } | 1601 | } |
1603 | 1602 | ||
1604 | static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR, | 1603 | static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR, |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index c932caa5e850..93e52039321b 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -76,7 +76,6 @@ static int cpu_stopped(int cpu) | |||
76 | __u32 status; | 76 | __u32 status; |
77 | 77 | ||
78 | switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { | 78 | switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { |
79 | case sigp_order_code_accepted: | ||
80 | case sigp_status_stored: | 79 | case sigp_status_stored: |
81 | /* Check for stopped and check stop state */ | 80 | /* Check for stopped and check stop state */ |
82 | if (status & 0x50) | 81 | if (status & 0x50) |
@@ -638,6 +637,8 @@ void __cpu_die(unsigned int cpu) | |||
638 | /* Wait until target cpu is down */ | 637 | /* Wait until target cpu is down */ |
639 | while (!cpu_stopped(cpu)) | 638 | while (!cpu_stopped(cpu)) |
640 | cpu_relax(); | 639 | cpu_relax(); |
640 | while (signal_processor_p(0, cpu, sigp_set_prefix) == sigp_busy) | ||
641 | udelay(10); | ||
641 | smp_free_lowcore(cpu); | 642 | smp_free_lowcore(cpu); |
642 | pr_info("Processor %d stopped\n", cpu); | 643 | pr_info("Processor %d stopped\n", cpu); |
643 | } | 644 | } |
@@ -645,8 +646,8 @@ void __cpu_die(unsigned int cpu) | |||
645 | void cpu_die(void) | 646 | void cpu_die(void) |
646 | { | 647 | { |
647 | idle_task_exit(); | 648 | idle_task_exit(); |
648 | signal_processor(smp_processor_id(), sigp_stop); | 649 | while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy) |
649 | BUG(); | 650 | cpu_relax(); |
650 | for (;;); | 651 | for (;;); |
651 | } | 652 | } |
652 | 653 | ||
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S index 7c8653e27db6..0c26cc1898ec 100644 --- a/arch/s390/kernel/swsusp_asm64.S +++ b/arch/s390/kernel/swsusp_asm64.S | |||
@@ -199,6 +199,7 @@ pgm_check_entry: | |||
199 | brc 2,4b /* busy, try again */ | 199 | brc 2,4b /* busy, try again */ |
200 | 5: | 200 | 5: |
201 | sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */ | 201 | sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */ |
202 | brc 2,5b /* busy, try again */ | ||
202 | 6: j 6b | 203 | 6: j 6b |
203 | 204 | ||
204 | restart_suspend: | 205 | restart_suspend: |
@@ -206,6 +207,7 @@ restart_suspend: | |||
206 | llgh %r2,0(%r1) | 207 | llgh %r2,0(%r1) |
207 | 7: | 208 | 7: |
208 | sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */ | 209 | sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */ |
210 | brc 8,7b /* accepted, status 0, still running */ | ||
209 | brc 2,7b /* busy, try again */ | 211 | brc 2,7b /* busy, try again */ |
210 | tmll %r9,0x40 /* Test if resume CPU is stopped */ | 212 | tmll %r9,0x40 /* Test if resume CPU is stopped */ |
211 | jz 7b | 213 | jz 7b |
diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c index a4f68e5b9c96..b44462a6c6d3 100644 --- a/drivers/s390/char/sclp_async.c +++ b/drivers/s390/char/sclp_async.c | |||
@@ -26,7 +26,6 @@ static struct sclp_async_sccb *sccb; | |||
26 | static int sclp_async_send_wait(char *message); | 26 | static int sclp_async_send_wait(char *message); |
27 | static struct ctl_table_header *callhome_sysctl_header; | 27 | static struct ctl_table_header *callhome_sysctl_header; |
28 | static DEFINE_SPINLOCK(sclp_async_lock); | 28 | static DEFINE_SPINLOCK(sclp_async_lock); |
29 | static char nodename[64]; | ||
30 | #define SCLP_NORMAL_WRITE 0x00 | 29 | #define SCLP_NORMAL_WRITE 0x00 |
31 | 30 | ||
32 | struct async_evbuf { | 31 | struct async_evbuf { |
@@ -52,9 +51,10 @@ static struct sclp_register sclp_async_register = { | |||
52 | static int call_home_on_panic(struct notifier_block *self, | 51 | static int call_home_on_panic(struct notifier_block *self, |
53 | unsigned long event, void *data) | 52 | unsigned long event, void *data) |
54 | { | 53 | { |
55 | strncat(data, nodename, strlen(nodename)); | 54 | strncat(data, init_utsname()->nodename, |
56 | sclp_async_send_wait(data); | 55 | sizeof(init_utsname()->nodename)); |
57 | return NOTIFY_DONE; | 56 | sclp_async_send_wait(data); |
57 | return NOTIFY_DONE; | ||
58 | } | 58 | } |
59 | 59 | ||
60 | static struct notifier_block call_home_panic_nb = { | 60 | static struct notifier_block call_home_panic_nb = { |
@@ -68,15 +68,14 @@ static int proc_handler_callhome(struct ctl_table *ctl, int write, | |||
68 | { | 68 | { |
69 | unsigned long val; | 69 | unsigned long val; |
70 | int len, rc; | 70 | int len, rc; |
71 | char buf[2]; | 71 | char buf[3]; |
72 | 72 | ||
73 | if (!*count | (*ppos && !write)) { | 73 | if (!*count || (*ppos && !write)) { |
74 | *count = 0; | 74 | *count = 0; |
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
77 | if (!write) { | 77 | if (!write) { |
78 | len = sprintf(buf, "%d\n", callhome_enabled); | 78 | len = snprintf(buf, sizeof(buf), "%d\n", callhome_enabled); |
79 | buf[len] = '\0'; | ||
80 | rc = copy_to_user(buffer, buf, sizeof(buf)); | 79 | rc = copy_to_user(buffer, buf, sizeof(buf)); |
81 | if (rc != 0) | 80 | if (rc != 0) |
82 | return -EFAULT; | 81 | return -EFAULT; |
@@ -171,39 +170,29 @@ static int __init sclp_async_init(void) | |||
171 | rc = sclp_register(&sclp_async_register); | 170 | rc = sclp_register(&sclp_async_register); |
172 | if (rc) | 171 | if (rc) |
173 | return rc; | 172 | return rc; |
174 | callhome_sysctl_header = register_sysctl_table(kern_dir_table); | 173 | rc = -EOPNOTSUPP; |
175 | if (!callhome_sysctl_header) { | 174 | if (!(sclp_async_register.sclp_receive_mask & EVTYP_ASYNC_MASK)) |
176 | rc = -ENOMEM; | ||
177 | goto out_sclp; | ||
178 | } | ||
179 | if (!(sclp_async_register.sclp_receive_mask & EVTYP_ASYNC_MASK)) { | ||
180 | rc = -EOPNOTSUPP; | ||
181 | goto out_sclp; | 175 | goto out_sclp; |
182 | } | ||
183 | rc = -ENOMEM; | 176 | rc = -ENOMEM; |
177 | callhome_sysctl_header = register_sysctl_table(kern_dir_table); | ||
178 | if (!callhome_sysctl_header) | ||
179 | goto out_sclp; | ||
184 | request = kzalloc(sizeof(struct sclp_req), GFP_KERNEL); | 180 | request = kzalloc(sizeof(struct sclp_req), GFP_KERNEL); |
185 | if (!request) | ||
186 | goto out_sys; | ||
187 | sccb = (struct sclp_async_sccb *) get_zeroed_page(GFP_KERNEL | GFP_DMA); | 181 | sccb = (struct sclp_async_sccb *) get_zeroed_page(GFP_KERNEL | GFP_DMA); |
188 | if (!sccb) | 182 | if (!request || !sccb) |
189 | goto out_mem; | 183 | goto out_mem; |
190 | rc = atomic_notifier_chain_register(&panic_notifier_list, | 184 | rc = atomic_notifier_chain_register(&panic_notifier_list, |
191 | &call_home_panic_nb); | 185 | &call_home_panic_nb); |
192 | if (rc) | 186 | if (!rc) |
193 | goto out_mem; | 187 | goto out; |
194 | |||
195 | strncpy(nodename, init_utsname()->nodename, 64); | ||
196 | return 0; | ||
197 | |||
198 | out_mem: | 188 | out_mem: |
199 | kfree(request); | 189 | kfree(request); |
200 | free_page((unsigned long) sccb); | 190 | free_page((unsigned long) sccb); |
201 | out_sys: | ||
202 | unregister_sysctl_table(callhome_sysctl_header); | 191 | unregister_sysctl_table(callhome_sysctl_header); |
203 | out_sclp: | 192 | out_sclp: |
204 | sclp_unregister(&sclp_async_register); | 193 | sclp_unregister(&sclp_async_register); |
194 | out: | ||
205 | return rc; | 195 | return rc; |
206 | |||
207 | } | 196 | } |
208 | module_init(sclp_async_init); | 197 | module_init(sclp_async_init); |
209 | 198 | ||
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index 102000d1af6f..3012355f8304 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c | |||
@@ -158,7 +158,12 @@ static int smsg_pm_restore_thaw(struct device *dev) | |||
158 | smsg_path->flags = 0; | 158 | smsg_path->flags = 0; |
159 | rc = iucv_path_connect(smsg_path, &smsg_handler, "*MSG ", | 159 | rc = iucv_path_connect(smsg_path, &smsg_handler, "*MSG ", |
160 | NULL, NULL, NULL); | 160 | NULL, NULL, NULL); |
161 | printk(KERN_ERR "iucv_path_connect returned with rc %i\n", rc); | 161 | #ifdef CONFIG_PM_DEBUG |
162 | if (rc) | ||
163 | printk(KERN_ERR | ||
164 | "iucv_path_connect returned with rc %i\n", rc); | ||
165 | #endif | ||
166 | cpcmd("SET SMSG IUCV", NULL, 0, NULL); | ||
162 | } | 167 | } |
163 | return 0; | 168 | return 0; |
164 | } | 169 | } |