]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
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 090d3e0b1a00c379cd3034a02ecb74f3dc0252f1..006e776ac115e2f41e3bcf5daf1a580ebe9795ec 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 89ab18c1959c7a00bfe956b646d4c5fd9e600fc1..32774427bbad47e2a7ced31088fb097d2498305f 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 213c530e63f2a8719fdf97af2b13c4931bb28df2..159576e560d790f1d2a1e6da7098e9107fdd2e6a 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 c40fdb8d5c2cff0d7790dc416efbd4edd4895c66..e43881d0d7d214011f61c86e4274a39f4bc13701 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);