static int phy_up_v2_hw(int phy_no, struct hisi_hba *hisi_hba)
 {
-       int i, res = 0;
+       int i, res = IRQ_HANDLED;
        u32 context, port_id, link_rate, hard_phy_linkrate;
        struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];
        struct asd_sas_phy *sas_phy = &phy->sas_phy;
 
 static int phy_down_v2_hw(int phy_no, struct hisi_hba *hisi_hba)
 {
-       int res = 0;
        u32 phy_state, sl_ctrl, txid_auto;
        struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];
        struct hisi_sas_port *port = phy->port;
        hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0, CHL_INT0_NOT_RDY_MSK);
        hisi_sas_phy_write32(hisi_hba, phy_no, PHYCTRL_NOT_RDY_MSK, 0);
 
-       return res;
+       return IRQ_HANDLED;
 }
 
 static irqreturn_t int_phy_updown_v2_hw(int irq_no, void *p)
        struct hisi_hba *hisi_hba = p;
        u32 irq_msk;
        int phy_no = 0;
-       irqreturn_t res = IRQ_HANDLED;
 
        irq_msk = (hisi_sas_read32(hisi_hba, HGC_INVLD_DQE_INFO)
                   >> HGC_INVLD_DQE_INFO_FB_CH0_OFF) & 0x1ff;
        while (irq_msk) {
                if (irq_msk  & 1) {
-                       u32 irq_value = hisi_sas_phy_read32(hisi_hba, phy_no,
-                                                           CHL_INT0);
+                       u32 reg_value = hisi_sas_phy_read32(hisi_hba, phy_no,
+                                           CHL_INT0);
+
+                       switch (reg_value & (CHL_INT0_NOT_RDY_MSK |
+                                       CHL_INT0_SL_PHY_ENABLE_MSK)) {
 
-                       if (irq_value & CHL_INT0_SL_PHY_ENABLE_MSK)
+                       case CHL_INT0_SL_PHY_ENABLE_MSK:
                                /* phy up */
-                               if (phy_up_v2_hw(phy_no, hisi_hba)) {
-                                       res = IRQ_NONE;
-                                       goto end;
-                               }
+                               if (phy_up_v2_hw(phy_no, hisi_hba) ==
+                                   IRQ_NONE)
+                                       return IRQ_NONE;
+                               break;
 
-                       if (irq_value & CHL_INT0_NOT_RDY_MSK)
+                       case CHL_INT0_NOT_RDY_MSK:
                                /* phy down */
-                               if (phy_down_v2_hw(phy_no, hisi_hba)) {
-                                       res = IRQ_NONE;
-                                       goto end;
+                               if (phy_down_v2_hw(phy_no, hisi_hba) ==
+                                   IRQ_NONE)
+                                       return IRQ_NONE;
+                               break;
+
+                       case (CHL_INT0_NOT_RDY_MSK |
+                                       CHL_INT0_SL_PHY_ENABLE_MSK):
+                               reg_value = hisi_sas_read32(hisi_hba,
+                                               PHY_STATE);
+                               if (reg_value & BIT(phy_no)) {
+                                       /* phy up */
+                                       if (phy_up_v2_hw(phy_no, hisi_hba) ==
+                                           IRQ_NONE)
+                                               return IRQ_NONE;
+                               } else {
+                                       /* phy down */
+                                       if (phy_down_v2_hw(phy_no, hisi_hba) ==
+                                           IRQ_NONE)
+                                               return IRQ_NONE;
                                }
+                               break;
+
+                       default:
+                               break;
+                       }
+
                }
                irq_msk >>= 1;
                phy_no++;
        }
 
-end:
-       return res;
+       return IRQ_HANDLED;
 }
 
 static void phy_bcast_v2_hw(int phy_no, struct hisi_hba *hisi_hba)