Skip to content

Commit ce26497

Browse files
Yihang Limartinkpetersen
authored andcommitted
scsi: hisi_sas: Set .phy_attached before notifing phyup event HISI_PHYE_PHY_UP_PM
Currently in directly attached scenario, the phyup event HISI_PHYE_PHY_UP_PM is notified before .phy_attached is set - this may cause the phyup work hisi_sas_bytes_dmaed() execution failed and the attached device will not be found. To fix it, set .phy_attached before notifing phyup event. Signed-off-by: Yihang Li <[email protected]> Signed-off-by: Xiang Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent b85ea95 commit ce26497

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,11 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba)
16051605
}
16061606

16071607
phy->port_id = port_id;
1608+
spin_lock(&phy->lock);
1609+
/* Delete timer and set phy_attached atomically */
1610+
del_timer(&phy->timer);
1611+
phy->phy_attached = 1;
1612+
spin_unlock(&phy->lock);
16081613

16091614
/*
16101615
* Call pm_runtime_get_noresume() which pairs with
@@ -1618,11 +1623,6 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba)
16181623

16191624
res = IRQ_HANDLED;
16201625

1621-
spin_lock(&phy->lock);
1622-
/* Delete timer and set phy_attached atomically */
1623-
del_timer(&phy->timer);
1624-
phy->phy_attached = 1;
1625-
spin_unlock(&phy->lock);
16261626
end:
16271627
if (phy->reset_completion)
16281628
complete(phy->reset_completion);

0 commit comments

Comments
 (0)