Skip to content

Commit a67d0a0

Browse files
committed
Merge tag 'block-6.14-20250207' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: - MD pull request via Song: - fix an error handling path for md-linear - NVMe pull request via Keith: - Connection fixes for fibre channel transport (Daniel) - Endian fixes (Keith, Christoph) - Cleanup fix for host memory buffer (Francis) - Platform specific power quirks (Georg) - Target memory leak (Sagi) - Use appropriate controller state accessor (Daniel) - Fixup for a regression introduced last week, where sunvdc wasn't updated for an API change, causing compilation failures on sparc64. * tag 'block-6.14-20250207' of git://git.kernel.dk/linux: drivers/block/sunvdc.c: update the correct AIP call md: Fix linear_set_limits() nvme-fc: use ctrl state getter nvme: make nvme_tls_attrs_group static nvmet: add a missing endianess conversion in nvmet_execute_admin_connect nvmet: the result field in nvmet_alloc_ctrl_args is little endian nvmet: fix a memory leak in controller identify nvme-fc: do not ignore connectivity loss during connecting nvme: handle connectivity loss in nvme_set_queue_count nvme-fc: go straight to connecting state when initializing nvme-pci: Add TUXEDO IBP Gen9 to Samsung sleep quirk nvme-pci: Add TUXEDO InfinityFlex to Samsung sleep quirk nvme-pci: remove redundant dma frees in hmb nvmet: fix rw control endian access
2 parents 1fa9970 + 96b531f commit a67d0a0

File tree

10 files changed

+43
-29
lines changed

10 files changed

+43
-29
lines changed

drivers/block/sunvdc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,8 +1127,8 @@ static void vdc_queue_drain(struct vdc_port *port)
11271127

11281128
spin_lock_irq(&port->vio.lock);
11291129
port->drain = 0;
1130-
blk_mq_unquiesce_queue(q, memflags);
1131-
blk_mq_unfreeze_queue(q);
1130+
blk_mq_unquiesce_queue(q);
1131+
blk_mq_unfreeze_queue(q, memflags);
11321132
}
11331133

11341134
static void vdc_ldc_reset_timer_work(struct work_struct *work)

drivers/md/md-linear.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ static int linear_set_limits(struct mddev *mddev)
7676
lim.max_write_zeroes_sectors = mddev->chunk_sectors;
7777
lim.io_min = mddev->chunk_sectors << 9;
7878
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
79-
if (err) {
80-
queue_limits_cancel_update(mddev->gendisk->queue);
79+
if (err)
8180
return err;
82-
}
8381

8482
return queue_limits_set(mddev->gendisk->queue, &lim);
8583
}

drivers/nvme/host/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,13 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
17001700

17011701
status = nvme_set_features(ctrl, NVME_FEAT_NUM_QUEUES, q_count, NULL, 0,
17021702
&result);
1703-
if (status < 0)
1703+
1704+
/*
1705+
* It's either a kernel error or the host observed a connection
1706+
* lost. In either case it's not possible communicate with the
1707+
* controller and thus enter the error code path.
1708+
*/
1709+
if (status < 0 || status == NVME_SC_HOST_PATH_ERROR)
17041710
return status;
17051711

17061712
/*

drivers/nvme/host/fc.c

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,19 @@ nvme_fc_abort_lsops(struct nvme_fc_rport *rport)
781781
static void
782782
nvme_fc_ctrl_connectivity_loss(struct nvme_fc_ctrl *ctrl)
783783
{
784+
enum nvme_ctrl_state state;
785+
unsigned long flags;
786+
784787
dev_info(ctrl->ctrl.device,
785788
"NVME-FC{%d}: controller connectivity lost. Awaiting "
786789
"Reconnect", ctrl->cnum);
787790

788-
switch (nvme_ctrl_state(&ctrl->ctrl)) {
791+
spin_lock_irqsave(&ctrl->lock, flags);
792+
set_bit(ASSOC_FAILED, &ctrl->flags);
793+
state = nvme_ctrl_state(&ctrl->ctrl);
794+
spin_unlock_irqrestore(&ctrl->lock, flags);
795+
796+
switch (state) {
789797
case NVME_CTRL_NEW:
790798
case NVME_CTRL_LIVE:
791799
/*
@@ -2079,7 +2087,8 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
20792087
nvme_fc_complete_rq(rq);
20802088

20812089
check_error:
2082-
if (terminate_assoc && ctrl->ctrl.state != NVME_CTRL_RESETTING)
2090+
if (terminate_assoc &&
2091+
nvme_ctrl_state(&ctrl->ctrl) != NVME_CTRL_RESETTING)
20832092
queue_work(nvme_reset_wq, &ctrl->ioerr_work);
20842093
}
20852094

@@ -2533,24 +2542,25 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)
25332542
static void
25342543
nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg)
25352544
{
2545+
enum nvme_ctrl_state state = nvme_ctrl_state(&ctrl->ctrl);
2546+
25362547
/*
25372548
* if an error (io timeout, etc) while (re)connecting, the remote
25382549
* port requested terminating of the association (disconnect_ls)
25392550
* or an error (timeout or abort) occurred on an io while creating
25402551
* the controller. Abort any ios on the association and let the
25412552
* create_association error path resolve things.
25422553
*/
2543-
if (ctrl->ctrl.state == NVME_CTRL_CONNECTING) {
2554+
if (state == NVME_CTRL_CONNECTING) {
25442555
__nvme_fc_abort_outstanding_ios(ctrl, true);
2545-
set_bit(ASSOC_FAILED, &ctrl->flags);
25462556
dev_warn(ctrl->ctrl.device,
25472557
"NVME-FC{%d}: transport error during (re)connect\n",
25482558
ctrl->cnum);
25492559
return;
25502560
}
25512561

25522562
/* Otherwise, only proceed if in LIVE state - e.g. on first error */
2553-
if (ctrl->ctrl.state != NVME_CTRL_LIVE)
2563+
if (state != NVME_CTRL_LIVE)
25542564
return;
25552565

25562566
dev_warn(ctrl->ctrl.device,
@@ -3167,12 +3177,18 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
31673177
else
31683178
ret = nvme_fc_recreate_io_queues(ctrl);
31693179
}
3170-
if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags))
3171-
ret = -EIO;
31723180
if (ret)
31733181
goto out_term_aen_ops;
31743182

