From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 133971DDF5; Tue, 16 Jul 2024 15:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721144558; cv=none; b=kw495sDw38PgSCc8IxoKUO5O49dRCiCltgQzWUkq+8N6Kah+4rMNxqClCavw3DoB1W7nd7RIUTZrJxKW/WRT7KRA5VQ2tlk1xrkw65whKqQBxz91Vgkbw46dUAH9KWAcXE9NOnGwPd4QphJmgADo3HIFRTLCocLYMz2FImEMpcI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721144558; c=relaxed/simple; bh=5Ui2HLsTbv9wJ6hf12+j3IYdxfSdbBx/Na+iQcCnrMM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ib9X1k/PW/bAyPoKbSi8fY7AaHvzpydnaf4GohNZ9cnRkn9SmN9fnsLIe8jSqJvDb2XCkBo/MlCVXw1/vD7jWZSkruwU2DxKuKH2T0vBoL93YRKrSiVfTAO7vRAaDzRBIGwk5DiVGo+KwMiRZ3jQ4E/nQrZxhRrEOzVXPzek2hU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JXwIGeil; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JXwIGeil" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B059C116B1; Tue, 16 Jul 2024 15:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721144557; bh=5Ui2HLsTbv9wJ6hf12+j3IYdxfSdbBx/Na+iQcCnrMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JXwIGeilSGbzB+N37wep657RiYD+QItOIkRINYhAH2fm8hlJu3XDjTzRGX8xmVXFz 9G5RLRg1ZEdrKmKpdQYsIAxt5gReJ5nuSomPnrofB05WcGb2sHgnnhiZeN2XAKAf/O qNQtTI8zyNcXkxokCY7D323gaZYpwO2UU5bqdr7M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangwu Zhang , Saurav Kashyap , Nilesh Javali , John Meneghini , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 005/108] scsi: qedf: Make qedf_execute_tmf() non-preemptible Date: Tue, 16 Jul 2024 17:30:20 +0200 Message-ID: <20240716152746.201610590@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240716152745.988603303@linuxfoundation.org> References: <20240716152745.988603303@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: John Meneghini [ Upstream commit 0d8b637c9c5eeaa1a4e3dfb336f3ff918eb64fec ] 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 Cc: Saurav Kashyap Cc: Nilesh Javali Signed-off-by: John Meneghini Link: https://lore.kernel.org/r/20240403150155.412954-1-jmeneghi@redhat.com Acked-by: Saurav Kashyap Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 1f8e81296beb7..70f920f4b7a19 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -2351,9 +2351,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; @@ -2375,6 +2372,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)); -- 2.43.0