From 3afb00d3f86d3d924f88b56fa8285d4e9db85852 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Aug 2024 15:17:52 +0200 Subject: Merging upstream version 6.10.3. Signed-off-by: Daniel Baumann --- drivers/nvdimm/btt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/nvdimm/btt.c') diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index 4d0c527e85..1e5aedaf8c 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -1499,6 +1500,7 @@ static int btt_blk_init(struct btt *btt) struct queue_limits lim = { .logical_block_size = btt->sector_size, .max_hw_sectors = UINT_MAX, + .max_integrity_segments = 1, }; int rc; @@ -1514,10 +1516,12 @@ static int btt_blk_init(struct btt *btt) blk_queue_flag_set(QUEUE_FLAG_NONROT, btt->btt_disk->queue); blk_queue_flag_set(QUEUE_FLAG_SYNCHRONOUS, btt->btt_disk->queue); - if (btt_meta_size(btt)) { - rc = nd_integrity_init(btt->btt_disk, btt_meta_size(btt)); - if (rc) - goto out_cleanup_disk; + if (btt_meta_size(btt) && IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY)) { + struct blk_integrity bi = { + .tuple_size = btt_meta_size(btt), + .tag_size = btt_meta_size(btt), + }; + blk_integrity_register(btt->btt_disk, &bi); } set_capacity(btt->btt_disk, btt->nlba * btt->sector_size >> 9); -- cgit v1.2.3