3175-
changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
3183+
spin_lock_irqsave(&ctrl->lock, flags);
3184+
if (!test_bit(ASSOC_FAILED, &ctrl->flags))
3185+
changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
3186+
else
3187+
ret = -EIO;
3188+
spin_unlock_irqrestore(&ctrl->lock, flags);
3189+
3190+
if (ret)
3191+
goto out_term_aen_ops;
31763192

31773193
ctrl->ctrl.nr_reconnects = 0;
31783194

@@ -3578,8 +3594,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
35783594
list_add_tail(&ctrl->ctrl_list, &rport->ctrl_list);
35793595
spin_unlock_irqrestore(&rport->lock, flags);
35803596

3581-
if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RESETTING) ||
3582-
!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
3597+
if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
35833598
dev_err(ctrl->ctrl.device,
35843599
"NVME-FC{%d}: failed to init ctrl state\n", ctrl->cnum);
35853600
goto fail_ctrl;

drivers/nvme/host/pci.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,14 +2153,6 @@ static int nvme_alloc_host_mem_multi(struct nvme_dev *dev, u64 preferred,
21532153
return 0;
21542154

21552155
out_free_bufs:
2156-
while (--i >= 0) {
2157-
size_t size = le32_to_cpu(descs[i].size) * NVME_CTRL_PAGE_SIZE;
2158-
2159-
dma_free_attrs(dev->dev, size, bufs[i],
2160-
le64_to_cpu(descs[i].addr),
2161-
DMA_ATTR_NO_KERNEL_MAPPING | DMA_ATTR_NO_WARN);
2162-
}
2163-
21642156
kfree(bufs);
21652157
out_free_descs:
21662158
dma_free_coherent(dev->dev, descs_size, descs, descs_dma);
@@ -3147,7 +3139,9 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
31473139
* because of high power consumption (> 2 Watt) in s2idle
31483140
* sleep. Only some boards with Intel CPU are affected.
31493141
*/
3150-
if (dmi_match(DMI_BOARD_NAME, "GMxPXxx") ||
3142+
if (dmi_match(DMI_BOARD_NAME, "DN50Z-140HC-YD") ||
3143+
dmi_match(DMI_BOARD_NAME, "GMxPXxx") ||
3144+
dmi_match(DMI_BOARD_NAME, "GXxMRXx") ||
31513145
dmi_match(DMI_BOARD_NAME, "PH4PG31") ||
31523146
dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1") ||
31533147
dmi_match(DMI_BOARD_NAME, "PH6PG01_PH6PG71"))

drivers/nvme/host/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ static umode_t nvme_tls_attrs_are_visible(struct kobject *kobj,
792792
return a->mode;
793793
}
794794

795-
const struct attribute_group nvme_tls_attrs_group = {
795+
static const struct attribute_group nvme_tls_attrs_group = {
796796
.attrs = nvme_tls_attrs,
797797
.is_visible = nvme_tls_attrs_are_visible,
798798
};

drivers/nvme/target/admin-cmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ static void nvme_execute_identify_ns_nvm(struct nvmet_req *req)
10681068
goto out;
10691069
}
10701070
status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id));
1071+
kfree(id);
10711072
out:
10721073
nvmet_req_complete(req, status);
10731074
}

drivers/nvme/target/fabrics-cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req)
287287
args.subsysnqn = d->subsysnqn;
288288
args.hostnqn = d->hostnqn;
289289
args.hostid = &d->hostid;
290-
args.kato = c->kato;
290+
args.kato = le32_to_cpu(c->kato);
291291

292292
ctrl = nvmet_alloc_ctrl(&args);
293293
if (!ctrl)

drivers/nvme/target/io-cmd-bdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req)
272272
iter_flags = SG_MITER_FROM_SG;
273273
}
274274

275-
if (req->cmd->rw.control & NVME_RW_LR)
275+
if (req->cmd->rw.control & cpu_to_le16(NVME_RW_LR))
276276
opf |= REQ_FAILFAST_DEV;
277277

278278
if (is_pci_p2pdma_page(sg_page(req->sg)))

drivers/nvme/target/nvmet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ struct nvmet_alloc_ctrl_args {
589589
const struct nvmet_fabrics_ops *ops;
590590
struct device *p2p_client;
591591
u32 kato;
592-
u32 result;
592+
__le32 result;
593593
u16 error_loc;
594594
u16 status;
595595
};

0 commit comments

Comments
 (0)