Skip to content

Commit

Permalink
nfit: make DIMM DSMs optional
Browse files Browse the repository at this point in the history
Commit 4995734 "acpi, nfit: fix acpi_check_dsm() vs zero functions
implemented" attempted to fix a QEMU regression by supporting its usage
of a zero-mask as a valid response to a DSM-family probe request.
However, this behavior breaks HP platforms that return a zero-mask by
default causing the probe to misidentify the DSM-family.

Instead, the QEMU regression can be fixed by simply not requiring the DSM
family to be identified.

This effectively reverts commit 4995734, and removes the DSM
requirement from the init path.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Cc: Linda Knippers <linda.knippers@hpe.com>
Fixes: 4995734 ("acpi, nfit: fix acpi_check_dsm() vs zero functions implemented")
Reported-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Tested-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed Jul 19, 2016
1 parent a99cde4 commit a722559
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions drivers/acpi/nfit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,11 +1131,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,

/*
* Until standardization materializes we need to consider up to 3
* different command sets. Note, that checking for zero functions
* tells us if any commands might be reachable through this uuid.
* different command sets. Note, that checking for function0 (bit0)
* tells us if any commands are reachable through this uuid.
*/
for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 0))
if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
break;

/* limit the supported commands to those that are publicly documented */
Expand All @@ -1151,9 +1151,10 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
if (disable_vendor_specific)
dsm_mask &= ~(1 << 8);
} else {
dev_err(dev, "unknown dimm command family\n");
dev_dbg(dev, "unknown dimm command family\n");
nfit_mem->family = -1;
return force_enable_dimms ? 0 : -ENODEV;
/* DSMs are optional, continue loading the driver... */
return 0;
}

uuid = to_nfit_uuid(nfit_mem->family);
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,9 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs)
u64 mask = 0;
union acpi_object *obj;

if (funcs == 0)
return false;

obj = acpi_evaluate_dsm(handle, uuid, rev, 0, NULL);
if (!obj)
return false;
Expand All @@ -692,9 +695,6 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs)
mask |= (((u64)obj->buffer.pointer[i]) << (i * 8));
ACPI_FREE(obj);

if (funcs == 0)
return true;

/*
* Bit 0 indicates whether there's support for any functions other than
* function 0 for the specified UUID and revision.
Expand Down

0 comments on commit a722559

Please sign in to comment.