aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c55
1 files changed, 33 insertions, 22 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 1d2f65c4eb0b..b3a69f984d95 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -263,6 +263,9 @@ lpfc_sli4_eq_release(struct lpfc_queue *q, bool arm)
263 bf_set(lpfc_eqcq_doorbell_qt, &doorbell, LPFC_QUEUE_TYPE_EVENT); 263 bf_set(lpfc_eqcq_doorbell_qt, &doorbell, LPFC_QUEUE_TYPE_EVENT);
264 bf_set(lpfc_eqcq_doorbell_eqid, &doorbell, q->queue_id); 264 bf_set(lpfc_eqcq_doorbell_eqid, &doorbell, q->queue_id);
265 writel(doorbell.word0, q->phba->sli4_hba.EQCQDBregaddr); 265 writel(doorbell.word0, q->phba->sli4_hba.EQCQDBregaddr);
266 /* PCI read to flush PCI pipeline on re-arming for INTx mode */
267 if ((q->phba->intr_type == INTx) && (arm == LPFC_QUEUE_REARM))
268 readl(q->phba->sli4_hba.EQCQDBregaddr);
266 return released; 269 return released;
267} 270}
268 271
@@ -7686,31 +7689,28 @@ static int
7686lpfc_sli4_eratt_read(struct lpfc_hba *phba) 7689lpfc_sli4_eratt_read(struct lpfc_hba *phba)
7687{ 7690{
7688 uint32_t uerr_sta_hi, uerr_sta_lo; 7691 uint32_t uerr_sta_hi, uerr_sta_lo;
7689 uint32_t onlnreg0, onlnreg1;
7690 7692
7691 /* For now, use the SLI4 device internal unrecoverable error 7693 /* For now, use the SLI4 device internal unrecoverable error
7692 * registers for error attention. This can be changed later. 7694 * registers for error attention. This can be changed later.
7693 */ 7695 */
7694 onlnreg0 = readl(phba->sli4_hba.ONLINE0regaddr); 7696 uerr_sta_lo = readl(phba->sli4_hba.UERRLOregaddr);
7695 onlnreg1 = readl(phba->sli4_hba.ONLINE1regaddr); 7697 uerr_sta_hi = readl(phba->sli4_hba.UERRHIregaddr);
7696 if ((onlnreg0 != LPFC_ONLINE_NERR) || (onlnreg1 != LPFC_ONLINE_NERR)) { 7698 if ((~phba->sli4_hba.ue_mask_lo & uerr_sta_lo) ||
7697 uerr_sta_lo = readl(phba->sli4_hba.UERRLOregaddr); 7699 (~phba->sli4_hba.ue_mask_hi & uerr_sta_hi)) {
7698 uerr_sta_hi = readl(phba->sli4_hba.UERRHIregaddr); 7700 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7699 if (uerr_sta_lo || uerr_sta_hi) { 7701 "1423 HBA Unrecoverable error: "
7700 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 7702 "uerr_lo_reg=0x%x, uerr_hi_reg=0x%x, "
7701 "1423 HBA Unrecoverable error: " 7703 "ue_mask_lo_reg=0x%x, ue_mask_hi_reg=0x%x\n",
7702 "uerr_lo_reg=0x%x, uerr_hi_reg=0x%x, " 7704 uerr_sta_lo, uerr_sta_hi,
7703 "online0_reg=0x%x, online1_reg=0x%x\n", 7705 phba->sli4_hba.ue_mask_lo,
7704 uerr_sta_lo, uerr_sta_hi, 7706 phba->sli4_hba.ue_mask_hi);
7705 onlnreg0, onlnreg1); 7707 phba->work_status[0] = uerr_sta_lo;
7706 phba->work_status[0] = uerr_sta_lo; 7708 phba->work_status[1] = uerr_sta_hi;
7707 phba->work_status[1] = uerr_sta_hi; 7709 /* Set the driver HA work bitmap */
7708 /* Set the driver HA work bitmap */ 7710 phba->work_ha |= HA_ERATT;
7709 phba->work_ha |= HA_ERATT; 7711 /* Indicate polling handles this ERATT */
7710 /* Indicate polling handles this ERATT */ 7712 phba->hba_flag |= HBA_ERATT_HANDLED;
7711 phba->hba_flag |= HBA_ERATT_HANDLED; 7713 return 1;
7712 return 1;
7713 }
7714 } 7714 }
7715 return 0; 7715 return 0;
7716} 7716}
@@ -7833,7 +7833,7 @@ irqreturn_t
7833lpfc_sli_sp_intr_handler(int irq, void *dev_id) 7833lpfc_sli_sp_intr_handler(int irq, void *dev_id)
7834{ 7834{
7835 struct lpfc_hba *phba; 7835 struct lpfc_hba *phba;
7836 uint32_t ha_copy; 7836 uint32_t ha_copy, hc_copy;
7837 uint32_t work_ha_copy; 7837 uint32_t work_ha_copy;
7838 unsigned long status; 7838 unsigned long status;
7839 unsigned long iflag; 7839 unsigned long iflag;
@@ -7891,8 +7891,13 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id)
7891 } 7891 }
7892 7892
7893 /* Clear up only attention source related to slow-path */ 7893 /* Clear up only attention source related to slow-path */
7894 hc_copy = readl(phba->HCregaddr);
7895 writel(hc_copy & ~(HC_MBINT_ENA | HC_R2INT_ENA |
7896 HC_LAINT_ENA | HC_ERINT_ENA),
7897 phba->HCregaddr);
7894 writel((ha_copy & (HA_MBATT | HA_R2_CLR_MSK)), 7898 writel((ha_copy & (HA_MBATT | HA_R2_CLR_MSK)),
7895 phba->HAregaddr); 7899 phba->HAregaddr);
7900 writel(hc_copy, phba->HCregaddr);
7896 readl(phba->HAregaddr); /* flush */ 7901 readl(phba->HAregaddr); /* flush */
7897 spin_unlock_irqrestore(&phba->hbalock, iflag); 7902 spin_unlock_irqrestore(&phba->hbalock, iflag);
7898 } else 7903 } else
@@ -8202,6 +8207,7 @@ lpfc_sli_intr_handler(int irq, void *dev_id)
8202 struct lpfc_hba *phba; 8207 struct lpfc_hba *phba;
8203 irqreturn_t sp_irq_rc, fp_irq_rc; 8208 irqreturn_t sp_irq_rc, fp_irq_rc;
8204 unsigned long status1, status2; 8209 unsigned long status1, status2;
8210 uint32_t hc_copy;
8205 8211
8206 /* 8212 /*
8207 * Get the driver's phba structure from the dev_id and 8213 * Get the driver's phba structure from the dev_id and
@@ -8239,7 +8245,12 @@ lpfc_sli_intr_handler(int irq, void *dev_id)
8239 } 8245 }
8240 8246
8241 /* Clear attention sources except link and error attentions */ 8247 /* Clear attention sources except link and error attentions */
8248 hc_copy = readl(phba->HCregaddr);
8249 writel(hc_copy & ~(HC_MBINT_ENA | HC_R0INT_ENA | HC_R1INT_ENA
8250 | HC_R2INT_ENA | HC_LAINT_ENA | HC_ERINT_ENA),
8251 phba->HCregaddr);
8242 writel((phba->ha_copy & ~(HA_LATT | HA_ERATT)), phba->HAregaddr); 8252 writel((phba->ha_copy & ~(HA_LATT | HA_ERATT)), phba->HAregaddr);
8253 writel(hc_copy, phba->HCregaddr);
8243 readl(phba->HAregaddr); /* flush */ 8254 readl(phba->HAregaddr); /* flush */
8244 spin_unlock(&phba->hbalock); 8255 spin_unlock(&phba->hbalock);
8245 8256