diff options
Diffstat (limited to 'drivers/nvme/host/tcp.c')
| -rw-r--r-- | drivers/nvme/host/tcp.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index de174912445e..5f0a00425242 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c | |||
| @@ -1565,8 +1565,7 @@ static void nvme_tcp_destroy_io_queues(struct nvme_ctrl *ctrl, bool remove) | |||
| 1565 | { | 1565 | { |
| 1566 | nvme_tcp_stop_io_queues(ctrl); | 1566 | nvme_tcp_stop_io_queues(ctrl); |
| 1567 | if (remove) { | 1567 | if (remove) { |
| 1568 | if (ctrl->ops->flags & NVME_F_FABRICS) | 1568 | blk_cleanup_queue(ctrl->connect_q); |
| 1569 | blk_cleanup_queue(ctrl->connect_q); | ||
| 1570 | blk_mq_free_tag_set(ctrl->tagset); | 1569 | blk_mq_free_tag_set(ctrl->tagset); |
| 1571 | } | 1570 | } |
| 1572 | nvme_tcp_free_io_queues(ctrl); | 1571 | nvme_tcp_free_io_queues(ctrl); |
| @@ -1587,12 +1586,10 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new) | |||
| 1587 | goto out_free_io_queues; | 1586 | goto out_free_io_queues; |
| 1588 | } | 1587 | } |
| 1589 | 1588 | ||
| 1590 | if (ctrl->ops->flags & NVME_F_FABRICS) { | 1589 | ctrl->connect_q = blk_mq_init_queue(ctrl->tagset); |
| 1591 | ctrl->connect_q = blk_mq_init_queue(ctrl->tagset); | 1590 | if (IS_ERR(ctrl->connect_q)) { |
| 1592 | if (IS_ERR(ctrl->connect_q)) { | 1591 | ret = PTR_ERR(ctrl->connect_q); |
| 1593 | ret = PTR_ERR(ctrl->connect_q); | 1592 | goto out_free_tag_set; |
| 1594 | goto out_free_tag_set; | ||
| 1595 | } | ||
| 1596 | } | 1593 | } |
| 1597 | } else { | 1594 | } else { |
| 1598 | blk_mq_update_nr_hw_queues(ctrl->tagset, | 1595 | blk_mq_update_nr_hw_queues(ctrl->tagset, |
| @@ -1606,7 +1603,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new) | |||
| 1606 | return 0; | 1603 | return 0; |
| 1607 | 1604 | ||
| 1608 | out_cleanup_connect_q: | 1605 | out_cleanup_connect_q: |
| 1609 | if (new && (ctrl->ops->flags & NVME_F_FABRICS)) | 1606 | if (new) |
| 1610 | blk_cleanup_queue(ctrl->connect_q); | 1607 | blk_cleanup_queue(ctrl->connect_q); |
| 1611 | out_free_tag_set: | 1608 | out_free_tag_set: |
| 1612 | if (new) | 1609 | if (new) |
| @@ -1620,7 +1617,6 @@ static void nvme_tcp_destroy_admin_queue(struct nvme_ctrl *ctrl, bool remove) | |||
| 1620 | { | 1617 | { |
| 1621 | nvme_tcp_stop_queue(ctrl, 0); | 1618 | nvme_tcp_stop_queue(ctrl, 0); |
| 1622 | if (remove) { | 1619 | if (remove) { |
| 1623 | free_opal_dev(ctrl->opal_dev); | ||
| 1624 | blk_cleanup_queue(ctrl->admin_q); | 1620 | blk_cleanup_queue(ctrl->admin_q); |
| 1625 | blk_mq_free_tag_set(ctrl->admin_tagset); | 1621 | blk_mq_free_tag_set(ctrl->admin_tagset); |
| 1626 | } | 1622 | } |
| @@ -1952,20 +1948,23 @@ nvme_tcp_timeout(struct request *rq, bool reserved) | |||
| 1952 | struct nvme_tcp_ctrl *ctrl = req->queue->ctrl; | 1948 | struct nvme_tcp_ctrl *ctrl = req->queue->ctrl; |
| 1953 | struct nvme_tcp_cmd_pdu *pdu = req->pdu; | 1949 | struct nvme_tcp_cmd_pdu *pdu = req->pdu; |
| 1954 | 1950 | ||
| 1955 | dev_dbg(ctrl->ctrl.device, | 1951 | dev_warn(ctrl->ctrl.device, |
| 1956 | "queue %d: timeout request %#x type %d\n", | 1952 | "queue %d: timeout request %#x type %d\n", |
| 1957 | nvme_tcp_queue_id(req->queue), rq->tag, | 1953 | nvme_tcp_queue_id(req->queue), rq->tag, pdu->hdr.type); |
| 1958 | pdu->hdr.type); | ||
| 1959 | 1954 | ||
| 1960 | if (ctrl->ctrl.state != NVME_CTRL_LIVE) { | 1955 | if (ctrl->ctrl.state != NVME_CTRL_LIVE) { |
| 1961 | union nvme_result res = {}; | 1956 | /* |
| 1962 | 1957 | * Teardown immediately if controller times out while starting | |
| 1963 | nvme_req(rq)->flags |= NVME_REQ_CANCELLED; | 1958 | * or we are already started error recovery. all outstanding |
| 1964 | nvme_end_request(rq, cpu_to_le16(NVME_SC_ABORT_REQ), res); | 1959 | * requests are completed on shutdown, so we return BLK_EH_DONE. |
| 1960 | */ | ||
| 1961 | flush_work(&ctrl->err_work); | ||
| 1962 | nvme_tcp_teardown_io_queues(&ctrl->ctrl, false); | ||
| 1963 | nvme_tcp_teardown_admin_queue(&ctrl->ctrl, false); | ||
| 1965 | return BLK_EH_DONE; | 1964 | return BLK_EH_DONE; |
| 1966 | } | 1965 | } |
| 1967 | 1966 | ||
| 1968 | /* queue error recovery */ | 1967 | dev_warn(ctrl->ctrl.device, "starting error recovery\n"); |
| 1969 | nvme_tcp_error_recovery(&ctrl->ctrl); | 1968 | nvme_tcp_error_recovery(&ctrl->ctrl); |
| 1970 | 1969 | ||
| 1971 | return BLK_EH_RESET_TIMER; | 1970 | return BLK_EH_RESET_TIMER; |
