From patchwork Thu May 31 12:50:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 137381 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp6561624lji; Thu, 31 May 2018 05:52:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJWk68BU7mevhzZWnPyVdWYxV56c4jFHTvtRaYr3OCl/z7WDyTRkwRzANPlc0oHZH1csOsa X-Received: by 2002:a63:62c7:: with SMTP id w190-v6mr5598220pgb.104.1527771167934; Thu, 31 May 2018 05:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527771167; cv=none; d=google.com; s=arc-20160816; b=gKF3omhGEzGh3FquaDdHRMyJkpF8dv69+Fumlmt48wDgwwL+toEEdTT7+seX0OEKjs Pc8KxD/e1w/BpqQyvz40ktn6cPdkD/By/CBBxnTodUGdMILS7ic6b2c9LqPJQnHvwDcX H38IdjIti2LYgfAsETHV30ue/3x2UN4jmnBHkT3jOg4A5pxQyGohawrQPy7NUNvQr9mb tsAQJlFDFoAgNs+gk8R+4pObOJHsVKu8yLaMaNGyL10Mp1kyJrFDWJYdi5jd6G1VgrRv JDzIBVyPf/09a2wOFg6qiDK0v2CQgRzgSvl77CAxhpJ5RXZI13lSCeG8gX1vgTn2x628 8iOQ== 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:arc-authentication-results; bh=YdZ4xL6T8L8PA2kgT57RJ4G4Uan3e9JHiyCpRH58t/w=; b=quQPhjtGjRSPfkwQixXh/IKn4xTiCSBeHwmUEpt7rtqBwP1n3kXMPow+TxAYoccax3 PPConMCOVOadXl5C4u2i+H76qF16WsWVO7ehiNgHLFAwhq9W7+0rajfi1bJgC2yrUJeK +5vEx7K+1P9LYCUvPQxv+xMbVxBz7GB2jwJEi1VSmPvK+oBdhqB207kKzeOpU3i4vteF N9KGmR5YEtVz6X3hyN0orEzPaYAzdZM9upacTscd95qcAmQfxjN11ceQE2Rf0h2A6+fm VHW7FFJMKFl2kki6HiANQTLaTBFuXig89C277vnTDrxYRVHQT0Ntfz3G6AsFP2JtHvYl wU0w== 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 q2-v6si37041758plh.136.2018.05.31.05.52.47; Thu, 31 May 2018 05:52:47 -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 S1755247AbeEaMwp (ORCPT + 30 others); Thu, 31 May 2018 08:52:45 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8239 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755175AbeEaMwg (ORCPT ); Thu, 31 May 2018 08:52:36 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 59C1E80D2C8DC; Thu, 31 May 2018 20:52:20 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.382.0; Thu, 31 May 2018 20:52:11 +0800 From: John Garry To: , CC: , , , Xiaofei Tan , "John Garry" Subject: [PATCH 5/9] scsi: hisi_sas: Add a flag to filter PHY events during reset Date: Thu, 31 May 2018 20:50:46 +0800 Message-ID: <1527771050-200916-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1527771050-200916-1-git-send-email-john.garry@huawei.com> References: <1527771050-200916-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiaofei Tan During reset, we don't want PHY events reported to libsas for PHYs which were previously attached prior to reset. So check hisi_hba->flags for HISI_SAS_RESET_BIT to filter PHY events during reset. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 3 ++- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 3 ++- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 090d3e0..006e776 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1927,7 +1927,8 @@ void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy) } else { struct hisi_sas_port *port = phy->port; - if (phy->in_reset) { + if (test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags) || + phy->in_reset) { dev_info(dev, "ignore flutter phy%d down\n", phy_no); return; } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 89ab18c..3277442 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1469,7 +1469,8 @@ static irqreturn_t int_bcast_v1_hw(int irq, void *p) goto end; } - sha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); + if (!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) + sha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); end: hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT2, diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 213c530..159576e 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -2840,7 +2840,8 @@ static void phy_bcast_v2_hw(int phy_no, struct hisi_hba *hisi_hba) hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1); bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS); - if (bcast_status & RX_BCAST_CHG_MSK) + if ((bcast_status & RX_BCAST_CHG_MSK) && + !test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0, CHL_INT0_SL_RX_BCST_ACK_MSK); diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index c40fdb8..e43881d 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1263,7 +1263,8 @@ static irqreturn_t phy_bcast_v3_hw(int phy_no, struct hisi_hba *hisi_hba) hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1); bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS); - if (bcast_status & RX_BCAST_CHG_MSK) + if ((bcast_status & RX_BCAST_CHG_MSK) && + !test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0, CHL_INT0_SL_RX_BCST_ACK_MSK);