changeset 10996:f4f8f596fbe7

6897970 'hotplug set' prints unexpected warning messages sometimes
author Evan Yan <Evan.Yan@Sun.COM>
date Sun, 08 Nov 2009 00:41:31 +0800
parents 33bbc4195426
children 2ff33cc68aa6
files usr/src/uts/common/io/pciex/hotplug/pciehpc.c usr/src/uts/common/io/pciex/hotplug/pcishpc.c
diffstat 2 files changed, 42 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/pciex/hotplug/pciehpc.c	Sat Nov 07 15:27:17 2009 +0800
+++ b/usr/src/uts/common/io/pciex/hotplug/pciehpc.c	Sun Nov 08 00:41:31 2009 +0800
@@ -1662,7 +1662,7 @@
 			value = pcie_slot_condition_text(slot_p->hs_condition);
 		} else {
 			/* unsupported property */
-			cmn_err(CE_WARN, "Unsupported property: %s\n", name);
+			PCIE_DBG("Unsupported property: %s\n", name);
 
 			ret = DDI_ENOTSUP;
 			goto get_prop_cleanup2;
@@ -1806,14 +1806,14 @@
 	while (prop_pair = nvlist_next_nvpair(prop_list, prop_pair)) {
 		name = nvpair_name(prop_pair);
 		if (nvpair_type(prop_pair) != DATA_TYPE_STRING) {
-			cmn_err(CE_WARN, "Unexpected data type of setting "
+			PCIE_DBG("Unexpected data type of setting "
 			    "property %s.\n", name);
 			ret = DDI_EINVAL;
 			goto set_prop_cleanup;
 		}
 		if (nvpair_value_string(prop_pair, &value)) {
-			cmn_err(CE_WARN, "Get string value failed for property "
-			    "%s.\n", name);
+			PCIE_DBG("Get string value failed for property %s.\n",
+			    name);
 			ret = DDI_FAILURE;
 			goto set_prop_cleanup;
 		}
@@ -1822,13 +1822,13 @@
 			if ((strcmp(value, PCIEHPC_PROP_VALUE_ON) != 0) &&
 			    (strcmp(value, PCIEHPC_PROP_VALUE_OFF) != 0) &&
 			    (strcmp(value, PCIEHPC_PROP_VALUE_BLINK) != 0)) {
-				cmn_err(CE_WARN, "Unsupported value of setting "
+				PCIE_DBG("Unsupported value of setting "
 				    "property %s\n", name);
 				ret = DDI_ENOTSUP;
 				goto set_prop_cleanup;
 			}
 		} else {
-			cmn_err(CE_WARN, "Unsupported property: %s\n", name);
+			PCIE_DBG("Unsupported property: %s\n", name);
 			ret = DDI_ENOTSUP;
 			goto set_prop_cleanup;
 		}
@@ -1855,6 +1855,21 @@
 			    led_state);
 		}
 	}
+	if (rval) {
+		if (get_udatamodel() == DATAMODEL_NATIVE) {
+			result.buf_size = 0;
+			if (copyout(&result, rval, sizeof (ddi_hp_property_t)))
+				ret =  DDI_FAILURE;
+		}
+#ifdef _SYSCALL32_IMPL
+		else {
+			result32.buf_size = 0;
+			if (copyout(&result32, rval,
+			    sizeof (ddi_hp_property32_t)))
+				ret =  DDI_FAILURE;
+		}
+#endif
+	}
 
 	mutex_exit(&ctrl_p->hc_mutex);
 set_prop_cleanup:
--- a/usr/src/uts/common/io/pciex/hotplug/pcishpc.c	Sat Nov 07 15:27:17 2009 +0800
+++ b/usr/src/uts/common/io/pciex/hotplug/pcishpc.c	Sun Nov 08 00:41:31 2009 +0800
@@ -523,7 +523,7 @@
 			value = pcie_slot_condition_text(slot_p->hs_condition);
 		} else {
 			/* unsupported property */
-			cmn_err(CE_WARN, "Unsupported property: %s\n", name);
+			PCIE_DBG("Unsupported property: %s\n", name);
 
 			ret = DDI_ENOTSUP;
 			goto get_prop_cleanup2;
@@ -669,14 +669,14 @@
 	while (prop_pair = nvlist_next_nvpair(prop_list, prop_pair)) {
 		name = nvpair_name(prop_pair);
 		if (nvpair_type(prop_pair) != DATA_TYPE_STRING) {
-			cmn_err(CE_WARN, "Unexpected data type of setting "
+			PCIE_DBG("Unexpected data type of setting "
 			    "property %s.\n", name);
 			ret = DDI_EINVAL;
 			goto set_prop_cleanup;
 		}
 		if (nvpair_value_string(prop_pair, &value)) {
-			cmn_err(CE_WARN, "Get string value failed for property "
-			    "%s.\n", name);
+			PCIE_DBG("Get string value failed for property %s.\n",
+			    name);
 			ret = DDI_FAILURE;
 			goto set_prop_cleanup;
 		}
@@ -685,13 +685,13 @@
 			if ((strcmp(value, PCIEHPC_PROP_VALUE_ON) != 0) &&
 			    (strcmp(value, PCIEHPC_PROP_VALUE_OFF) != 0) &&
 			    (strcmp(value, PCIEHPC_PROP_VALUE_BLINK) != 0)) {
-				cmn_err(CE_WARN, "Unsupported value of setting "
+				PCIE_DBG("Unsupported value of setting "
 				    "property %s\n", name);
 				ret = DDI_ENOTSUP;
 				goto set_prop_cleanup;
 			}
 		} else {
-			cmn_err(CE_WARN, "Unsupported property: %s\n", name);
+			PCIE_DBG("Unsupported property: %s\n", name);
 			ret = DDI_ENOTSUP;
 			goto set_prop_cleanup;
 		}
@@ -719,6 +719,21 @@
 			    led_state);
 		}
 	}
+	if (rval) {
+		if (get_udatamodel() == DATAMODEL_NATIVE) {
+			result.buf_size = 0;
+			if (copyout(&result, rval, sizeof (ddi_hp_property_t)))
+				ret =  DDI_FAILURE;
+		}
+#ifdef _SYSCALL32_IMPL
+		else {
+			result32.buf_size = 0;
+			if (copyout(&result32, rval,
+			    sizeof (ddi_hp_property32_t)))
+				ret =  DDI_FAILURE;
+		}
+#endif
+	}
 
 	mutex_exit(&ctrl_p->hc_mutex);
 set_prop_cleanup: