diff mbox series

lpfc: Fix dma virtual address ptr assignment in bsg

Message ID 20210421234131.101842-1-jsmart2021@gmail.com
State New
Headers show
Series lpfc: Fix dma virtual address ptr assignment in bsg | expand

Commit Message

James Smart April 21, 2021, 11:41 p.m. UTC
lpfc_bsg_ct_unsol_event routine acts assigns a ct_request to the
wrong structure address, resulting in a bad address that results
in bsg related timeouts.

Correct the ct_request assignment to use the kernel virtual buffer
address (not the control structure address).

Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

Notes:
   ECD submit header:

                ****************************************

    COMMIT-TITLE: Fix loopback test failure on saturn
    COMMIT: r64560
    COMMIT-BZ: 225555
    COMMIT-QC:

r64560 | vg888570 | 2019-04-26 09:12:33 -0700 (Fri, 26 Apr 2019) | 51 lines

Fix loopback test failure on saturn
Bugs: 225555

Reviewers: jinfante pely rkennedy hpaidakul

Symptoms:
The loopback tests started failing on saturn cards

Cause:
The lpfc_bsg_ct_unsol_event() is broken during
E2E code changes. This routine acted on a wrong ct_request
pointer causing the ct_evt_waiters to timeout.

Fix:
Assign a correct virtual addr for ct_request, so that
the driver wakes up the matching waiter of the event.

Notes:

Unit Testing:
Tested on Saturn and G5 presented on the system

Saturn:
hbacmd loopback 10:00:00:00:c9:cd:ce:50 1 20 1

Test to be run: Internal Loopback
Test runs with default test pattern

Loopback test status:
Test pending. Polling for results....
Test running....
Loopback Test Succeeded; cycles complete = 20; time to execute = 858 ms

G5:
 hbacmd loopback 10:00:00:90:fa:73:93:9c 1 10 1

Test to be run: Internal Loopback
Test runs with default test pattern

Loopback test status:
Test pending. Polling for results....
Test running.............
Loopback Test Succeeded; cycles complete = 10; time to execute = 5230 ms

System Testing:

Review_ID: http://cmengapps1.lvn.broadcom.net/r/29471/
---
 drivers/scsi/lpfc/lpfc_bsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index c2776b88d493..38cfe1bc6a4d 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -934,7 +934,7 @@  lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
 	INIT_LIST_HEAD(&head);
 	list_add_tail(&head, &piocbq->list);
 
-	ct_req = (struct lpfc_sli_ct_request *)bdeBuf1;
+	ct_req = (struct lpfc_sli_ct_request *)bdeBuf1->virt;
 	evt_req_id = ct_req->FsType;
 	cmd = ct_req->CommandResponse.bits.CmdRsp;