All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] scsi: libsas: only clear phy->in_shutdown after shutdown event done
@ 2019-05-14  2:42 ` Jason Yan
  0 siblings, 0 replies; 12+ messages in thread
From: Jason Yan @ 2019-05-14  2:42 UTC (permalink / raw)
  To: martin.petersen, jejb
  Cc: linux-scsi, linux-kernel, hare, dan.j.williams, jthumshirn, hch,
	huangdaode, chenxiang66, miaoxie, john.garry, zhaohongjiang,
	Jason Yan, Ewan Milne, Tomas Henzl

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 <yanaijie@huawei.com>
CC: John Garry <john.garry@huawei.com>
CC: Johannes Thumshirn <jthumshirn@suse.de>
CC: Ewan Milne <emilne@redhat.com>
CC: Christoph Hellwig <hch@lst.de>
CC: Tomas Henzl <thenzl@redhat.com>
CC: Dan Williams <dan.j.williams@intel.com>
CC: Hannes Reinecke <hare@suse.com>
Reviewed-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/libsas/sas_phy.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/libsas/sas_phy.c b/drivers/scsi/libsas/sas_phy.c
index e030e1452136..b71f5ac6c7dc 100644
--- a/drivers/scsi/libsas/sas_phy.c
+++ b/drivers/scsi/libsas/sas_phy.c
@@ -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 ---------- */
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-05-30  2:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14  2:42 [PATCH 1/2] scsi: libsas: only clear phy->in_shutdown after shutdown event done Jason Yan
2019-05-14  2:42 ` Jason Yan
2019-05-14  2:42 ` [PATCH 2/2] scsi: libsas: delete sas port if expander discover failed Jason Yan
2019-05-14  2:42   ` Jason Yan
2019-05-14 10:45   ` John Garry
2019-05-14 10:45     ` John Garry
2019-05-14 11:37     ` Jason Yan
2019-05-14 11:37       ` Jason Yan
2019-05-14 11:46       ` John Garry
2019-05-14 11:46         ` John Garry
2019-05-30  2:09 ` [PATCH 1/2] scsi: libsas: only clear phy->in_shutdown after shutdown event done Martin K. Petersen
2019-05-30  2:09   ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.