hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/scsi/qedf/qedf_io.c
....@@ -1924,6 +1924,7 @@
19241924 goto drop_rdata_kref;
19251925 }
19261926
1927
+ spin_lock_irqsave(&fcport->rport_lock, flags);
19271928 if (!test_bit(QEDF_CMD_OUTSTANDING, &io_req->flags) ||
19281929 test_bit(QEDF_CMD_IN_CLEANUP, &io_req->flags) ||
19291930 test_bit(QEDF_CMD_IN_ABORT, &io_req->flags)) {
....@@ -1931,8 +1932,13 @@
19311932 "io_req xid=0x%x sc_cmd=%p already in cleanup or abort processing or already completed.\n",
19321933 io_req->xid, io_req->sc_cmd);
19331934 rc = 1;
1935
+ spin_unlock_irqrestore(&fcport->rport_lock, flags);
19341936 goto drop_rdata_kref;
19351937 }
1938
+
1939
+ /* Set the command type to abort */
1940
+ io_req->cmd_type = QEDF_ABTS;
1941
+ spin_unlock_irqrestore(&fcport->rport_lock, flags);
19361942
19371943 kref_get(&io_req->refcount);
19381944
....@@ -1940,8 +1946,6 @@
19401946 qedf->control_requests++;
19411947 qedf->packet_aborts++;
19421948
1943
- /* Set the command type to abort */
1944
- io_req->cmd_type = QEDF_ABTS;
19451949 io_req->return_scsi_cmd_on_abts = return_scsi_cmd_on_abts;
19461950
19471951 set_bit(QEDF_CMD_IN_ABORT, &io_req->flags);
....@@ -2230,7 +2234,9 @@
22302234 refcount, fcport, fcport->rdata->ids.port_id);
22312235
22322236 /* Cleanup cmds re-use the same TID as the original I/O */
2237
+ spin_lock_irqsave(&fcport->rport_lock, flags);
22332238 io_req->cmd_type = QEDF_CLEANUP;
2239
+ spin_unlock_irqrestore(&fcport->rport_lock, flags);
22342240 io_req->return_scsi_cmd_on_abts = return_scsi_cmd_on_abts;
22352241
22362242 init_completion(&io_req->cleanup_done);