浏览代码

acpi, nfit: allow specifying a default DSM family

Provide the ability to request a default DSM family. If it is not
supported, then fall back to the normal discovery order.

This is helpful for testing platforms that support multiple DSM
families.  It will also allow administrators to request the DSM family
that their management tools support, which may not be the first one
found using the current discovery order.

Signed-off-by: Linda Knippers <linda.knippers@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Linda Knippers 8 年之前
父节点
当前提交
ba650cfcf9
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      drivers/acpi/nfit/core.c

+ 9 - 2
drivers/acpi/nfit/core.c

@@ -55,6 +55,11 @@ static unsigned long override_dsm_mask;
 module_param(override_dsm_mask, ulong, S_IRUGO);
 module_param(override_dsm_mask, ulong, S_IRUGO);
 MODULE_PARM_DESC(override_dsm_mask, "Bitmask of allowed NVDIMM DSM functions");
 MODULE_PARM_DESC(override_dsm_mask, "Bitmask of allowed NVDIMM DSM functions");
 
 
+static int default_dsm_family = -1;
+module_param(default_dsm_family, int, S_IRUGO);
+MODULE_PARM_DESC(default_dsm_family,
+		"Try this DSM type first when identifying NVDIMM family");
+
 LIST_HEAD(acpi_descs);
 LIST_HEAD(acpi_descs);
 DEFINE_MUTEX(acpi_desc_lock);
 DEFINE_MUTEX(acpi_desc_lock);
 
 
@@ -1372,6 +1377,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
 	unsigned long dsm_mask;
 	unsigned long dsm_mask;
 	const u8 *uuid;
 	const u8 *uuid;
 	int i;
 	int i;
+	int family = -1;
 
 
 	/* nfit test assumes 1:1 relationship between commands and dsms */
 	/* nfit test assumes 1:1 relationship between commands and dsms */
 	nfit_mem->dsm_mask = acpi_desc->dimm_cmd_force_en;
 	nfit_mem->dsm_mask = acpi_desc->dimm_cmd_force_en;
@@ -1402,10 +1408,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
 	 */
 	 */
 	for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
 	for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
 		if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
 		if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
-			break;
+			if (family < 0 || i == default_dsm_family)
+				family = i;
 
 
 	/* limit the supported commands to those that are publicly documented */
 	/* limit the supported commands to those that are publicly documented */
-	nfit_mem->family = i;
+	nfit_mem->family = family;
 	if (override_dsm_mask && !disable_vendor_specific)
 	if (override_dsm_mask && !disable_vendor_specific)
 		dsm_mask = override_dsm_mask;
 		dsm_mask = override_dsm_mask;
 	else if (nfit_mem->family == NVDIMM_FAMILY_INTEL) {
 	else if (nfit_mem->family == NVDIMM_FAMILY_INTEL) {