]> Git Repo - linux.git/commitdiff
scsi: libsas: only clear phy->in_shutdown after shutdown event done
authorJason Yan <[email protected]>
Tue, 14 May 2019 02:42:38 +0000 (10:42 +0800)
committerMartin K. Petersen <[email protected]>
Thu, 30 May 2019 02:08:19 +0000 (22:08 -0400)
When the event queue is full of phy up and down events and reached the
threshold, we will queue a shutdown-event, and set phy->in_shutdown so that
we will not queue a shutdown-event again. But before the shutdown-event can
be executed, every phy-down event will clear
phy->in_shutdown and a new shutdown-event will be queued. The queue will
be full of these shutdown-events.

Fix this by only clear phy->in_shutdown in sas_phye_shutdown(), that is
after the first shutdown-event has been executed.

Fixes: f12486e06ae8 ("scsi: libsas: shut down the PHY if events reached the threshold")
Signed-off-by: Jason Yan <[email protected]>
CC: John Garry <[email protected]>
CC: Johannes Thumshirn <[email protected]>
CC: Ewan Milne <[email protected]>
CC: Christoph Hellwig <[email protected]>
CC: Tomas Henzl <[email protected]>
CC: Dan Williams <[email protected]>
CC: Hannes Reinecke <[email protected]>
Reviewed-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/scsi/libsas/sas_phy.c

index e030e145213631877428cd1f95a5d91fd9d44fbd..b71f5ac6c7dcf5b1b684061298c397faf8c61553 100644 (file)
@@ -35,7 +35,6 @@ static void sas_phye_loss_of_signal(struct work_struct *work)
        struct asd_sas_event *ev = to_asd_sas_event(work);
        struct asd_sas_phy *phy = ev->phy;
 
-       phy->in_shutdown = 0;
        phy->error = 0;
        sas_deform_port(phy, 1);
 }
@@ -45,7 +44,6 @@ static void sas_phye_oob_done(struct work_struct *work)
        struct asd_sas_event *ev = to_asd_sas_event(work);
        struct asd_sas_phy *phy = ev->phy;
 
-       phy->in_shutdown = 0;
        phy->error = 0;
 }
 
@@ -126,6 +124,7 @@ static void sas_phye_shutdown(struct work_struct *work)
                                  ret);
        } else
                pr_notice("phy%d is not enabled, cannot shutdown\n", phy->id);
+       phy->in_shutdown = 0;
 }
 
 /* ---------- Phy class registration ---------- */
This page took 0.055934 seconds and 4 git commands to generate.