Skip to contentSkip to conversation

scsi: qedf: make qedf_execute_tmf non-preemptible

PATCH Applied John Meneghini 3 participants 4 messages Apr 3, 2024 – May 7, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: qedf: make qedf_execute_tmf non-preemptible

Stop calling smp_processor_id from preemptible code in qedf_execute_tmf. This results in BUGON 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]
---
 drivers/scsi/qedf/qedf_io.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qedf/qedf_io.c +3 -3
index bf921caaf6ae..054a51713d55 100644
@@ -2324,9 +2324,6 @@ static int qedf_execute_tmf(struct qedf_rport *fcport, u64 tm_lun,
 	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;
@@ -2349,6 +2346,9 @@ static int qedf_execute_tmf(struct qedf_rport *fcport, u64 tm_lun,
 
 	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));
Signature · 1 line
2.39.3
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 59 lines

-----Original Message-----
From: John Meneghini <[email protected]>
Sent: Wednesday, April 3, 2024 8:32 PM
To: Saurav Kashyap <[email protected]>
Cc: [email protected]; [email protected]; GR-QLogic-Storage- Upstream <[email protected]>; [email protected]; [email protected]; Nilesh Javali <[email protected]>
Subject: [EXTERNAL] [PATCH] scsi: qedf: make qedf_execute_tmf non- preemptible

Prioritize security for external emails: Confirm sender and content safety before clicking links or opening attachments

----------------------------------------------------------------------
Stop calling smp_processor_id from preemptible code in qedf_execute_tmf. This results in BUGON 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]
---
 drivers/scsi/qedf/qedf_io.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qedf/qedf_io.c +0 -3
index bf921caaf6ae..054a51713d55 100644
@@ -2324,9 +2324,6 @@ static int qedf_execute_tmf(struct qedf_rport
 *fcport, u64 tm_lun,
 	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;
drivers/scsi/qedf/qedf_io.c +3 -0
 	io_req->data_xfer_len = 0;
@@ -2349,6 +2346,9 @@ static int qedf_execute_tmf(struct qedf_rport
 *fcport, u64 tm_lun,
 
 	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));
--
2.39.3

#2 lore raw
In reply to John Meneghini

John,

Quoted 2 lines

Stop calling smp_processor_id from preemptible code in qedf_execute_tmf. This results in BUGON when running an RT kernel.

Applied to 6.10/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
In reply to John Meneghini
Quoted 8 lines · John Meneghini

Stop calling smp_processor_id from preemptible code in qedf_execute_tmf. This results in BUGON 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]

[...]

Applied to 6.10/scsi-queue, thanks!

[1/1] scsi: qedf: make qedf_execute_tmf non-preemptible

      https://git.kernel.org/mkp/scsi/c/0d8b637c9c5e
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering