Merge tag 'edac_for_4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Pull EDAC updates from Borislav Petkov: "Noteworthy is the NVDIMM support: - NVDIMM support to EDAC (Tony Luck) - misc fixes" * tag 'edac_for_4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC, sb_edac: Remove variable length array usage EDAC, skx_edac: Detect non-volatile DIMMs firmware, DMI: Add function to look up a handle and return DIMM size acpi, nfit: Add function to look up nvdimm device and provide SMBIOS handle EDAC: Add new memory type for non-volatile DIMMs EDAC: Drop duplicated array of strings for memory type names EDAC, layerscape: Allow building for LS1021A
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/nd.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <acpi/nfit.h>
|
||||
#include "nfit.h"
|
||||
|
||||
/*
|
||||
@@ -690,6 +691,32 @@ static bool add_memdev(struct acpi_nfit_desc *acpi_desc,
|
||||
return true;
|
||||
}
|
||||
|
||||
int nfit_get_smbios_id(u32 device_handle, u16 *flags)
|
||||
{
|
||||
struct acpi_nfit_memory_map *memdev;
|
||||
struct acpi_nfit_desc *acpi_desc;
|
||||
struct nfit_mem *nfit_mem;
|
||||
|
||||
mutex_lock(&acpi_desc_lock);
|
||||
list_for_each_entry(acpi_desc, &acpi_descs, list) {
|
||||
mutex_lock(&acpi_desc->init_mutex);
|
||||
list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) {
|
||||
memdev = __to_nfit_memdev(nfit_mem);
|
||||
if (memdev->device_handle == device_handle) {
|
||||
mutex_unlock(&acpi_desc->init_mutex);
|
||||
mutex_unlock(&acpi_desc_lock);
|
||||
*flags = memdev->flags;
|
||||
return memdev->physical_id;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&acpi_desc->init_mutex);
|
||||
}
|
||||
mutex_unlock(&acpi_desc_lock);
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nfit_get_smbios_id);
|
||||
|
||||
/*
|
||||
* An implementation may provide a truncated control region if no block windows
|
||||
* are defined.
|
||||
|
Reference in New Issue
Block a user