scsi: qla2xxx: Add fix to read correct register value for ISP82xx.
authorSawan Chandak <sawan.chandak@cavium.com>
Fri, 31 Mar 2017 21:37:03 +0000 (14:37 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 7 Apr 2017 21:07:15 +0000 (17:07 -0400)
Add fix to read correct register value for ISP82xx, during check for
register disconnect.ISP82xx has different base register.

Fixes: a465537ad1a4 ("qla2xxx: Disable the adapter and skip error recovery in case of register disconnect")
Signed-off-by: Sawan Chandak <sawan.chandak@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_os.c

index 579363a6f44f673c9d5104e7f9180bc4dfbb4a84..c9e45d2befe50d681de42ab90d30e8eefdbf524d 100644 (file)
@@ -1126,8 +1126,13 @@ static inline
 uint32_t qla2x00_isp_reg_stat(struct qla_hw_data *ha)
 {
        struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
+       struct device_reg_82xx __iomem *reg82 = &ha->iobase->isp82;
 
-       return ((RD_REG_DWORD(&reg->host_status)) == ISP_REG_DISCONNECT);
+       if (IS_P3P_TYPE(ha))
+               return ((RD_REG_DWORD(&reg82->host_int)) == ISP_REG_DISCONNECT);
+       else
+               return ((RD_REG_DWORD(&reg->host_status)) ==
+                       ISP_REG_DISCONNECT);
 }
 
 /**************************************************************************