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
Unified · Split
| @@ -1127,8 +1127,8 @@ static void vdc_queue_drain(struct vdc_port *port) · 1126 unmodified lines | ||
| 1127 | 1127 | |
| 1128 | 1128 | spin_lock_irq(&port->vio.lock); |
| 1129 | 1129 | 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); | |
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | static void vdc_ldc_reset_timer_work(struct work_struct *work) |
| @@ -76,10 +76,8 @@ static int linear_set_limits(struct mddev *mddev) · 75 unmodified lines | ||
| 76 | 76 | lim.max_write_zeroes_sectors = mddev->chunk_sectors; |
| 77 | 77 | lim.io_min = mddev->chunk_sectors << 9; |
| 78 | 78 | err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY); |
| 79 | − if (err) { | |
| 80 | − queue_limits_cancel_update(mddev->gendisk->queue); | |
| 79 | + if (err) | |
| 81 | 80 | return err; |
| 82 | − } | |
| 83 | 81 | |
| 84 | 82 | return queue_limits_set(mddev->gendisk->queue, &lim); |
| 85 | 83 | } |
| @@ -1700,7 +1700,13 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count) · 1699 unmodified lines | ||
| 1700 | 1700 | |
| 1701 | 1701 | status = nvme_set_features(ctrl, NVME_FEAT_NUM_QUEUES, q_count, NULL, 0, |
| 1702 | 1702 | &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) | |
| 1704 | 1710 | return status; |
| 1705 | 1711 | |
| 1706 | 1712 | /* |
| @@ -781,11 +781,19 @@ restart: · 780 unmodified lines | ||
| 781 | 781 | static void |
| 782 | 782 | nvme_fc_ctrl_connectivity_loss(struct nvme_fc_ctrl *ctrl) |
| 783 | 783 | { |
| 784 | + enum nvme_ctrl_state state; | |
| 785 | + unsigned long flags; | |
| 786 | + | |
| 784 | 787 | dev_info(ctrl->ctrl.device, |
| 785 | 788 | "NVME-FC{%d}: controller connectivity lost. Awaiting " |
| 786 | 789 | "Reconnect", ctrl->cnum); |
| 787 | 790 | |
| 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) { | |
| 789 | 797 | case NVME_CTRL_NEW: |
| 790 | 798 | case NVME_CTRL_LIVE: |
| 791 | 799 | /* |
| @@ -2079,7 +2087,8 @@ done: · 1287 unmodified lines | ||
| 2079 | 2087 | nvme_fc_complete_rq(rq); |
| 2080 | 2088 | |
| 2081 | 2089 | 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) | |
| 2083 | 2092 | queue_work(nvme_reset_wq, &ctrl->ioerr_work); |
| 2084 | 2093 | } |
| 2085 | 2094 | |
| @@ -2533,6 +2542,8 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues) · 447 unmodified lines | ||
| 2533 | 2542 | static void |
| 2534 | 2543 | nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg) |
| 2535 | 2544 | { |
| 2545 | + enum nvme_ctrl_state state = nvme_ctrl_state(&ctrl->ctrl); | |
| 2546 | + | |
| 2536 | 2547 | /* |
| 2537 | 2548 | * if an error (io timeout, etc) while (re)connecting, the remote |
| 2538 | 2549 | * port requested terminating of the association (disconnect_ls) |
| @@ -2540,9 +2551,8 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg) · 1 unmodified line | ||
| 2540 | 2551 | * the controller. Abort any ios on the association and let the |
| 2541 | 2552 | * create_association error path resolve things. |
| 2542 | 2553 | */ |
| 2543 | − if (ctrl->ctrl.state == NVME_CTRL_CONNECTING) { | |
| 2554 | + if (state == NVME_CTRL_CONNECTING) { | |
| 2544 | 2555 | __nvme_fc_abort_outstanding_ios(ctrl, true); |
| 2545 | − set_bit(ASSOC_FAILED, &ctrl->flags); | |
| 2546 | 2556 | dev_warn(ctrl->ctrl.device, |
| 2547 | 2557 | "NVME-FC{%d}: transport error during (re)connect\n", |
| 2548 | 2558 | ctrl->cnum); |
| @@ -2550,7 +2560,7 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg) · 1 unmodified line | ||
| 2550 | 2560 | } |
| 2551 | 2561 | |
| 2552 | 2562 | /* 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) | |
| 2554 | 2564 | return; |
| 2555 | 2565 | |
| 2556 | 2566 | dev_warn(ctrl->ctrl.device, |
| @@ -3167,12 +3177,18 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) · 610 unmodified lines | ||
| 3167 | 3177 | else |
| 3168 | 3178 | ret = nvme_fc_recreate_io_queues(ctrl); |
| 3169 | 3179 | } |
| 3170 | − if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags)) | |
| 3171 | − ret = -EIO; | |
| 3172 | 3180 | if (ret) |
| 3173 | 3181 | goto out_term_aen_ops; |
| 3174 | 3182 | |
| 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; | |
| 3176 | 3192 | |
| 3177 | 3193 | ctrl->ctrl.nr_reconnects = 0; |
| 3178 | 3194 | |
| @@ -3578,8 +3594,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · 399 unmodified lines | ||
| 3578 | 3594 | list_add_tail(&ctrl->ctrl_list, &rport->ctrl_list); |
| 3579 | 3595 | spin_unlock_irqrestore(&rport->lock, flags); |
| 3580 | 3596 | |
| 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)) { | |
| 3583 | 3598 | dev_err(ctrl->ctrl.device, |
| 3584 | 3599 | "NVME-FC{%d}: failed to init ctrl state\n", ctrl->cnum); |
| 3585 | 3600 | goto fail_ctrl; |
| @@ -2153,14 +2153,6 @@ static int nvme_alloc_host_mem_multi(struct nvme_dev *dev, u64 preferred, · 2152 unmodified lines | ||
| 2153 | 2153 | return 0; |
| 2154 | 2154 | |
| 2155 | 2155 | 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 | − | |
| 2164 | 2156 | kfree(bufs); |
| 2165 | 2157 | out_free_descs: |
| 2166 | 2158 | 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) · 980 unmodified lines | ||
| 3147 | 3139 | * because of high power consumption (> 2 Watt) in s2idle |
| 3148 | 3140 | * sleep. Only some boards with Intel CPU are affected. |
| 3149 | 3141 | */ |
| 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") || | |
| 3151 | 3145 | dmi_match(DMI_BOARD_NAME, "PH4PG31") || |
| 3152 | 3146 | dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1") || |
| 3153 | 3147 | dmi_match(DMI_BOARD_NAME, "PH6PG01_PH6PG71")) |
| @@ -792,7 +792,7 @@ static umode_t nvme_tls_attrs_are_visible(struct kobject *kobj, · 791 unmodified lines | ||
| 792 | 792 | return a->mode; |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | −const struct attribute_group nvme_tls_attrs_group = { | |
| 795 | +static const struct attribute_group nvme_tls_attrs_group = { | |
| 796 | 796 | .attrs = nvme_tls_attrs, |
| 797 | 797 | .is_visible = nvme_tls_attrs_are_visible, |
| 798 | 798 | }; |
| @@ -1068,6 +1068,7 @@ static void nvme_execute_identify_ns_nvm(struct nvmet_req *req) · 1067 unmodified lines | ||
| 1068 | 1068 | goto out; |
| 1069 | 1069 | } |
| 1070 | 1070 | status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id)); |
| 1071 | + kfree(id); | |
| 1071 | 1072 | out: |
| 1072 | 1073 | nvmet_req_complete(req, status); |
| 1073 | 1074 | } |
| @@ -287,7 +287,7 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req) · 286 unmodified lines | ||
| 287 | 287 | args.subsysnqn = d->subsysnqn; |
| 288 | 288 | args.hostnqn = d->hostnqn; |
| 289 | 289 | args.hostid = &d->hostid; |
| 290 | − args.kato = c->kato; | |
| 290 | + args.kato = le32_to_cpu(c->kato); | |
| 291 | 291 | |
| 292 | 292 | ctrl = nvmet_alloc_ctrl(&args); |
| 293 | 293 | if (!ctrl) |
| @@ -272,7 +272,7 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req) · 271 unmodified lines | ||
| 272 | 272 | iter_flags = SG_MITER_FROM_SG; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | − if (req->cmd->rw.control & NVME_RW_LR) | |
| 275 | + if (req->cmd->rw.control & cpu_to_le16(NVME_RW_LR)) | |
| 276 | 276 | opf |= REQ_FAILFAST_DEV; |
| 277 | 277 | |
| 278 | 278 | if (is_pci_p2pdma_page(sg_page(req->sg))) |
| @@ -589,7 +589,7 @@ struct nvmet_alloc_ctrl_args { · 588 unmodified lines | ||
| 589 | 589 | const struct nvmet_fabrics_ops *ops; |
| 590 | 590 | struct device *p2p_client; |
| 591 | 591 | u32 kato; |
| 592 | − u32 result; | |
| 592 | + __le32 result; | |
| 593 | 593 | u16 error_loc; |
| 594 | 594 | u16 status; |
| 595 | 595 | }; |