Skip to content

Commit 6342649

Browse files
committed
Merge tag 'block-6.11-20240726' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: - NVMe pull request via Keith: - Fix request without payloads cleanup (Leon) - Use new protection information format (Francis) - Improved debug message for lost pci link (Bart) - Another apst quirk (Wang) - Use appropriate sysfs api for printing chars (Markus) - ublk async device deletion fix (Ming) - drbd kerneldoc fixups (Simon) - Fix deadlock between sd removal and release (Yang) * tag 'block-6.11-20240726' of git://git.kernel.dk/linux: nvme-pci: add missing condition check for existence of mapped data ublk: fix UBLK_CMD_DEL_DEV_ASYNC handling block: fix deadlock between sd_remove & sd_release drbd: Add peer_device to Kernel doc nvme-core: choose PIF from QPIF if QPIFS supports and PIF is QTYPE nvme-pci: Fix the instructions for disabling power management nvme: remove redundant bdev local variable nvme-fabrics: Use seq_putc() in __nvmf_concat_opt_tokens() nvme/pci: Add APST quirk for Lenovo N60z laptop
2 parents 8c93074 + f6bb525 commit 6342649

File tree

8 files changed

+39
-10
lines changed

8 files changed

+39
-10
lines changed

block/genhd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,12 @@ void del_gendisk(struct gendisk *disk)
663663
*/
664664
if (!test_bit(GD_DEAD, &disk->state))
665665
blk_report_disk_dead(disk, false);
666-
__blk_mark_disk_dead(disk);
667666

668667
/*
669668
* Drop all partitions now that the disk is marked dead.
670669
*/
671670
mutex_lock(&disk->open_mutex);
671+
__blk_mark_disk_dead(disk);
672672
xa_for_each_start(&disk->part_tbl, idx, part, 1)
673673
drop_partition(part);
674674
mutex_unlock(&disk->open_mutex);

drivers/block/drbd/drbd_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,6 +3422,7 @@ void drbd_uuid_set_bm(struct drbd_device *device, u64 val) __must_hold(local)
34223422
/**
34233423
* drbd_bmio_set_n_write() - io_fn for drbd_queue_bitmap_io() or drbd_bitmap_io()
34243424
* @device: DRBD device.
3425+
* @peer_device: Peer DRBD device.
34253426
*
34263427
* Sets all bits in the bitmap and writes the whole bitmap to stable storage.
34273428
*/
@@ -3448,6 +3449,7 @@ int drbd_bmio_set_n_write(struct drbd_device *device,
34483449
/**
34493450
* drbd_bmio_clear_n_write() - io_fn for drbd_queue_bitmap_io() or drbd_bitmap_io()
34503451
* @device: DRBD device.
3452+
* @peer_device: Peer DRBD device.
34513453
*
34523454
* Clears all bits in the bitmap and writes the whole bitmap to stable storage.
34533455
*/
@@ -3501,6 +3503,7 @@ static int w_bitmap_io(struct drbd_work *w, int unused)
35013503
* @done: callback to be called after the bitmap IO was performed
35023504
* @why: Descriptive text of the reason for doing the IO
35033505
* @flags: Bitmap flags
3506+
* @peer_device: Peer DRBD device.
35043507
*
35053508
* While IO on the bitmap happens we freeze application IO thus we ensure
35063509
* that drbd_set_out_of_sync() can not be called. This function MAY ONLY be
@@ -3549,6 +3552,7 @@ void drbd_queue_bitmap_io(struct drbd_device *device,
35493552
* @io_fn: IO callback to be called when bitmap IO is possible
35503553
* @why: Descriptive text of the reason for doing the IO
35513554
* @flags: Bitmap flags
3555+
* @peer_device: Peer DRBD device.
35523556
*
35533557
* freezes application IO while that the actual IO operations runs. This
35543558
* functions MAY NOT be called from worker context.

drivers/block/ublk_drv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848

4949
#define UBLK_MINORS (1U << MINORBITS)
5050

51+
/* private ioctl command mirror */
52+
#define UBLK_CMD_DEL_DEV_ASYNC _IOC_NR(UBLK_U_CMD_DEL_DEV_ASYNC)
53+
5154
/* All UBLK_F_* have to be included into UBLK_F_ALL */
5255
#define UBLK_F_ALL (UBLK_F_SUPPORT_ZERO_COPY \
5356
| UBLK_F_URING_CMD_COMP_IN_TASK \
@@ -2903,7 +2906,7 @@ static int ublk_ctrl_uring_cmd(struct io_uring_cmd *cmd,
29032906
case UBLK_CMD_DEL_DEV:
29042907
ret = ublk_ctrl_del_dev(&ub, true);
29052908
break;
2906-
case UBLK_U_CMD_DEL_DEV_ASYNC:
2909+
case UBLK_CMD_DEL_DEV_ASYNC:
29072910
ret = ublk_ctrl_del_dev(&ub, false);
29082911
break;
29092912
case UBLK_CMD_GET_QUEUE_AFFINITY:

drivers/nvme/host/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,12 +1876,18 @@ static void nvme_configure_pi_elbas(struct nvme_ns_head *head,
18761876
struct nvme_id_ns *id, struct nvme_id_ns_nvm *nvm)
18771877
{
18781878
u32 elbaf = le32_to_cpu(nvm->elbaf[nvme_lbaf_index(id->flbas)]);
1879+
u8 guard_type;
18791880

18801881
/* no support for storage tag formats right now */
18811882
if (nvme_elbaf_sts(elbaf))
18821883
return;
18831884

1884-
head->guard_type = nvme_elbaf_guard_type(elbaf);
1885+
guard_type = nvme_elbaf_guard_type(elbaf);
1886+
if ((nvm->pic & NVME_ID_NS_NVM_QPIFS) &&
1887+
guard_type == NVME_NVM_NS_QTYPE_GUARD)
1888+
guard_type = nvme_elbaf_qualified_guard_type(elbaf);
1889+
1890+
head->guard_type = guard_type;
18851891
switch (head->guard_type) {
18861892
case NVME_NVM_NS_64B_GUARD:
18871893
head->pi_size = sizeof(struct crc64_pi_tuple);

drivers/nvme/host/fabrics.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,10 +1403,10 @@ static void __nvmf_concat_opt_tokens(struct seq_file *seq_file)
14031403
tok = &opt_tokens[idx];
14041404
if (tok->token == NVMF_OPT_ERR)
14051405
continue;
1406-
seq_puts(seq_file, ",");
1406+
seq_putc(seq_file, ',');
14071407
seq_puts(seq_file, tok->pattern);
14081408
}
1409-
seq_puts(seq_file, "\n");
1409+
seq_putc(seq_file, '\n');
14101410
}
14111411

14121412
static int nvmf_dev_show(struct seq_file *seq_file, void *private)

drivers/nvme/host/pci.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,8 @@ static blk_status_t nvme_prep_rq(struct nvme_dev *dev, struct request *req)
863863
nvme_start_request(req);
864864
return BLK_STS_OK;
865865
out_unmap_data:
866-
nvme_unmap_data(dev, req);
866+
if (blk_rq_nr_phys_segments(req))
867+
nvme_unmap_data(dev, req);
867868
out_free_cmd:
868869
nvme_cleanup_cmd(req);
869870
return ret;
@@ -1309,7 +1310,7 @@ static void nvme_warn_reset(struct nvme_dev *dev, u32 csts)
13091310
dev_warn(dev->ctrl.device,
13101311
"Does your device have a faulty power saving mode enabled?\n");
13111312
dev_warn(dev->ctrl.device,
1312-
"Try \"nvme_core.default_ps_max_latency_us=0 pcie_aspm=off\" and report a bug\n");
1313+
"Try \"nvme_core.default_ps_max_latency_us=0 pcie_aspm=off pcie_port_pm=off\" and report a bug\n");
13131314
}
13141315

13151316
static enum blk_eh_timer_return nvme_timeout(struct request *req)
@@ -2968,6 +2969,13 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
29682969
return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND;
29692970
}
29702971

