LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qedf: make qedf_execute_tmf non-preemptible
@ 2024-04-03 15:01 John Meneghini
  2024-04-17 15:06 ` [EXTERNAL] " Saurav Kashyap
  2024-04-25  0:59 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: John Meneghini @ 2024-04-03 15:01 UTC (permalink / raw)
  To: skashyap
  Cc: linux-scsi, linux-kernel, GR-QLogic-Storage-Upstream,
	martin.petersen, guazhang, njavali

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]

Tested-by: Guangwu Zhang <guazhang@redhat.com>
Cc: Saurav Kashyap <skashyap@marvell.com>
Cc: Nilesh Javali <njavali@marvell.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
---
 drivers/scsi/qedf/qedf_io.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
index bf921caaf6ae..054a51713d55 100644
--- a/drivers/scsi/qedf/qedf_io.c
+++ b/drivers/scsi/qedf/qedf_io.c
@@ -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));
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [EXTERNAL] [PATCH] scsi: qedf: make qedf_execute_tmf non-preemptible
  2024-04-03 15:01 [PATCH] scsi: qedf: make qedf_execute_tmf non-preemptible John Meneghini
@ 2024-04-17 15:06 ` Saurav Kashyap
  2024-04-25  0:59 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Saurav Kashyap @ 2024-04-17 15:06 UTC (permalink / raw)
  To: John Meneghini
  Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	GR-QLogic-Storage-Upstream, martin.petersen@oracle.com,
	guazhang@redhat.com, Nilesh Javali

Acked-by: Saurav Kashyap <skashyap@marvell.com>

> -----Original Message-----
> From: John Meneghini <jmeneghi@redhat.com>
> Sent: Wednesday, April 3, 2024 8:32 PM
> To: Saurav Kashyap <skashyap@marvell.com>
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; GR-QLogic-Storage-
> Upstream <GR-QLogic-Storage-Upstream@marvell.com>;
> martin.petersen@oracle.com; guazhang@redhat.com; Nilesh Javali
> <njavali@marvell.com>
> 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]
> 
> Tested-by: Guangwu Zhang <guazhang@redhat.com>
> Cc: Saurav Kashyap <skashyap@marvell.com>
> Cc: Nilesh Javali <njavali@marvell.com>
> Signed-off-by: John Meneghini <jmeneghi@redhat.com>
> ---
>  drivers/scsi/qedf/qedf_io.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
> index bf921caaf6ae..054a51713d55 100644
> --- a/drivers/scsi/qedf/qedf_io.c
> +++ b/drivers/scsi/qedf/qedf_io.c
> @@ -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));
> --
> 2.39.3
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: qedf: make qedf_execute_tmf non-preemptible
  2024-04-03 15:01 [PATCH] scsi: qedf: make qedf_execute_tmf non-preemptible John Meneghini
  2024-04-17 15:06 ` [EXTERNAL] " Saurav Kashyap
@ 2024-04-25  0:59 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-04-25  0:59 UTC (permalink / raw)
  To: John Meneghini
  Cc: skashyap, linux-scsi, linux-kernel, GR-QLogic-Storage-Upstream,
	martin.petersen, guazhang, njavali


John,

> 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!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-25  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03 15:01 [PATCH] scsi: qedf: make qedf_execute_tmf non-preemptible John Meneghini
2024-04-17 15:06 ` [EXTERNAL] " Saurav Kashyap
2024-04-25  0:59 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).