Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp272312imu; Fri, 14 Dec 2018 19:21:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/WYd+O0JchCwYHa7wTf+9hLrDJr+B0VgObqGR22xozCsKbP2B6B3Z7M1THH0/1QxFBYUbwy X-Received: by 2002:a63:304:: with SMTP id 4mr4210028pgd.99.1544844078146; Fri, 14 Dec 2018 19:21:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544844078; cv=none; d=google.com; s=arc-20160816; b=TDrBLP/Xm9WLqx7XgQOlvZsx9y+WobbAVh+fWeD6vclkOT8gLDoZQo0CNb0Kgh7CYa zmfQPAhppvQQSgiVCNMc/OBi0ErHUPod3I9HGFwj1qYjMQL/24tRifNQI9F4GF6RJsqL pRInHhI1FQAtIeDDjMPRaY2JX5J5po3DL+hjVKO+aEdkkXD7ZrCwiQa8XFRL2BZApXRY n293zxYrXLnznWH3uTq+Yet+3OhcUuZ/6K9NwYcCmSswXlBYLYnOAqsIh5Q/yN9sbdCS QZXr7Q20EaJDXwY72X0Ue2CQ4f0wki9S/TRHC6HPC0H5WJbIQ48v6N6DvrhO18rOKIQM 3A3A== 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=fOs0mjkmRQc8LFYoY48itDsZUZtIgj72lzZe09b74Uc=; b=jlhlgdwIfN1BiqucZwlc+NMiBiMHWhjAjuWoUPA1WDIEE4eNmXCLCzaMwakmdZZ4v/ btuzLp94hSCrrk6OA6JXjH2JX/dQg3XicCXcBsGCBm+ZBAN1yYpouY4rp0fuf/mGzYDD Mm2cbXMsrtcg9BPFoeT5yI/waIx7l4sOsro98jb9z/m6YlKkF6NFdRyv8LDqBCE7woX2 H9/8DD7rze1yp8vcT2zWBd+uZeJDG9gSzANvpCZEHJzdxlNEYyQQymcjAWJaAJVqGq2D ypgnq8Jhf0e3mJixKg3lp3QZwOS1M7+UefVv249PXilfe3lTF2aMEYkD7ZM5+G+yKIgr i4KQ== 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 f16si5500153pgg.173.2018.12.14.19.21.03; Fri, 14 Dec 2018 19:21:18 -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 S1730148AbeLODRe (ORCPT + 99 others); Fri, 14 Dec 2018 22:17:34 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:16133 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728115AbeLODRc (ORCPT ); Fri, 14 Dec 2018 22:17:32 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id ECD0C56D3311B; Sat, 15 Dec 2018 11:17:29 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.408.0; Sat, 15 Dec 2018 11:17:23 +0800 From: Peng Li To: CC: , , , , , Subject: [Patch net 05/10] net: hns: Clean rx fbd when ae stopped. Date: Sat, 15 Dec 2018 11:53:24 +0800 Message-ID: <1544846009-50276-6-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544846009-50276-1-git-send-email-lipeng321@huawei.com> References: <1544846009-50276-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yonglong Liu If there are packets in hardware when changing the speed or duplex, it may cause hardware hang up. This patch adds the code to wait rx fbd clean up when ae stopped. Signed-off-by: Yonglong Liu Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c index b52029e..ad1779f 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c @@ -379,6 +379,9 @@ static void hns_ae_stop(struct hnae_handle *handle) hns_ae_ring_enable_all(handle, 0); + /* clean rx fbd. */ + hns_rcb_wait_fbd_clean(handle->qs, handle->q_num, RCB_INT_FLAG_RX); + (void)hns_mac_vm_config_bc_en(mac_cb, 0, false); } -- 1.9.1