summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjm22469 <none@none>2008-01-04 10:37:38 -0800
committerjm22469 <none@none>2008-01-04 10:37:38 -0800
commitde81a4f48d467f6d0263221cbf4a199b6a925948 (patch)
treeeea665ee510d93d80c8c643d739f9109f42a803a
parent29aca3ebf883e2a4a625e1c033a0425de98d55ce (diff)
downloadillumos-gate-de81a4f48d467f6d0263221cbf4a199b6a925948.tar.gz
6644851 fix for 6620322 was incomplete
-rw-r--r--usr/src/uts/sun4v/promif/promif_io.c6
-rw-r--r--usr/src/uts/sun4v/promif/promif_prop.c4
-rw-r--r--usr/src/uts/sun4v/promif/promif_stree.c22
3 files changed, 16 insertions, 16 deletions
diff --git a/usr/src/uts/sun4v/promif/promif_io.c b/usr/src/uts/sun4v/promif/promif_io.c
index e229426aab..c7a910f877 100644
--- a/usr/src/uts/sun4v/promif/promif_io.c
+++ b/usr/src/uts/sun4v/promif/promif_io.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -199,9 +199,8 @@ promif_instance_to_path(void *p)
* Make sure we don't get dispatched onto a different
* cpu if we happen to sleep. See kern_postprom().
*/
- thread_affinity_set(curthread, CPU_CURRENT);
+ thread_affinity_set(curthread, CPU->cpu_id);
regval = kmem_zalloc(rlen, KM_SLEEP);
- thread_affinity_clear(curthread);
(void) prom_getprop(node, OBP_REG, regval);
@@ -211,6 +210,7 @@ promif_instance_to_path(void *p)
PROM_REG_TO_UNIT_ADDR(*csaddr), buf);
kmem_free(regval, rlen);
+ thread_affinity_clear(curthread);
(void) prom_strcpy(buf, scratch);
diff --git a/usr/src/uts/sun4v/promif/promif_prop.c b/usr/src/uts/sun4v/promif/promif_prop.c
index d45474bf83..cb76dc37c5 100644
--- a/usr/src/uts/sun4v/promif/promif_prop.c
+++ b/usr/src/uts/sun4v/promif/promif_prop.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -195,7 +195,7 @@ promif_ldom_setprop(char *name, void *value, int valuelen)
* Since we are emulating OBP, we must comply with the promif
* infrastructure and execute only on the originating cpu.
*/
- thread_affinity_set(curthread, CPU_CURRENT);
+ thread_affinity_set(curthread, CPU->cpu_id);
req = kmem_zalloc(sizeof (var_config_hdr_t) + paylen, KM_SLEEP);
req->var_config_cmd = VAR_CONFIG_SET_REQ;
diff --git a/usr/src/uts/sun4v/promif/promif_stree.c b/usr/src/uts/sun4v/promif/promif_stree.c
index ceeea1dca4..4a1f6e62f1 100644
--- a/usr/src/uts/sun4v/promif/promif_stree.c
+++ b/usr/src/uts/sun4v/promif/promif_stree.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -289,20 +289,20 @@ promif_stree_setprop(pnode_t nodeid, char *name, void *value, int len)
*/
for (prop = pnp->pn_propp; prop; prop = prop->pp_next)
if (prom_strcmp(prop->pp_name, name) == 0) {
+ /*
+ * Make sure we don't get dispatched onto a
+ * different cpu if we happen to sleep. See
+ * kern_postprom().
+ */
+ thread_affinity_set(curthread, CPU->cpu_id);
kmem_free(prop->pp_val, prop->pp_len);
+
prop->pp_val = NULL;
if (len > 0) {
- /*
- * Make sure we don't get dispatched onto a
- * different cpu if we happen to sleep. See
- * kern_postprom().
- */
- thread_affinity_set(curthread, CPU_CURRENT);
prop->pp_val = kmem_zalloc(len, KM_SLEEP);
- thread_affinity_clear(curthread);
-
bcopy(value, prop->pp_val, len);
}
+ thread_affinity_clear(curthread);
prop->pp_len = len;
return (len);
}
@@ -385,7 +385,7 @@ create_node(prom_node_t *parent, pnode_t node)
* Make sure we don't get dispatched onto a different
* cpu if we happen to sleep. See kern_postprom().
*/
- thread_affinity_set(curthread, CPU_CURRENT);
+ thread_affinity_set(curthread, CPU->cpu_id);
pnp = kmem_zalloc(sizeof (prom_node_t), KM_SLEEP);
pnp->pn_nodeid = node;
@@ -425,7 +425,7 @@ create_prop(prom_node_t *pnp, char *name, void *val, int len)
* Make sure we don't get dispatched onto a different
* cpu if we happen to sleep. See kern_postprom().
*/
- thread_affinity_set(curthread, CPU_CURRENT);
+ thread_affinity_set(curthread, CPU->cpu_id);
newprop = kmem_zalloc(sizeof (*newprop), KM_SLEEP);
newprop->pp_name = kmem_zalloc(prom_strlen(name) + 1, KM_SLEEP);
thread_affinity_clear(curthread);