Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a6771e2 authored by Dan Williams's avatar Dan Williams Committed by Greg Kroah-Hartman
Browse files

nfit: fix region registration vs block-data-window ranges



commit 8d0d8ed3356aa9ed43b819aaedd39b08ca453007 upstream.

Commit 1cf03c00 "nfit: scrub and register regions in a workqueue"
mistakenly attempts to register a region per BLK aperture. There is
nothing to register for individual apertures as they belong as a set to
a BLK aperture group that are registered with a corresponding
DIMM-control-region. Filter them for registration to prevent some
needless devm_kzalloc() allocations.

Cc: <stable@vger.kernel.org>
Fixes: 1cf03c00 ("nfit: scrub and register regions in a workqueue")
Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 51a9580d
Loading
Loading
Loading
Loading
+14 −8
Original line number Original line Diff line number Diff line
@@ -2748,11 +2748,17 @@ static void acpi_nfit_scrub(struct work_struct *work)
static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc)
static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc)
{
{
	struct nfit_spa *nfit_spa;
	struct nfit_spa *nfit_spa;
	int rc;


	list_for_each_entry(nfit_spa, &acpi_desc->spas, list)
	list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
		if (nfit_spa_type(nfit_spa->spa) == NFIT_SPA_DCR) {
		int rc, type = nfit_spa_type(nfit_spa->spa);
			/* BLK regions don't need to wait for ars results */

		/* PMEM and VMEM will be registered by the ARS workqueue */
		if (type == NFIT_SPA_PM || type == NFIT_SPA_VOLATILE)
			continue;
		/* BLK apertures belong to BLK region registration below */
		if (type == NFIT_SPA_BDW)
			continue;
		/* BLK regions don't need to wait for ARS results */
		rc = acpi_nfit_register_region(acpi_desc, nfit_spa);
		rc = acpi_nfit_register_region(acpi_desc, nfit_spa);
		if (rc)
		if (rc)
			return rc;
			return rc;