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

Merge tag 'libnvdimm-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull nvdimm updates from Ira Weiny:
"The changes include removing duplicate code and updating the nvdimm
tree to the current kernel interfaces such as using const for struct
device_type and changing the platform remove callback signature"

* tag 'libnvdimm-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
dax: remove redundant assignment to variable rc
ndtest: Convert to platform remove callback returning void
nvdimm/btt: always set max_integrity_segments
nvdimm: remove nd_integrity_init
dax: constify the struct device_type usage
powerpc/papr_scm: Move duplicate definitions to common header files

+66 -112
+2
MAINTAINERS
··· 12633 12633 F: drivers/scsi/ibmvscsi/ 12634 12634 F: drivers/tty/hvc/hvc_opal.c 12635 12635 F: drivers/watchdog/wdrtas.c 12636 + F: include/linux/papr_scm.h 12637 + F: include/uapi/linux/papr_pdsm.h 12636 12638 F: tools/testing/selftests/powerpc 12637 12639 N: /pmac 12638 12640 N: powermac
arch/powerpc/include/uapi/asm/papr_pdsm.h include/uapi/linux/papr_pdsm.h
+2 -41
arch/powerpc/platforms/pseries/papr_scm.c
··· 16 16 #include <linux/nd.h> 17 17 18 18 #include <asm/plpar_wrappers.h> 19 - #include <asm/papr_pdsm.h> 19 + #include <uapi/linux/papr_pdsm.h> 20 + #include <linux/papr_scm.h> 20 21 #include <asm/mce.h> 21 22 #include <asm/unaligned.h> 22 23 #include <linux/perf_event.h> ··· 29 28 (1ul << ND_CMD_GET_CONFIG_DATA) | \ 30 29 (1ul << ND_CMD_SET_CONFIG_DATA) | \ 31 30 (1ul << ND_CMD_CALL)) 32 - 33 - /* DIMM health bitmap indicators */ 34 - /* SCM device is unable to persist memory contents */ 35 - #define PAPR_PMEM_UNARMED (1ULL << (63 - 0)) 36 - /* SCM device failed to persist memory contents */ 37 - #define PAPR_PMEM_SHUTDOWN_DIRTY (1ULL << (63 - 1)) 38 - /* SCM device contents are persisted from previous IPL */ 39 - #define PAPR_PMEM_SHUTDOWN_CLEAN (1ULL << (63 - 2)) 40 - /* SCM device contents are not persisted from previous IPL */ 41 - #define PAPR_PMEM_EMPTY (1ULL << (63 - 3)) 42 - /* SCM device memory life remaining is critically low */ 43 - #define PAPR_PMEM_HEALTH_CRITICAL (1ULL << (63 - 4)) 44 - /* SCM device will be garded off next IPL due to failure */ 45 - #define PAPR_PMEM_HEALTH_FATAL (1ULL << (63 - 5)) 46 - /* SCM contents cannot persist due to current platform health status */ 47 - #define PAPR_PMEM_HEALTH_UNHEALTHY (1ULL << (63 - 6)) 48 - /* SCM device is unable to persist memory contents in certain conditions */ 49 - #define PAPR_PMEM_HEALTH_NON_CRITICAL (1ULL << (63 - 7)) 50 - /* SCM device is encrypted */ 51 - #define PAPR_PMEM_ENCRYPTED (1ULL << (63 - 8)) 52 - /* SCM device has been scrubbed and locked */ 53 - #define PAPR_PMEM_SCRUBBED_AND_LOCKED (1ULL << (63 - 9)) 54 - 55 - /* Bits status indicators for health bitmap indicating unarmed dimm */ 56 - #define PAPR_PMEM_UNARMED_MASK (PAPR_PMEM_UNARMED | \ 57 - PAPR_PMEM_HEALTH_UNHEALTHY) 58 - 59 - /* Bits status indicators for health bitmap indicating unflushed dimm */ 60 - #define PAPR_PMEM_BAD_SHUTDOWN_MASK (PAPR_PMEM_SHUTDOWN_DIRTY) 61 - 62 - /* Bits status indicators for health bitmap indicating unrestored dimm */ 63 - #define PAPR_PMEM_BAD_RESTORE_MASK (PAPR_PMEM_EMPTY) 64 - 65 - /* Bit status indicators for smart event notification */ 66 - #define PAPR_PMEM_SMART_EVENT_MASK (PAPR_PMEM_HEALTH_CRITICAL | \ 67 - PAPR_PMEM_HEALTH_FATAL | \ 68 - PAPR_PMEM_HEALTH_UNHEALTHY) 69 - 70 - #define PAPR_SCM_PERF_STATS_EYECATCHER __stringify(SCMSTATS) 71 - #define PAPR_SCM_PERF_STATS_VERSION 0x1 72 31 73 32 /* Struct holding a single performance metric */ 74 33 struct papr_scm_perf_stat {
+1 -2
drivers/dax/bus.c
··· 818 818 NULL, 819 819 }; 820 820 821 - static struct device_type dax_mapping_type = { 821 + static const struct device_type dax_mapping_type = { 822 822 .release = dax_mapping_release, 823 823 .groups = dax_mapping_attribute_groups, 824 824 }; ··· 1204 1204 if (rc) 1205 1205 return rc; 1206 1206 1207 - rc = -ENXIO; 1208 1207 rc = down_write_killable(&dax_region_rwsem); 1209 1208 if (rc) 1210 1209 return rc;
+8 -4
drivers/nvdimm/btt.c
··· 6 6 #include <linux/highmem.h> 7 7 #include <linux/debugfs.h> 8 8 #include <linux/blkdev.h> 9 + #include <linux/blk-integrity.h> 9 10 #include <linux/pagemap.h> 10 11 #include <linux/module.h> 11 12 #include <linux/device.h> ··· 1500 1499 struct queue_limits lim = { 1501 1500 .logical_block_size = btt->sector_size, 1502 1501 .max_hw_sectors = UINT_MAX, 1502 + .max_integrity_segments = 1, 1503 1503 }; 1504 1504 int rc; 1505 1505 ··· 1516 1514 blk_queue_flag_set(QUEUE_FLAG_NONROT, btt->btt_disk->queue); 1517 1515 blk_queue_flag_set(QUEUE_FLAG_SYNCHRONOUS, btt->btt_disk->queue); 1518 1516 1519 - if (btt_meta_size(btt)) { 1520 - rc = nd_integrity_init(btt->btt_disk, btt_meta_size(btt)); 1521 - if (rc) 1522 - goto out_cleanup_disk; 1517 + if (btt_meta_size(btt) && IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY)) { 1518 + struct blk_integrity bi = { 1519 + .tuple_size = btt_meta_size(btt), 1520 + .tag_size = btt_meta_size(btt), 1521 + }; 1522 + blk_integrity_register(btt->btt_disk, &bi); 1523 1523 } 1524 1524 1525 1525 set_capacity(btt->btt_disk, btt->nlba * btt->sector_size >> 9);
-30
drivers/nvdimm/core.c
··· 7 7 #include <linux/export.h> 8 8 #include <linux/module.h> 9 9 #include <linux/blkdev.h> 10 - #include <linux/blk-integrity.h> 11 10 #include <linux/device.h> 12 11 #include <linux/ctype.h> 13 12 #include <linux/ndctl.h> ··· 506 507 return badrange_add(&nvdimm_bus->badrange, addr, length); 507 508 } 508 509 EXPORT_SYMBOL_GPL(nvdimm_bus_add_badrange); 509 - 510 - #ifdef CONFIG_BLK_DEV_INTEGRITY 511 - int nd_integrity_init(struct gendisk *disk, unsigned long meta_size) 512 - { 513 - struct blk_integrity bi; 514 - 515 - if (meta_size == 0) 516 - return 0; 517 - 518 - memset(&bi, 0, sizeof(bi)); 519 - 520 - bi.tuple_size = meta_size; 521 - bi.tag_size = meta_size; 522 - 523 - blk_integrity_register(disk, &bi); 524 - blk_queue_max_integrity_segments(disk->queue, 1); 525 - 526 - return 0; 527 - } 528 - EXPORT_SYMBOL(nd_integrity_init); 529 - 530 - #else /* CONFIG_BLK_DEV_INTEGRITY */ 531 - int nd_integrity_init(struct gendisk *disk, unsigned long meta_size) 532 - { 533 - return 0; 534 - } 535 - EXPORT_SYMBOL(nd_integrity_init); 536 - 537 - #endif 538 510 539 511 static __init int libnvdimm_init(void) 540 512 {
-1
drivers/nvdimm/nd.h
··· 489 489 ND_ASYNC, 490 490 }; 491 491 492 - int nd_integrity_init(struct gendisk *disk, unsigned long meta_size); 493 492 void wait_nvdimm_bus_probe_idle(struct device *dev); 494 493 void nd_device_register(struct device *dev); 495 494 void nd_device_unregister(struct device *dev, enum nd_async_mode mode);
+49
include/linux/papr_scm.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef __LINUX_PAPR_SCM_H 3 + #define __LINUX_PAPR_SCM_H 4 + 5 + /* DIMM health bitmap indicators */ 6 + /* SCM device is unable to persist memory contents */ 7 + #define PAPR_PMEM_UNARMED (1ULL << (63 - 0)) 8 + /* SCM device failed to persist memory contents */ 9 + #define PAPR_PMEM_SHUTDOWN_DIRTY (1ULL << (63 - 1)) 10 + /* SCM device contents are persisted from previous IPL */ 11 + #define PAPR_PMEM_SHUTDOWN_CLEAN (1ULL << (63 - 2)) 12 + /* SCM device contents are not persisted from previous IPL */ 13 + #define PAPR_PMEM_EMPTY (1ULL << (63 - 3)) 14 + /* SCM device memory life remaining is critically low */ 15 + #define PAPR_PMEM_HEALTH_CRITICAL (1ULL << (63 - 4)) 16 + /* SCM device will be garded off next IPL due to failure */ 17 + #define PAPR_PMEM_HEALTH_FATAL (1ULL << (63 - 5)) 18 + /* SCM contents cannot persist due to current platform health status */ 19 + #define PAPR_PMEM_HEALTH_UNHEALTHY (1ULL << (63 - 6)) 20 + /* SCM device is unable to persist memory contents in certain conditions */ 21 + #define PAPR_PMEM_HEALTH_NON_CRITICAL (1ULL << (63 - 7)) 22 + /* SCM device is encrypted */ 23 + #define PAPR_PMEM_ENCRYPTED (1ULL << (63 - 8)) 24 + /* SCM device has been scrubbed and locked */ 25 + #define PAPR_PMEM_SCRUBBED_AND_LOCKED (1ULL << (63 - 9)) 26 + 27 + #define PAPR_PMEM_SAVE_FAILED (1ULL << (63 - 10)) 28 + 29 + /* Bits status indicators for health bitmap indicating unarmed dimm */ 30 + #define PAPR_PMEM_UNARMED_MASK (PAPR_PMEM_UNARMED | \ 31 + PAPR_PMEM_HEALTH_UNHEALTHY) 32 + 33 + /* Bits status indicators for health bitmap indicating unflushed dimm */ 34 + #define PAPR_PMEM_BAD_SHUTDOWN_MASK (PAPR_PMEM_SHUTDOWN_DIRTY) 35 + 36 + /* Bits status indicators for health bitmap indicating unrestored dimm */ 37 + #define PAPR_PMEM_BAD_RESTORE_MASK (PAPR_PMEM_EMPTY) 38 + 39 + /* Bit status indicators for smart event notification */ 40 + #define PAPR_PMEM_SMART_EVENT_MASK (PAPR_PMEM_HEALTH_CRITICAL | \ 41 + PAPR_PMEM_HEALTH_FATAL | \ 42 + PAPR_PMEM_HEALTH_UNHEALTHY) 43 + 44 + #define PAPR_PMEM_SAVE_MASK (PAPR_PMEM_SAVE_FAILED) 45 + 46 + #define PAPR_SCM_PERF_STATS_EYECATCHER __stringify(SCMSTATS) 47 + #define PAPR_SCM_PERF_STATS_VERSION 0x1 48 + 49 + #endif /* __LINUX_PAPR_SCM_H */
+4 -3
tools/testing/nvdimm/test/ndtest.c
··· 13 13 #include <nd-core.h> 14 14 #include <linux/printk.h> 15 15 #include <linux/seq_buf.h> 16 + #include <linux/papr_scm.h> 17 + #include <uapi/linux/papr_pdsm.h> 16 18 17 19 #include "../watermark.h" 18 20 #include "nfit_test.h" ··· 832 830 return 0; 833 831 } 834 832 835 - static int ndtest_remove(struct platform_device *pdev) 833 + static void ndtest_remove(struct platform_device *pdev) 836 834 { 837 835 struct ndtest_priv *p = to_ndtest_priv(&pdev->dev); 838 836 839 837 nvdimm_bus_unregister(p->bus); 840 - return 0; 841 838 } 842 839 843 840 static int ndtest_probe(struct platform_device *pdev) ··· 883 882 884 883 static struct platform_driver ndtest_driver = { 885 884 .probe = ndtest_probe, 886 - .remove = ndtest_remove, 885 + .remove_new = ndtest_remove, 887 886 .driver = { 888 887 .name = KBUILD_MODNAME, 889 888 },
-31
tools/testing/nvdimm/test/ndtest.h
··· 5 5 #include <linux/platform_device.h> 6 6 #include <linux/libnvdimm.h> 7 7 8 - /* SCM device is unable to persist memory contents */ 9 - #define PAPR_PMEM_UNARMED (1ULL << (63 - 0)) 10 - /* SCM device failed to persist memory contents */ 11 - #define PAPR_PMEM_SHUTDOWN_DIRTY (1ULL << (63 - 1)) 12 - /* SCM device contents are not persisted from previous IPL */ 13 - #define PAPR_PMEM_EMPTY (1ULL << (63 - 3)) 14 - #define PAPR_PMEM_HEALTH_CRITICAL (1ULL << (63 - 4)) 15 - /* SCM device will be garded off next IPL due to failure */ 16 - #define PAPR_PMEM_HEALTH_FATAL (1ULL << (63 - 5)) 17 - /* SCM contents cannot persist due to current platform health status */ 18 - #define PAPR_PMEM_HEALTH_UNHEALTHY (1ULL << (63 - 6)) 19 - 20 - /* Bits status indicators for health bitmap indicating unarmed dimm */ 21 - #define PAPR_PMEM_UNARMED_MASK (PAPR_PMEM_UNARMED | \ 22 - PAPR_PMEM_HEALTH_UNHEALTHY) 23 - 24 - #define PAPR_PMEM_SAVE_FAILED (1ULL << (63 - 10)) 25 - 26 - /* Bits status indicators for health bitmap indicating unflushed dimm */ 27 - #define PAPR_PMEM_BAD_SHUTDOWN_MASK (PAPR_PMEM_SHUTDOWN_DIRTY) 28 - 29 - /* Bits status indicators for health bitmap indicating unrestored dimm */ 30 - #define PAPR_PMEM_BAD_RESTORE_MASK (PAPR_PMEM_EMPTY) 31 - 32 - /* Bit status indicators for smart event notification */ 33 - #define PAPR_PMEM_SMART_EVENT_MASK (PAPR_PMEM_HEALTH_CRITICAL | \ 34 - PAPR_PMEM_HEALTH_FATAL | \ 35 - PAPR_PMEM_HEALTH_UNHEALTHY) 36 - 37 - #define PAPR_PMEM_SAVE_MASK (PAPR_PMEM_SAVE_FAILED) 38 - 39 8 struct ndtest_config; 40 9 41 10 struct ndtest_priv {