OSDN Git Service

scsi: hisi_sas: Add a flag to filter PHY events during reset
authorXiaofei Tan <tanxiaofei@huawei.com>
Thu, 31 May 2018 12:50:46 +0000 (20:50 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 20 Jun 2018 02:02:25 +0000 (22:02 -0400)
During reset, we don't want PHY events reported to libsas for PHYs which
were previously attached prior to reset.

So check hisi_hba->flags for HISI_SAS_RESET_BIT to filter PHY events during
reset.

Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index 090d3e0..006e776 100644 (file)
@@ -1927,7 +1927,8 @@ void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy)
        } else {
                struct hisi_sas_port *port  = phy->port;
 
-               if (phy->in_reset) {
+               if (test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags) ||
+                   phy->in_reset) {
                        dev_info(dev, "ignore flutter phy%d down\n", phy_no);
                        return;
                }
index 89ab18c..3277442 100644 (file)
@@ -1469,7 +1469,8 @@ static irqreturn_t int_bcast_v1_hw(int irq, void *p)
                goto end;
        }
 
-       sha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
+       if (!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags))
+               sha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
 
 end:
        hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT2,
index 213c530..159576e 100644 (file)
@@ -2840,7 +2840,8 @@ static void phy_bcast_v2_hw(int phy_no, struct hisi_hba *hisi_hba)
 
        hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1);
        bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS);
-       if (bcast_status & RX_BCAST_CHG_MSK)
+       if ((bcast_status & RX_BCAST_CHG_MSK) &&
+           !test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags))
                sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
        hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0,
                             CHL_INT0_SL_RX_BCST_ACK_MSK);
index c40fdb8..e43881d 100644 (file)
@@ -1263,7 +1263,8 @@ static irqreturn_t phy_bcast_v3_hw(int phy_no, struct hisi_hba *hisi_hba)
 
        hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1);
        bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS);
-       if (bcast_status & RX_BCAST_CHG_MSK)
+       if ((bcast_status & RX_BCAST_CHG_MSK) &&
+           !test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags))
                sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
        hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0,
                             CHL_INT0_SL_RX_BCST_ACK_MSK);