lpfc: Fix DMA faults observed upon plugging loopback connector
authorJames Smart <james.smart@broadcom.com>
Thu, 31 Mar 2016 21:12:28 +0000 (14:12 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 11 Apr 2016 20:57:09 +0000 (16:57 -0400)
Driver didn't program the REG_VFI mailbox correctly, giving the adapter
bad addresses.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_mbox.c

index f87f90e9b7dfa2346891585174938012e0f7c794..1e34b5408a293a2cf4238fdb31d7ba87604b01b7 100644 (file)
@@ -2145,10 +2145,12 @@ lpfc_reg_vfi(struct lpfcMboxq *mbox, struct lpfc_vport *vport, dma_addr_t phys)
        reg_vfi->wwn[1] = cpu_to_le32(reg_vfi->wwn[1]);
        reg_vfi->e_d_tov = phba->fc_edtov;
        reg_vfi->r_a_tov = phba->fc_ratov;
-       reg_vfi->bde.addrHigh = putPaddrHigh(phys);
-       reg_vfi->bde.addrLow = putPaddrLow(phys);
-       reg_vfi->bde.tus.f.bdeSize = sizeof(vport->fc_sparam);
-       reg_vfi->bde.tus.f.bdeFlags = BUFF_TYPE_BDE_64;
+       if (phys) {
+               reg_vfi->bde.addrHigh = putPaddrHigh(phys);
+               reg_vfi->bde.addrLow = putPaddrLow(phys);
+               reg_vfi->bde.tus.f.bdeSize = sizeof(vport->fc_sparam);
+               reg_vfi->bde.tus.f.bdeFlags = BUFF_TYPE_BDE_64;
+       }
        bf_set(lpfc_reg_vfi_nport_id, reg_vfi, vport->fc_myDID);
 
        /* Only FC supports upd bit */