diff options
author | Justin Frank <Justin.Frank@Sun.COM> | 2010-07-09 08:57:07 -0700 |
---|---|---|
committer | Justin Frank <Justin.Frank@Sun.COM> | 2010-07-09 08:57:07 -0700 |
commit | 79b62d188314c819c0ad05bd4af8d21166941e49 (patch) | |
tree | 7d30d7d25250114f5164e344aeac18a44e860804 /usr | |
parent | 6a45aeb4299937971b2d4ebd68553ee5a39fe913 (diff) | |
download | illumos-gate-79b62d188314c819c0ad05bd4af8d21166941e49.tar.gz |
6943714 sparc fast reboot should not kmem_alloc(...KM_SLEEP) when single-threaded
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/uts/sun4u/os/mach_cpu_states.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/usr/src/uts/sun4u/os/mach_cpu_states.c b/usr/src/uts/sun4u/os/mach_cpu_states.c index 449d187f37..4481efa2fe 100644 --- a/usr/src/uts/sun4u/os/mach_cpu_states.c +++ b/usr/src/uts/sun4u/os/mach_cpu_states.c @@ -163,19 +163,25 @@ mdboot(int cmd, int fcn, char *bootstr, boolean_t invoke_cb) } else { dllen = prom_getproplen(onode, "diag-level"); if (dllen != -1) { - int newstrlen; char *newstr = kmem_alloc(strlen( - bootstr) + dllen + 5, KM_SLEEP); - (void) strcpy(newstr, bootstr); - (void) strcat(newstr, " -f "); - newstrlen = strlen(bootstr) + 4; - (void) prom_getprop(onode, "diag-level", - (caddr_t)&(newstr[newstrlen])); - newstr[newstrlen + dllen] = '\0'; - bootstr = newstr; + bootstr) + dllen + 5, KM_NOSLEEP); + if (newstr != NULL) { + int newstrlen; + (void) strcpy(newstr, bootstr); + (void) strcat(newstr, " -f "); + newstrlen = strlen(bootstr) + 4; + (void) prom_getprop(onode, + "diag-level", + (caddr_t) + &(newstr[newstrlen])); + newstr[newstrlen + dllen] = + '\0'; + bootstr = newstr; + (void) prom_setprop(onode, + "diag-level", + "off", 4); + } } - (void) prom_setprop(onode, "diag-level", - "off", 4); } } reboot_machine(bootstr); |