Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp938784ybl; Wed, 28 Aug 2019 07:28:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd3hyAAr9v6I/57lt+L4yXoVbTdnuWmldHykRxlSS+CAbJUQaGReyReIpjOOGfKuO7P0uN X-Received: by 2002:a63:484d:: with SMTP id x13mr3696698pgk.122.1567002489919; Wed, 28 Aug 2019 07:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567002489; cv=none; d=google.com; s=arc-20160816; b=GVyffESzmfJPcnHsDXmGbQf3Ud/Owd6oYRwFsJdQLGVbPoy5DTieAIZBmnzfWWH1IT 9kjb9XyJRbzJtup79YIFgL+Qr8tgGpixRg/z81hZejjeWHMMFqhENHTXX9jxgiM33emb OCYvQQxqj4kkacNtOPPSOG+iLzJ3anjcRB2HyMG8k33LsPJRBkwnerKyhFOINievcbLI SwDMmGEDhvignfINHKwwrAS7tP8daUjz/Ur84k5nZd6FiwSsd4PcYGTHGXOz9UOLNfUm Z0qheaYAerIKt/t8iUy+ais8IwqMSNnIQB7SGQQZFTxaO2N5Ez3PLGskDxYhm9y2ZQlU D4mg== 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=Fi+OC7PjizRF9evqaAiH1h7yMjYNYC6u7Z4zaw1kGiM=; b=b1CwdU0ENRvzrqSdIW1Mvj/Mg6wCaKEbGJ7d9LYi/BIOFY/nYKyc3tVQowk1G01iak QV2bnbkmlIZ6aANumabf2oycxUUlfi6yz8TS02VndNdqBjd+OfrxzPsogM4+luOhWgm0 srkcr+1mep87FqcjJlDPteFZ4gUdswp2QESZNkA4LcVa+0n4TfqCGaWt9Zw6dVHVkhM8 5jO9SBYlVUwf6lwtWx5+DCGFL5XKwJ68v9t6JuYPG6iFU5pK8xtA5KFg2jHENC/WC0jm rLy8YUOr+8yCObk/GJUFoHYVxIXyUR1tDHa+dLE6fLBT+MNdred9wR8hJDw3B50seJCZ NYdA== 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 x125si2278678pgx.332.2019.08.28.07.27.53; Wed, 28 Aug 2019 07:28:09 -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 S1727421AbfH1O0h (ORCPT + 99 others); Wed, 28 Aug 2019 10:26:37 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41772 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726397AbfH1OZn (ORCPT ); Wed, 28 Aug 2019 10:25:43 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 545FB1642EA358628807; Wed, 28 Aug 2019 22:25:41 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Wed, 28 Aug 2019 22:25:32 +0800 From: Huazhong Tan To: CC: , , , , , Huazhong Tan Subject: [PATCH net-next 11/12] net: hns3: check reset interrupt status when reset fails Date: Wed, 28 Aug 2019 22:23:15 +0800 Message-ID: <1567002196-63242-12-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567002196-63242-1-git-send-email-tanhuazhong@huawei.com> References: <1567002196-63242-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the reset interrupt will be cleared firstly, so when reset fails, if interrupt status register has reset interrupt, it means there is a new coming reset. Fixes: 72e2fb07997c ("net: hns3: clear reset interrupt status in hclge_irq_handle()") Signed-off-by: Huazhong Tan Reviewed-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++---- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 428f7c0..dc22b84 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3536,11 +3536,10 @@ static bool hclge_reset_err_handle(struct hclge_dev *hdev) dev_info(&hdev->pdev->dev, "Reset pending %lu\n", hdev->reset_pending); return true; - } else if ((hdev->reset_type != HNAE3_IMP_RESET) && - (hclge_read_dev(&hdev->hw, HCLGE_GLOBAL_RESET_REG) & - BIT(HCLGE_IMP_RESET_BIT))) { + } else if (hclge_read_dev(&hdev->hw, HCLGE_MISC_VECTOR_INT_STS) & + HCLGE_RESET_INT_M) { dev_info(&hdev->pdev->dev, - "reset failed because IMP Reset is pending\n"); + "reset failed because new reset interrupt\n"); hclge_clear_reset_cause(hdev); return false; } else if (hdev->reset_fail_cnt < MAX_RESET_FAIL_CNT) { diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index a3bc382..437a9ff 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -164,6 +164,7 @@ enum HLCGE_PORT_TYPE { #define HCLGE_GLOBAL_RESET_BIT 0 #define HCLGE_CORE_RESET_BIT 1 #define HCLGE_IMP_RESET_BIT 2 +#define HCLGE_RESET_INT_M GENMASK(2, 0) #define HCLGE_FUN_RST_ING 0x20C00 #define HCLGE_FUN_RST_ING_B 0 -- 2.7.4