Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

acpi, nfit: collate health state flags

Be tolerant of cases where the BIOS provided NFIT does not consistently
set the flags in all NVDIMM Region Mapping structures associated with a
given dimm.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>

+14 -2
+14 -2
drivers/acpi/nfit/core.c
··· 457 457 INIT_LIST_HEAD(&nfit_memdev->list); 458 458 memcpy(nfit_memdev->memdev, memdev, sizeof(*memdev)); 459 459 list_add_tail(&nfit_memdev->list, &acpi_desc->memdevs); 460 - dev_dbg(dev, "%s: memdev handle: %#x spa: %d dcr: %d\n", 460 + dev_dbg(dev, "%s: memdev handle: %#x spa: %d dcr: %d flags: %#x\n", 461 461 __func__, memdev->device_handle, memdev->range_index, 462 - memdev->region_index); 462 + memdev->region_index, memdev->flags); 463 463 return true; 464 464 } 465 465 ··· 1505 1505 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) { 1506 1506 struct acpi_nfit_flush_address *flush; 1507 1507 unsigned long flags = 0, cmd_mask; 1508 + struct nfit_memdev *nfit_memdev; 1508 1509 u32 device_handle; 1509 1510 u16 mem_flags; 1510 1511 ··· 1518 1517 1519 1518 if (nfit_mem->bdw && nfit_mem->memdev_pmem) 1520 1519 flags |= NDD_ALIASING; 1520 + 1521 + /* collate flags across all memdevs for this dimm */ 1522 + list_for_each_entry(nfit_memdev, &acpi_desc->memdevs, list) { 1523 + struct acpi_nfit_memory_map *dimm_memdev; 1524 + 1525 + dimm_memdev = __to_nfit_memdev(nfit_mem); 1526 + if (dimm_memdev->device_handle 1527 + != nfit_memdev->memdev->device_handle) 1528 + continue; 1529 + dimm_memdev->flags |= nfit_memdev->memdev->flags; 1530 + } 1521 1531 1522 1532 mem_flags = __to_nfit_memdev(nfit_mem)->flags; 1523 1533 if (mem_flags & ACPI_NFIT_MEM_NOT_ARMED)