Skip to content

Commit 5c31b0c

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
scsi: hisi_sas: shutdown axi bus to avoid exception CQ returned
When injecting 2 bit ECC error, it will cause fatal AXI interrupts. Before the recovery of SAS controller reset, the internal of SAS controller is in error. If CQ interrupts return at the time, actually it is exception CQ interrupt, and it may cause resource release in disorder. To avoid the exception situation, shutdown AXI bus after fatal AXI interrupt. In SAS controller reset, it will restart AXI bus. For later version of v3 hw, hardware will shutdown AXI bus for this situation, so just fix current ver of v3 hw. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 569eddc commit 5c31b0c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,7 @@ static irqreturn_t fatal_axi_int_v3_hw(int irq_no, void *p)
16461646
u32 irq_value, irq_msk;
16471647
struct hisi_hba *hisi_hba = p;
16481648
struct device *dev = hisi_hba->dev;
1649+
struct pci_dev *pdev = hisi_hba->pci_dev;
16491650
int i;
16501651

16511652
irq_msk = hisi_sas_read32(hisi_hba, ENT_INT_SRC_MSK3);
@@ -1677,6 +1678,17 @@ static irqreturn_t fatal_axi_int_v3_hw(int irq_no, void *p)
16771678
error->msg, irq_value);
16781679
queue_work(hisi_hba->wq, &hisi_hba->rst_work);
16791680
}
1681+
1682+
if (pdev->revision < 0x21) {
1683+
u32 reg_val;
1684+
1685+
reg_val = hisi_sas_read32(hisi_hba,
1686+
AXI_MASTER_CFG_BASE +
1687+
AM_CTRL_GLOBAL);
1688+
reg_val |= AM_CTRL_SHUTDOWN_REQ_MSK;
1689+
hisi_sas_write32(hisi_hba, AXI_MASTER_CFG_BASE +
1690+
AM_CTRL_GLOBAL, reg_val);
1691+
}
16801692
}
16811693

16821694
if (irq_value & BIT(ENT_INT_SRC3_ITC_INT_OFF)) {

0 commit comments

Comments
 (0)