2972+
/*
2973+
* NVMe SSD drops off the PCIe bus after system idle
2974+
* for 10 hours on a Lenovo N60z board.
2975+
*/
2976+
if (dmi_match(DMI_BOARD_NAME, "LXKT-ZXEG-N6"))
2977+
return NVME_QUIRK_NO_APST;
2978+
29712979
return 0;
29722980
}
29732981

drivers/nvme/host/sysfs.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,12 @@ static ssize_t nuse_show(struct device *dev, struct device_attribute *attr,
233233
{
234234
struct nvme_ns_head *head = dev_to_ns_head(dev);
235235
struct gendisk *disk = dev_to_disk(dev);
236-
struct block_device *bdev = disk->part0;
237236
int ret;
238237

239-
if (nvme_disk_is_ns_head(bdev->bd_disk))
238+
if (nvme_disk_is_ns_head(disk))
240239
ret = ns_head_update_nuse(head);
241240
else
242-
ret = ns_update_nuse(bdev->bd_disk->private_data);
241+
ret = ns_update_nuse(disk->private_data);
243242
if (ret)
244243
return ret;
245244

include/linux/nvme.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,9 @@ enum {
485485
NVME_ID_NS_NVM_STS_MASK = 0x7f,
486486
NVME_ID_NS_NVM_GUARD_SHIFT = 7,
487487
NVME_ID_NS_NVM_GUARD_MASK = 0x3,
488+
NVME_ID_NS_NVM_QPIF_SHIFT = 9,
489+
NVME_ID_NS_NVM_QPIF_MASK = 0xf,
490+
NVME_ID_NS_NVM_QPIFS = 1 << 3,
488491
};
489492

490493
static inline __u8 nvme_elbaf_sts(__u32 elbaf)
@@ -497,6 +500,11 @@ static inline __u8 nvme_elbaf_guard_type(__u32 elbaf)
497500
return (elbaf >> NVME_ID_NS_NVM_GUARD_SHIFT) & NVME_ID_NS_NVM_GUARD_MASK;
498501
}
499502

503+
static inline __u8 nvme_elbaf_qualified_guard_type(__u32 elbaf)
504+
{
505+
return (elbaf >> NVME_ID_NS_NVM_QPIF_SHIFT) & NVME_ID_NS_NVM_QPIF_MASK;
506+
}
507+
500508
struct nvme_id_ctrl_nvm {
501509
__u8 vsl;
502510
__u8 wzsl;
@@ -576,6 +584,7 @@ enum {
576584
NVME_NVM_NS_16B_GUARD = 0,
577585
NVME_NVM_NS_32B_GUARD = 1,
578586
NVME_NVM_NS_64B_GUARD = 2,
587+
NVME_NVM_NS_QTYPE_GUARD = 3,
579588
};
580589

581590
static inline __u8 nvme_lbaf_index(__u8 flbas)

0 commit comments

Comments
 (0)