Commit 580b2032 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'block-6.14-20250313' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

 - NVMe pull request via Keith:
     - Concurrent pci error and hotplug handling fix (Keith)
     - Endpoint function fixes (Damien)

 - Fix for a regression introduced in this cycle with error checking for
   batched request completions (Shin'ichiro)

* tag 'block-6.14-20250313' of git://git.kernel.dk/linux:
  block: change blk_mq_add_to_batch() third argument type to bool
  nvme: move error logging from nvme_end_req() to __nvme_end_req()
  nvmet: pci-epf: Do not add an IRQ vector if not needed
  nvmet: pci-epf: Set NVMET_PCI_EPF_Q_LIVE when a queue is fully created
  nvme-pci: fix stuck reset on concurrent DPC and HP
parents 83158b21 a9381351
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1549,7 +1549,7 @@ static int null_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob)
		cmd = blk_mq_rq_to_pdu(req);
		cmd->error = null_process_cmd(cmd, req_op(req), blk_rq_pos(req),
						blk_rq_sectors(req));
		if (!blk_mq_add_to_batch(req, iob, (__force int) cmd->error,
		if (!blk_mq_add_to_batch(req, iob, cmd->error != BLK_STS_OK,
					 blk_mq_end_request_batch))
			blk_mq_end_request(req, cmd->error);
		nr++;
+3 −2
Original line number Diff line number Diff line
@@ -1207,10 +1207,11 @@ static int virtblk_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob)

	while ((vbr = virtqueue_get_buf(vq->vq, &len)) != NULL) {
		struct request *req = blk_mq_rq_from_pdu(vbr);
		u8 status = virtblk_vbr_status(vbr);

		found++;
		if (!blk_mq_complete_request_remote(req) &&
		    !blk_mq_add_to_batch(req, iob, virtblk_vbr_status(vbr),
		    !blk_mq_add_to_batch(req, iob, status != VIRTIO_BLK_S_OK,
					 virtblk_complete_batch))
			virtblk_request_done(req);
	}
+2 −1
Original line number Diff line number Diff line
@@ -599,7 +599,8 @@ static inline void apple_nvme_handle_cqe(struct apple_nvme_queue *q,
	}

	if (!nvme_try_complete_req(req, cqe->status, cqe->result) &&
	    !blk_mq_add_to_batch(req, iob, nvme_req(req)->status,
	    !blk_mq_add_to_batch(req, iob,
				 nvme_req(req)->status != NVME_SC_SUCCESS,
				 apple_nvme_complete_batch))
		apple_nvme_complete_rq(req);
}
+6 −6
Original line number Diff line number Diff line
@@ -431,6 +431,12 @@ static inline void nvme_end_req_zoned(struct request *req)

static inline void __nvme_end_req(struct request *req)
{
	if (unlikely(nvme_req(req)->status && !(req->rq_flags & RQF_QUIET))) {
		if (blk_rq_is_passthrough(req))
			nvme_log_err_passthru(req);
		else
			nvme_log_error(req);
	}
	nvme_end_req_zoned(req);
	nvme_trace_bio_complete(req);
	if (req->cmd_flags & REQ_NVME_MPATH)
@@ -441,12 +447,6 @@ void nvme_end_req(struct request *req)
{
	blk_status_t status = nvme_error_status(nvme_req(req)->status);

	if (unlikely(nvme_req(req)->status && !(req->rq_flags & RQF_QUIET))) {
		if (blk_rq_is_passthrough(req))
			nvme_log_err_passthru(req);
		else
			nvme_log_error(req);
	}
	__nvme_end_req(req);
	blk_mq_end_request(req, status);
}
+15 −3
Original line number Diff line number Diff line
@@ -1130,7 +1130,8 @@ static inline void nvme_handle_cqe(struct nvme_queue *nvmeq,

	trace_nvme_sq(req, cqe->sq_head, nvmeq->sq_tail);
	if (!nvme_try_complete_req(req, cqe->status, cqe->result) &&
	    !blk_mq_add_to_batch(req, iob, nvme_req(req)->status,
	    !blk_mq_add_to_batch(req, iob,
				 nvme_req(req)->status != NVME_SC_SUCCESS,
				 nvme_pci_complete_batch))
		nvme_pci_complete_rq(req);
}
@@ -1411,9 +1412,20 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req)
	struct nvme_dev *dev = nvmeq->dev;
	struct request *abort_req;
	struct nvme_command cmd = { };
	struct pci_dev *pdev = to_pci_dev(dev->dev);
	u32 csts = readl(dev->bar + NVME_REG_CSTS);
	u8 opcode;

	/*
	 * Shutdown the device immediately if we see it is disconnected. This
	 * unblocks PCIe error handling if the nvme driver is waiting in
	 * error_resume for a device that has been removed. We can't unbind the
	 * driver while the driver's error callback is waiting to complete, so
	 * we're relying on a timeout to break that deadlock if a removal
	 * occurs while reset work is running.
	 */
	if (pci_dev_is_disconnected(pdev))
		nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DELETING);
	if (nvme_state_terminal(&dev->ctrl))
		goto disable;

@@ -1421,7 +1433,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req)
	 * the recovery mechanism will surely fail.
	 */
	mb();
	if (pci_channel_offline(to_pci_dev(dev->dev)))
	if (pci_channel_offline(pdev))
		return BLK_EH_RESET_TIMER;

	/*
Loading