diff options
-rw-r--r-- | drivers/acpi/nfit/core.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 6bc784bd0828..98d3bc6b90f1 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c | |||
@@ -55,6 +55,11 @@ static unsigned long override_dsm_mask; | |||
55 | module_param(override_dsm_mask, ulong, S_IRUGO); | 55 | module_param(override_dsm_mask, ulong, S_IRUGO); |
56 | MODULE_PARM_DESC(override_dsm_mask, "Bitmask of allowed NVDIMM DSM functions"); | 56 | MODULE_PARM_DESC(override_dsm_mask, "Bitmask of allowed NVDIMM DSM functions"); |
57 | 57 | ||
58 | static int default_dsm_family = -1; | ||
59 | module_param(default_dsm_family, int, S_IRUGO); | ||
60 | MODULE_PARM_DESC(default_dsm_family, | ||
61 | "Try this DSM type first when identifying NVDIMM family"); | ||
62 | |||
58 | LIST_HEAD(acpi_descs); | 63 | LIST_HEAD(acpi_descs); |
59 | DEFINE_MUTEX(acpi_desc_lock); | 64 | DEFINE_MUTEX(acpi_desc_lock); |
60 | 65 | ||
@@ -1372,6 +1377,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, | |||
1372 | unsigned long dsm_mask; | 1377 | unsigned long dsm_mask; |
1373 | const u8 *uuid; | 1378 | const u8 *uuid; |
1374 | int i; | 1379 | int i; |
1380 | int family = -1; | ||
1375 | 1381 | ||
1376 | /* nfit test assumes 1:1 relationship between commands and dsms */ | 1382 | /* nfit test assumes 1:1 relationship between commands and dsms */ |
1377 | nfit_mem->dsm_mask = acpi_desc->dimm_cmd_force_en; | 1383 | 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, | |||
1402 | */ | 1408 | */ |
1403 | for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++) | 1409 | for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++) |
1404 | if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1)) | 1410 | if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1)) |
1405 | break; | 1411 | if (family < 0 || i == default_dsm_family) |
1412 | family = i; | ||
1406 | 1413 | ||
1407 | /* limit the supported commands to those that are publicly documented */ | 1414 | /* limit the supported commands to those that are publicly documented */ |
1408 | nfit_mem->family = i; | 1415 | nfit_mem->family = family; |
1409 | if (override_dsm_mask && !disable_vendor_specific) | 1416 | if (override_dsm_mask && !disable_vendor_specific) |
1410 | dsm_mask = override_dsm_mask; | 1417 | dsm_mask = override_dsm_mask; |
1411 | else if (nfit_mem->family == NVDIMM_FAMILY_INTEL) { | 1418 | else if (nfit_mem->family == NVDIMM_FAMILY_INTEL) { |