Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5626582imu; Wed, 30 Jan 2019 00:26:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN6JmyGon88Q6GJEwNnTY2wJiapL2EoIabp4U3BwR6f31bkzdMX4RQINnoAPLoM4Y8nDFOwd X-Received: by 2002:a63:2ac9:: with SMTP id q192mr26812995pgq.58.1548836797892; Wed, 30 Jan 2019 00:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548836797; cv=none; d=google.com; s=arc-20160816; b=rLqThcpAZ1BDAd9yRmOnxueQtW4jFGMHSz6cxfWIMfLszJQqIcLWfQvisdGEzUgi/I JO1haqwOJ80yrSEWts2DC9Bsa2lcjQidiZs5YmBPGeI6LFPpvLaXS/ZL5dpES4MzjhGj xyNZYyCc6OpZtr9rHD8ajQ7AcBFVgOs6tm5Z3xpfyHQH1yzMQJX3sJx677nlwTK9Qt8v 2ca+/nzdSX/EEggZX80urK8ohh3Wrc4GBDTkPvhlemBtP+7/wyulj9tDu0/u2ZqvN94c Gc8c89CNjVrd2wsnr/SonoQDcrLyDdJDEwgzuJzoCe5T7Gri7ebXLLbTJu3jV1JcR2oU jEDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=PyjDRskt1UydfB9q7tSr9zPjDlIt3cXCD45oxHrTUXQ=; b=OhyCi0k1UMe9/0Ly8CzsqrftJYV2YfHqJlWRzeMa3+CM4gKNHIqu3FxqEwpg/Atlno QcX/x9e+FjibsCk+y7vR0gG3MNY06aIYodcbRpt8ZFa12+uJLiBePUDsIJWPsZ1MT0bR dw2XoAzp3PfKJ2+ViAUbDQZ9oKhatwM5Y2L1i91CmclV1m9XhprD1ubl0najQzbBLLpR 15bwY83YfNSsg2qbeMyBTaBetF2TzqcanC79H70AYTEmsZbLENn6llsfXZYhgBtgNWW9 u6JmD/nWaZbvbkyg5onJgk9ihtnOeE11UiQtlqLNIV5lOn04SuGKxwgcK/B3nXyy/fKK hkUw== 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 c81si926773pfc.82.2019.01.30.00.26.22; Wed, 30 Jan 2019 00:26:37 -0800 (PST) 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 S1730337AbfA3I0B (ORCPT + 99 others); Wed, 30 Jan 2019 03:26:01 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2703 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730256AbfA3IZ6 (ORCPT ); Wed, 30 Jan 2019 03:25:58 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E19F0B1B2C21C26959D1; Wed, 30 Jan 2019 16:25:56 +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.408.0; Wed, 30 Jan 2019 16:25:46 +0800 From: Jason Yan To: , CC: , , , , , , , , , , , , , Jason Yan , Ewan Milne , Tomas Henzl Subject: [PATCH v2 2/7] scsi: libsas: only clear phy->in_shutdown after shutdown event done Date: Wed, 30 Jan 2019 16:24:07 +0800 Message-ID: <20190130082412.9357-3-yanaijie@huawei.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20190130082412.9357-1-yanaijie@huawei.com> References: <20190130082412.9357-1-yanaijie@huawei.com> 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 --- 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 0374243c85d0..762bb13cca74 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; } @@ -127,6 +125,7 @@ static void sas_phye_shutdown(struct work_struct *work) } else pr_notice("phy%02d is not enabled, cannot shutdown\n", phy->id); + phy->in_shutdown = 0; } /* ---------- Phy class registration ---------- */ -- 2.14.4