From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8409F436A6; Fri, 8 Dec 2023 08:48:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 883A942FCB; Fri, 8 Dec 2023 08:48:02 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id DC74242FAB for ; Fri, 8 Dec 2023 08:47:58 +0100 (CET) Received: from kwepemd100004.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SmjsH6TMRzYstm for ; Fri, 8 Dec 2023 15:47:15 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Fri, 8 Dec 2023 15:47:56 +0800 From: Jie Hai To: , Yisen Zhuang , Dengdui Huang CC: , , , Subject: [PATCH v3 2/3] net/hns3: fix disable command with firmware Date: Fri, 8 Dec 2023 15:44:15 +0800 Message-ID: <20231208074416.2890279-3-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231208074416.2890279-1-haijie1@huawei.com> References: <20231111015915.2776769-1-haijie1@huawei.com> <20231208074416.2890279-1-haijie1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd100004.china.huawei.com (7.221.188.31) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Dengdui Huang Disable command only when need to delay handle reset. This patch fixes it. Fixes: 5be38fc6c0fc ("net/hns3: fix multiple reset detected log") Cc: stable@dpdk.org Signed-off-by: Dengdui Huang Signed-off-by: Jie Hai --- drivers/net/hns3/hns3_ethdev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index ae81368f68ae..76fc401bd62c 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -5552,18 +5552,16 @@ hns3_detect_reset_event(struct hns3_hw *hw) last_req = hns3_get_reset_level(hns, &hw->reset.pending); vector0_intr_state = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG); - if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_intr_state) { - __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED); + if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_intr_state) new_req = HNS3_IMP_RESET; - } else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state) { - __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED); + else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state) new_req = HNS3_GLOBAL_RESET; - } if (new_req == HNS3_NONE_RESET) return HNS3_NONE_RESET; if (last_req == HNS3_NONE_RESET || last_req < new_req) { + __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED); hns3_schedule_delayed_reset(hns); hns3_warn(hw, "High level reset detected, delay do reset"); } -- 2.30.0