Commit 60e95f43 authored by Linda Knippers's avatar Linda Knippers Committed by Dan Williams

nfit: Don't check _STA on NVDIMM devices

The _STA only applies to the root device, not the individual NVDIMMS,
so don't check here. NVDIMM device state flags are checked elsewhere.
Signed-off-by: default avatarLinda Knippers <linda.knippers@hp.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 6b47496a
...@@ -764,9 +764,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, ...@@ -764,9 +764,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
struct acpi_device *adev, *adev_dimm; struct acpi_device *adev, *adev_dimm;
struct device *dev = acpi_desc->dev; struct device *dev = acpi_desc->dev;
const u8 *uuid = to_nfit_uuid(NFIT_DEV_DIMM); const u8 *uuid = to_nfit_uuid(NFIT_DEV_DIMM);
unsigned long long sta; int i;
int i, rc = -ENODEV;
acpi_status status;
nfit_mem->dsm_mask = acpi_desc->dimm_dsm_force_en; nfit_mem->dsm_mask = acpi_desc->dimm_dsm_force_en;
adev = to_acpi_dev(acpi_desc); adev = to_acpi_dev(acpi_desc);
...@@ -781,25 +779,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, ...@@ -781,25 +779,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
return force_enable_dimms ? 0 : -ENODEV; return force_enable_dimms ? 0 : -ENODEV;
} }
status = acpi_evaluate_integer(adev_dimm->handle, "_STA", NULL, &sta);
if (status == AE_NOT_FOUND) {
dev_dbg(dev, "%s missing _STA, assuming enabled...\n",
dev_name(&adev_dimm->dev));
rc = 0;
} else if (ACPI_FAILURE(status))
dev_err(dev, "%s failed to retrieve_STA, disabling...\n",
dev_name(&adev_dimm->dev));
else if ((sta & ACPI_STA_DEVICE_ENABLED) == 0)
dev_info(dev, "%s disabled by firmware\n",
dev_name(&adev_dimm->dev));
else
rc = 0;
for (i = ND_CMD_SMART; i <= ND_CMD_VENDOR; i++) for (i = ND_CMD_SMART; i <= ND_CMD_VENDOR; i++)
if (acpi_check_dsm(adev_dimm->handle, uuid, 1, 1ULL << i)) if (acpi_check_dsm(adev_dimm->handle, uuid, 1, 1ULL << i))
set_bit(i, &nfit_mem->dsm_mask); set_bit(i, &nfit_mem->dsm_mask);
return force_enable_dimms ? 0 : rc; return 0;
} }
static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc) static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment