[SCSI] lpfc 8.3.22: Add support for PCI Adapter Failure
Periodically poll adapter registers to detect pci adapter failure (reads return -1). On failure, take port offline, set error indicators and wake up worker threads. Threads will take adapter offline. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:

committed by
James Bottomley

parent
7f86059ac0
commit
9940b97bb3
@@ -897,7 +897,18 @@ lpfc_worker_wake_up(struct lpfc_hba *phba)
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static inline int
|
||||
lpfc_readl(void __iomem *addr, uint32_t *data)
|
||||
{
|
||||
uint32_t temp;
|
||||
temp = readl(addr);
|
||||
if (temp == 0xffffffff)
|
||||
return -EIO;
|
||||
*data = temp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
lpfc_sli_read_hs(struct lpfc_hba *phba)
|
||||
{
|
||||
/*
|
||||
@@ -906,15 +917,17 @@ lpfc_sli_read_hs(struct lpfc_hba *phba)
|
||||
*/
|
||||
phba->sli.slistat.err_attn_event++;
|
||||
|
||||
/* Save status info */
|
||||
phba->work_hs = readl(phba->HSregaddr);
|
||||
phba->work_status[0] = readl(phba->MBslimaddr + 0xa8);
|
||||
phba->work_status[1] = readl(phba->MBslimaddr + 0xac);
|
||||
/* Save status info and check for unplug error */
|
||||
if (lpfc_readl(phba->HSregaddr, &phba->work_hs) ||
|
||||
lpfc_readl(phba->MBslimaddr + 0xa8, &phba->work_status[0]) ||
|
||||
lpfc_readl(phba->MBslimaddr + 0xac, &phba->work_status[1])) {
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Clear chip Host Attention error bit */
|
||||
writel(HA_ERATT, phba->HAregaddr);
|
||||
readl(phba->HAregaddr); /* flush */
|
||||
phba->pport->stopped = 1;
|
||||
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user