Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5853283yba; Mon, 13 May 2019 19:26:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqdJGVo+TrYf6ZvQ2wiaeDYhDsT3cbkXgdY425EJg6XymBarRPpTrH9BXbL8UEpITwxYUj X-Received: by 2002:a62:e303:: with SMTP id g3mr37654918pfh.220.1557800785514; Mon, 13 May 2019 19:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557800785; cv=none; d=google.com; s=arc-20160816; b=S//HTQKdpZ1gnKjBi/kMhLJ+6ebFp3Xu8V6NARv34O6Y9zFwo71XtLmLJgdDWdW3Y/ ZGHyiE3tNKRtBsfuIY1Fh/xot6slnReKIs8BZpc9Rm+DvOS2qSKMjLGLX1WY1N4kN8tM gtzhF/GzJRnc5y5joQJCPIeRfK8/PwUU0lq8zcLlsTgihj2CrV9kQ2LNKdxv1hjci+hn 6aB7PEewukOaYksdkrg9DpeESUllkymvBQnakLU5upl6LyDyz81sykrveOFkI70edSKS nG+OpJyG1XSZdjtg5ujhbR6Bhg0WRSF+Gz+okkG+JBX4Du7s50ogIRfXJXmFHD+ppj4O fVYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=X3fX8TikVHdWZdQrB4dPiLGz+9T4kwAJsGYL3l/m9Q0=; b=BBH/zCGgzFDPqHC/2axdzIg/4E7Pjp+aHNqlNxlOA4phVPz0/uKn9wdSNx9RudTwMm 4p9cNk6mQ79m47U2SeB3ORjDBCn9tk7EbllP7wE3GqzHEnzsQxlvv41xs5alXpI9RQ39 PBgvszDPw92p1mgfaMTdY6Jfn+V8eipUE5wOBCvaEvbDIkbBSXJMrjnlfH2b+PVaJFDM 5fG77v1vn3cEJ4vMktvBhJ3OTvDFyz8jnVUbuji/QH+lZP033iLrl7wfhavl900TIHDn cGDXNpC5wpVoe1rFNyOzoqaKntg0j6oiWLjbIw7VeJNASGb91sU6uHqewfUc49je6t3l VEdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6si14452999pfc.235.2019.05.13.19.26.07; Mon, 13 May 2019 19:26:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726613AbfENCZO (ORCPT + 99 others); Mon, 13 May 2019 22:25:14 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7750 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726562AbfENCZO (ORCPT ); Mon, 13 May 2019 22:25:14 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 36C20501597D3B6B8425; Tue, 14 May 2019 10:25:12 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Tue, 14 May 2019 10:25:03 +0800 From: Jason Yan To: , CC: , , , , , , , , , , , Jason Yan , Ewan Milne , Tomas Henzl Subject: [PATCH 1/2] scsi: libsas: only clear phy->in_shutdown after shutdown event done Date: Tue, 14 May 2019 10:42:38 +0800 Message-ID: <20190514024239.47313-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke Reviewed-by: John Garry --- 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