Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5379859imm; Sun, 26 Aug 2018 18:31:46 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda2HDzY/AXVdb1LmERgPl2poitagaOCMWTUETYpkf39F3InxA1K1/kqlpYgdcIkA9QTmNoO X-Received: by 2002:a17:902:a583:: with SMTP id az3-v6mr11045626plb.0.1535333506509; Sun, 26 Aug 2018 18:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535333506; cv=none; d=google.com; s=arc-20160816; b=lOk0k/pdl3whhay0IPb5ywFhwPRruxMrUMA7QUywRfmTc5UmazO3CydwudI6J5Xx0D ES6Ynzj70w8vZ2ZVnuFMbgflESwiCTMpMKMe0O6Ou//JIkW1Hr6AeoPzuHHEoGdIbcRh aKkq3rVexMotX+l+Mgs0leNkO1ug3yp9hJYSCQjKBgkKLMLxuoa0RcHIzzaQc7/Y0NB0 zrA9Gpu2kgur3LpRk713xbelDh/dYAqG2UpDYTL4HD/TsOeEFYf4EIJYmmcCE6bHdrnC bxmpglZwVXEKHjVdVk5/cYv6eWBqAcU/SoJuyUsUvCtNNSIoZC+jGVAYHFyoF4gtyz+3 8eZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=NQu5FrIRigQpKH/dkosCM0VuRl7YHJenkxA8wQfEzoI=; b=Htw/zbwDx38LiMC0wD/V2AmvgjZhysKFt4xkz3lpnkF1s/DXw9n+VLAL3AAeHhUriZ vcBsx4iwcuAB8sIYpXGK7iietAqD96A0+JAL9Q5ucP6kW8M3sXeo7FMDtV9YPFQN9Svq 524ys5+SySuDtgsy5HybZd4vZkOCOkAoxJdwr9KmLLp8vFqkBb1/gBZ/BcgK7RpZOGRI GztT8KARvqoUQC7p+5dUnyiSdeQ0G8y6G6qpOvsdoULZCFODiyQjlZJROg/mkaJbq5Uk Jp2MfdaIskiGKY6Q9HoGSgDrfDm0z3AqafuG9ZN/m/RJZg1Gb4LC/GqQQAFTLqEdA+eP HxVg== 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 188-v6si14100726pfg.154.2018.08.26.18.31.31; Sun, 26 Aug 2018 18:31:46 -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 S1727043AbeH0FOE (ORCPT + 99 others); Mon, 27 Aug 2018 01:14:04 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:11200 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726822AbeH0FOE (ORCPT ); Mon, 27 Aug 2018 01:14:04 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id ADAA19759920F; Mon, 27 Aug 2018 09:29:38 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.399.0; Mon, 27 Aug 2018 09:29:29 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH V2 net 0/2] net: hns: fix some bugs about speed and duplex change Date: Mon, 27 Aug 2018 09:59:28 +0800 Message-ID: <1535335170-111030-1-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 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 If there are packets in hardware when changing the spped or duplex, it may cause hardware hang up. This patchset adds the code for waiting chip to clean the all pkts(TX & RX) in chip when the driver uses the function named "adjust link". This patchset cleans the pkts as follows: 1) close rx of chip, close tx of protocol stack. 2) wait rcb, ppe, mac to clean. 3) adjust link 4) open rx of chip, open tx of protocol stack. --- Change log: V1 -> V2: 1, remove a patch according to the comment reported by Andrew Lunn. --- Peng Li (2): net: hns: add the code for cleaning pkt in chip net: hns: add netif_carrier_off before change speed and duplex drivers/net/ethernet/hisilicon/hns/hnae.h | 2 + drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 67 +++++++++++++++++++++- drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 36 ++++++++++++ drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 44 ++++++++++++++ drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h | 8 +++ drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 29 ++++++++++ drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h | 3 + drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c | 23 ++++++++ drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.h | 1 + drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 23 ++++++++ drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h | 1 + drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 1 + drivers/net/ethernet/hisilicon/hns/hns_enet.c | 21 ++++++- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 2 + 14 files changed, 257 insertions(+), 4 deletions(-) -- 2.9.3