changeset 5035:8571b83c9ad0

6589682 IO-DOMAIN-RESET (Ontario-AA): kern_postprom panic on tavor-pcix configuration (reboot)
author jm22469
date Wed, 12 Sep 2007 16:14:19 -0700
parents 7c6859eb3dd0
children 4879e862fff8
files usr/src/uts/sun4v/promif/promif_prop.c
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/sun4v/promif/promif_prop.c	Wed Sep 12 15:45:31 2007 -0700
+++ b/usr/src/uts/sun4v/promif/promif_prop.c	Wed Sep 12 16:14:19 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -191,6 +191,12 @@
 	else
 		return (-1);
 
+	/*
+	 * 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);
+
 	req = kmem_zalloc(sizeof (var_config_hdr_t) + paylen, KM_SLEEP);
 	req->var_config_cmd = VAR_CONFIG_SET_REQ;
 	setp = &req->var_config_set;
@@ -201,17 +207,12 @@
 	    sizeof (var_config_hdr_t) + paylen)) != 0) {
 		cmn_err(CE_WARN, "%s: ds_cap_send failed: %d", me, rv);
 		kmem_free(req, sizeof (var_config_hdr_t) + paylen);
+		thread_affinity_clear(curthread);
 		return (-1);
 	}
 
 	kmem_free(req, sizeof (var_config_hdr_t) + paylen);
 
-	/*
-	 * 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);
-
 	mutex_enter(&promif_prop_lock);
 	if (cv_timedwait(&promif_prop_cv,
 	    &promif_prop_lock, lbolt + PROMIF_DS_TIMEOUT_SEC * hz) == -1) {