Commit 60a0d379 authored by Mike Christie's avatar Mike Christie Committed by Martin K. Petersen

scsi: qedi: Pass send_iscsi_tmf task to abort

qedi_abort_work knows what task to abort so just pass it to send_iscsi_tmf.

Link: https://lore.kernel.org/r/20210525181821.7617-27-michael.christie@oracle.comReviewed-by: default avatarManish Rangankar <mrangankar@marvell.com>
Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 0c72191d
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "qedi_fw_scsi.h" #include "qedi_fw_scsi.h"
static int send_iscsi_tmf(struct qedi_conn *qedi_conn, static int send_iscsi_tmf(struct qedi_conn *qedi_conn,
struct iscsi_task *mtask); struct iscsi_task *mtask, struct iscsi_task *ctask);
void qedi_iscsi_unmap_sg_list(struct qedi_cmd *cmd) void qedi_iscsi_unmap_sg_list(struct qedi_cmd *cmd)
{ {
...@@ -1428,7 +1428,7 @@ static void qedi_abort_work(struct work_struct *work) ...@@ -1428,7 +1428,7 @@ static void qedi_abort_work(struct work_struct *work)
} }
send_tmf: send_tmf:
send_iscsi_tmf(qedi_conn, qedi_cmd->task); send_iscsi_tmf(qedi_conn, qedi_cmd->task, ctask);
clear_cleanup: clear_cleanup:
clear_bit(QEDI_CONN_FW_CLEANUP, &qedi_conn->flags); clear_bit(QEDI_CONN_FW_CLEANUP, &qedi_conn->flags);
...@@ -1454,14 +1454,13 @@ static void qedi_abort_work(struct work_struct *work) ...@@ -1454,14 +1454,13 @@ static void qedi_abort_work(struct work_struct *work)
clear_bit(QEDI_CONN_FW_CLEANUP, &qedi_conn->flags); clear_bit(QEDI_CONN_FW_CLEANUP, &qedi_conn->flags);
} }
static int send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask) static int send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask,
struct iscsi_task *ctask)
{ {
struct iscsi_tmf_request_hdr tmf_pdu_header; struct iscsi_tmf_request_hdr tmf_pdu_header;
struct iscsi_task_params task_params; struct iscsi_task_params task_params;
struct qedi_ctx *qedi = qedi_conn->qedi; struct qedi_ctx *qedi = qedi_conn->qedi;
struct e4_iscsi_task_context *fw_task_ctx; struct e4_iscsi_task_context *fw_task_ctx;
struct iscsi_conn *conn = qedi_conn->cls_conn->dd_data;
struct iscsi_task *ctask;
struct iscsi_tm *tmf_hdr; struct iscsi_tm *tmf_hdr;
struct qedi_cmd *qedi_cmd; struct qedi_cmd *qedi_cmd;
struct qedi_cmd *cmd; struct qedi_cmd *cmd;
...@@ -1501,12 +1500,6 @@ static int send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask) ...@@ -1501,12 +1500,6 @@ static int send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask)
if ((tmf_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) == if ((tmf_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) ==
ISCSI_TM_FUNC_ABORT_TASK) { ISCSI_TM_FUNC_ABORT_TASK) {
ctask = iscsi_itt_to_task(conn, tmf_hdr->rtt);
if (!ctask || !ctask->sc) {
QEDI_ERR(&qedi->dbg_ctx,
"Could not get reference task\n");
return 0;
}
cmd = (struct qedi_cmd *)ctask->dd_data; cmd = (struct qedi_cmd *)ctask->dd_data;
tmf_pdu_header.rtt = tmf_pdu_header.rtt =
qedi_set_itt(cmd->task_id, qedi_set_itt(cmd->task_id,
...@@ -1559,7 +1552,7 @@ int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask) ...@@ -1559,7 +1552,7 @@ int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask)
case ISCSI_TM_FUNC_LOGICAL_UNIT_RESET: case ISCSI_TM_FUNC_LOGICAL_UNIT_RESET:
case ISCSI_TM_FUNC_TARGET_WARM_RESET: case ISCSI_TM_FUNC_TARGET_WARM_RESET:
case ISCSI_TM_FUNC_TARGET_COLD_RESET: case ISCSI_TM_FUNC_TARGET_COLD_RESET:
rc = send_iscsi_tmf(qedi_conn, mtask); rc = send_iscsi_tmf(qedi_conn, mtask, NULL);
break; break;
default: default:
QEDI_ERR(&qedi->dbg_ctx, "Invalid tmf, cid=0x%x\n", QEDI_ERR(&qedi->dbg_ctx, "Invalid tmf, cid=0x%x\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment