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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'libnvdimm-fixes-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
"A crash fix, a build warning fix, a miscellaneous small cleanups.

In case anyone is looking for them, there was a regression caught by
testing that caused two patches to be dropped from this update. Those
patches have been reworked and will soak for another week / re-target
5.0-rc4.

- Fix driver initialization crash due to the inability to report an
'error' state for a DIMM's security capability.

- Build warning fix for little-endian ARM64 builds

- Fix a potential race between the EDAC driver's usage of the NFIT
SMBIOS id for a DIMM and the driver shutdown path.

- A small collection of one-line benign cleanups for duplicate
variable assignments, a duplicate header include and a mis-typed
function argument"

* tag 'libnvdimm-fixes-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
libnvdimm/security: Fix nvdimm_security_state() state request selection
acpi/nfit: Remove duplicate set nd_set in acpi_nfit_init_interleave_set()
acpi/nfit: Fix race accessing memdev in nfit_get_smbios_id()
libnvdimm/dimm: Fix security capability detection for non-Intel NVDIMMs
nfit: Mark some functions as __maybe_unused
ACPI/nfit: delete the function to_acpi_nfit_desc
ACPI/nfit: delete the redundant header file

+14 -19
+7 -13
drivers/acpi/nfit/core.c
··· 26 26 #include <acpi/nfit.h> 27 27 #include "intel.h" 28 28 #include "nfit.h" 29 - #include "intel.h" 30 29 31 30 /* 32 31 * For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is ··· 76 77 return &nfit_uuid[id]; 77 78 } 78 79 EXPORT_SYMBOL(to_nfit_uuid); 79 - 80 - static struct acpi_nfit_desc *to_acpi_nfit_desc( 81 - struct nvdimm_bus_descriptor *nd_desc) 82 - { 83 - return container_of(nd_desc, struct acpi_nfit_desc, nd_desc); 84 - } 85 80 86 81 static struct acpi_device *to_acpi_dev(struct acpi_nfit_desc *acpi_desc) 87 82 { ··· 412 419 int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, 413 420 unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc) 414 421 { 415 - struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); 422 + struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); 416 423 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); 417 424 union acpi_object in_obj, in_buf, *out_obj; 418 425 const struct nd_cmd_desc *desc = NULL; ··· 714 721 struct acpi_nfit_memory_map *memdev; 715 722 struct acpi_nfit_desc *acpi_desc; 716 723 struct nfit_mem *nfit_mem; 724 + u16 physical_id; 717 725 718 726 mutex_lock(&acpi_desc_lock); 719 727 list_for_each_entry(acpi_desc, &acpi_descs, list) { ··· 722 728 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) { 723 729 memdev = __to_nfit_memdev(nfit_mem); 724 730 if (memdev->device_handle == device_handle) { 731 + *flags = memdev->flags; 732 + physical_id = memdev->physical_id; 725 733 mutex_unlock(&acpi_desc->init_mutex); 726 734 mutex_unlock(&acpi_desc_lock); 727 - *flags = memdev->flags; 728 - return memdev->physical_id; 735 + return physical_id; 729 736 } 730 737 } 731 738 mutex_unlock(&acpi_desc->init_mutex); ··· 2226 2231 nd_set = devm_kzalloc(dev, sizeof(*nd_set), GFP_KERNEL); 2227 2232 if (!nd_set) 2228 2233 return -ENOMEM; 2229 - ndr_desc->nd_set = nd_set; 2230 2234 guid_copy(&nd_set->type_guid, (guid_t *) spa->range_guid); 2231 2235 2232 2236 info = devm_kzalloc(dev, sizeof_nfit_set_info(nr), GFP_KERNEL); ··· 3361 3367 3362 3368 static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) 3363 3369 { 3364 - struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); 3370 + struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); 3365 3371 struct device *dev = acpi_desc->dev; 3366 3372 3367 3373 /* Bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */ ··· 3378 3384 static int __acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc, 3379 3385 struct nvdimm *nvdimm, unsigned int cmd) 3380 3386 { 3381 - struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); 3387 + struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); 3382 3388 3383 3389 if (nvdimm) 3384 3390 return 0;
+4 -4
drivers/acpi/nfit/intel.c
··· 146 146 147 147 static void nvdimm_invalidate_cache(void); 148 148 149 - static int intel_security_unlock(struct nvdimm *nvdimm, 149 + static int __maybe_unused intel_security_unlock(struct nvdimm *nvdimm, 150 150 const struct nvdimm_key_data *key_data) 151 151 { 152 152 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); ··· 227 227 return 0; 228 228 } 229 229 230 - static int intel_security_erase(struct nvdimm *nvdimm, 230 + static int __maybe_unused intel_security_erase(struct nvdimm *nvdimm, 231 231 const struct nvdimm_key_data *key, 232 232 enum nvdimm_passphrase_type ptype) 233 233 { ··· 276 276 return 0; 277 277 } 278 278 279 - static int intel_security_query_overwrite(struct nvdimm *nvdimm) 279 + static int __maybe_unused intel_security_query_overwrite(struct nvdimm *nvdimm) 280 280 { 281 281 int rc; 282 282 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); ··· 313 313 return 0; 314 314 } 315 315 316 - static int intel_security_overwrite(struct nvdimm *nvdimm, 316 + static int __maybe_unused intel_security_overwrite(struct nvdimm *nvdimm, 317 317 const struct nvdimm_key_data *nkey) 318 318 { 319 319 int rc;
+2 -2
drivers/nvdimm/nd-core.h
··· 54 54 }; 55 55 56 56 static inline enum nvdimm_security_state nvdimm_security_state( 57 - struct nvdimm *nvdimm, bool master) 57 + struct nvdimm *nvdimm, enum nvdimm_passphrase_type ptype) 58 58 { 59 59 if (!nvdimm->sec.ops) 60 60 return -ENXIO; 61 61 62 - return nvdimm->sec.ops->state(nvdimm, master); 62 + return nvdimm->sec.ops->state(nvdimm, ptype); 63 63 } 64 64 int nvdimm_security_freeze(struct nvdimm *nvdimm); 65 65 #if IS_ENABLED(CONFIG_NVDIMM_KEYS)
+1
include/linux/libnvdimm.h
··· 160 160 } 161 161 162 162 enum nvdimm_security_state { 163 + NVDIMM_SECURITY_ERROR = -1, 163 164 NVDIMM_SECURITY_DISABLED, 164 165 NVDIMM_SECURITY_UNLOCKED, 165 166 NVDIMM_SECURITY_LOCKED,