diff options
author | James Smart <James.Smart@Emulex.Com> | 2009-10-02 15:16:56 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:01:41 -0500 |
commit | 0d87841997125971b7a39d21d1435054f91884c3 (patch) | |
tree | a30a4fe442ddc654ef170b40e7e2e66199bbad18 /drivers/scsi/lpfc/lpfc_sli.c | |
parent | 6a9c52cf22e4ca13816bb2bd9899129cd4445de7 (diff) |
[SCSI] lpfc 8.3.5: Add AER support
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 9693c777425a..42d0f1948a7a 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <scsi/scsi_host.h> | 30 | #include <scsi/scsi_host.h> |
31 | #include <scsi/scsi_transport_fc.h> | 31 | #include <scsi/scsi_transport_fc.h> |
32 | #include <scsi/fc/fc_fs.h> | 32 | #include <scsi/fc/fc_fs.h> |
33 | #include <linux/aer.h> | ||
33 | 34 | ||
34 | #include "lpfc_hw4.h" | 35 | #include "lpfc_hw4.h" |
35 | #include "lpfc_hw.h" | 36 | #include "lpfc_hw.h" |
@@ -3551,9 +3552,13 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) | |||
3551 | struct lpfc_sli *psli; | 3552 | struct lpfc_sli *psli; |
3552 | volatile uint32_t word0; | 3553 | volatile uint32_t word0; |
3553 | void __iomem *to_slim; | 3554 | void __iomem *to_slim; |
3555 | uint32_t hba_aer_enabled; | ||
3554 | 3556 | ||
3555 | spin_lock_irq(&phba->hbalock); | 3557 | spin_lock_irq(&phba->hbalock); |
3556 | 3558 | ||
3559 | /* Take PCIe device Advanced Error Reporting (AER) state */ | ||
3560 | hba_aer_enabled = phba->hba_flag & HBA_AER_ENABLED; | ||
3561 | |||
3557 | psli = &phba->sli; | 3562 | psli = &phba->sli; |
3558 | 3563 | ||
3559 | /* Restart HBA */ | 3564 | /* Restart HBA */ |
@@ -3593,6 +3598,10 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) | |||
3593 | /* Give the INITFF and Post time to settle. */ | 3598 | /* Give the INITFF and Post time to settle. */ |
3594 | mdelay(100); | 3599 | mdelay(100); |
3595 | 3600 | ||
3601 | /* Reset HBA AER if it was enabled, note hba_flag was reset above */ | ||
3602 | if (hba_aer_enabled) | ||
3603 | pci_disable_pcie_error_reporting(phba->pcidev); | ||
3604 | |||
3596 | lpfc_hba_down_post(phba); | 3605 | lpfc_hba_down_post(phba); |
3597 | 3606 | ||
3598 | return 0; | 3607 | return 0; |
@@ -4062,6 +4071,24 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) | |||
4062 | if (rc) | 4071 | if (rc) |
4063 | goto lpfc_sli_hba_setup_error; | 4072 | goto lpfc_sli_hba_setup_error; |
4064 | 4073 | ||
4074 | /* Enable PCIe device Advanced Error Reporting (AER) if configured */ | ||
4075 | if (phba->cfg_aer_support == 1 && !(phba->hba_flag & HBA_AER_ENABLED)) { | ||
4076 | rc = pci_enable_pcie_error_reporting(phba->pcidev); | ||
4077 | if (!rc) { | ||
4078 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | ||
4079 | "2709 This device supports " | ||
4080 | "Advanced Error Reporting (AER)\n"); | ||
4081 | spin_lock_irq(&phba->hbalock); | ||
4082 | phba->hba_flag |= HBA_AER_ENABLED; | ||
4083 | spin_unlock_irq(&phba->hbalock); | ||
4084 | } else { | ||
4085 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | ||
4086 | "2708 This device does not support " | ||
4087 | "Advanced Error Reporting (AER)\n"); | ||
4088 | phba->cfg_aer_support = 0; | ||
4089 | } | ||
4090 | } | ||
4091 | |||
4065 | if (phba->sli_rev == 3) { | 4092 | if (phba->sli_rev == 3) { |
4066 | phba->iocb_cmd_size = SLI3_IOCB_CMD_SIZE; | 4093 | phba->iocb_cmd_size = SLI3_IOCB_CMD_SIZE; |
4067 | phba->iocb_rsp_size = SLI3_IOCB_RSP_SIZE; | 4094 | phba->iocb_rsp_size = SLI3_IOCB_RSP_SIZE; |