Skip to content

Commit

Permalink
scsi: qedf: Make qedf_execute_tmf() non-preemptible
Browse files Browse the repository at this point in the history
[ Upstream commit 0d8b637 ]

Stop calling smp_processor_id() from preemptible code in
qedf_execute_tmf90.  This results in BUG_ON() when running an RT kernel.

[ 659.343280] BUG: using smp_processor_id() in preemptible [00000000] code: sg_reset/3646
[ 659.343282] caller is qedf_execute_tmf+0x8b/0x360 [qedf]

Tested-by: Guangwu Zhang <[email protected]>
Cc: Saurav Kashyap <[email protected]>
Cc: Nilesh Javali <[email protected]>
Signed-off-by: John Meneghini <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Saurav Kashyap <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
johnmeneghini authored and gregkh committed Jul 11, 2024
1 parent b8c5f63 commit b6ded53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/scsi/qedf/qedf_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2331,9 +2331,6 @@ static int qedf_execute_tmf(struct qedf_rport *fcport, struct scsi_cmnd *sc_cmd,
io_req->fcport = fcport;
io_req->cmd_type = QEDF_TASK_MGMT_CMD;

/* Record which cpu this request is associated with */
io_req->cpu = smp_processor_id();

/* Set TM flags */
io_req->io_req_flags = QEDF_READ;
io_req->data_xfer_len = 0;
Expand All @@ -2355,6 +2352,9 @@ static int qedf_execute_tmf(struct qedf_rport *fcport, struct scsi_cmnd *sc_cmd,

spin_lock_irqsave(&fcport->rport_lock, flags);

/* Record which cpu this request is associated with */
io_req->cpu = smp_processor_id();

sqe_idx = qedf_get_sqe_idx(fcport);
sqe = &fcport->sq[sqe_idx];
memset(sqe, 0, sizeof(struct fcoe_wqe));
Expand Down

0 comments on commit b6ded53

Please sign in to comment.