From patchwork Fri Mar 5 05:49:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 12117805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4E67C433E0 for ; Fri, 5 Mar 2021 05:49:43 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 427A465014 for ; Fri, 5 Mar 2021 05:49:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 427A465014 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=hueWNpr55mvBphRq95nw1LoSiR1pD8xYNHySBDCVcq4=; b=KRrWXW3Jk9yKKh1Y6QlJwmHgZj EFQB9TRVp6FGyiu239X4UIxir1uPXcYoM9/7bJE6+sRZVBS9UEbjorzeOue8cq2TX8+GVeh1oqofv htGy+z8B/B8D3MqmD7OWarHJTYlqrTvAIl2vhK4xF4y7J04nnCKMpODoa8XPXRLbqaesFFFHD/vmq Le/0OoCwFXa1jgs0e0hx96Q8wMhMam49CtMizFbO+L842hmcSkOSp5JTc+gRRyJUgVLRKXyAj5Eyb joKWLR9LbDp5bUXSXeyV5cY72IJGs5Mn2eULeLdvBVecLt942w78+AhEMPb2gK7q1DUREezD7m/3w 3Mgv2n4Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lI3Jp-00Czxr-DD; Fri, 05 Mar 2021 05:48:09 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lI3Jn-00Czwh-68 for linux-arm-kernel@desiato.infradead.org; Fri, 05 Mar 2021 05:48:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=g0BivRcGRLSphsdXXZy45JeKHOoN2HZ9FO/ADyoaESc=; b=jjrHl1/fiPWiIq8wQUJLy1D2nL 8FoE7L5tcKwyEIAp4czjIyFjVMbuYEpRndYZgW0f1upXJFn1xsM27E4Q5z8/D0YbeAxQumxmClCD3 vTmvLOS7aQVNUcoVxDuYYKeAxr9xTRUh0QWn8feI8G0GIBDackr3DzFED9PWBq8DqNNRbunufHBAB Q+227upgeTK2ec37kLFSHRWPPCMaLC1Ed8teWd3GAssJwn7hJEdRI7kMd15hT+BLOT+ctPF2NmPHY SoMbEto9/CGBDrmbRo6OAh6LQvv7eeM8o7GtSZfqaZCIIZep9Ld7EBBX3Ui8o7SqiN1Z5/TLdAJv/ c7OwqxAg==; Received: from mga06.intel.com ([134.134.136.31]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lI3JW-00AKYp-QJ for linux-arm-kernel@lists.infradead.org; Fri, 05 Mar 2021 05:47:58 +0000 IronPort-SDR: FIprXoUG8yymJS/4PNu0MY7mPghS0Fqy20bZVgfTSgA8RcK/PjAI0DORZBqeFhzc/5zagrm4Ix WGY6W77l8gCQ== X-IronPort-AV: E=McAfee;i="6000,8403,9913"; a="248967218" X-IronPort-AV: E=Sophos;i="5.81,224,1610438400"; d="scan'208";a="248967218" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2021 21:46:33 -0800 IronPort-SDR: 2oWlfv1RIMS0G3hZt0P+/X/dqBMO+h83Ek/AfL+kLozvNggpjXeGNFtR32vYnA1/B6RCuf+v8I VWoCrYH5BfZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,224,1610438400"; d="scan'208";a="446070894" Received: from glass.png.intel.com ([10.158.65.59]) by orsmga001.jf.intel.com with ESMTP; 04 Mar 2021 21:46:30 -0800 From: Ong Boon Leong To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski Cc: Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Voon Weifeng , Ong Boon Leong Subject: [PATCH net 1/1] net: stmmac: Fix VLAN filter delete timeout issue in Intel mGBE SGMII Date: Fri, 5 Mar 2021 13:49:30 +0800 Message-Id: <20210305054930.7434-1-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210305_054756_653133_C9D2C91C X-CRM114-Status: UNSURE ( 8.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For Intel mGbE controller, MAC VLAN filter delete operation will time-out if serdes power-down sequence happened first during driver remove() with below message. [82294.764958] intel-eth-pci 0000:00:1e.4 eth2: stmmac_dvr_remove: removing driver [82294.778677] intel-eth-pci 0000:00:1e.4 eth2: Timeout accessing MAC_VLAN_Tag_Filter [82294.779997] intel-eth-pci 0000:00:1e.4 eth2: failed to kill vid 0081/0 [82294.947053] intel-eth-pci 0000:00:1d.2 eth1: stmmac_dvr_remove: removing driver [82295.002091] intel-eth-pci 0000:00:1d.1 eth0: stmmac_dvr_remove: removing driver Therefore, we delay the serdes power-down to be after unregister_netdev() which triggers the VLAN filter delete. Fixes: b9663b7ca6ff ("net: stmmac: Enable SERDES power up/down sequence") Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 0eba44e9c1f8..208cae344ffa 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5249,13 +5249,16 @@ int stmmac_dvr_remove(struct device *dev) netdev_info(priv->dev, "%s: removing driver", __func__); stmmac_stop_all_dma(priv); + stmmac_mac_set(priv, priv->ioaddr, false); + netif_carrier_off(ndev); + unregister_netdev(ndev); + /* Serdes power down needs to happen after VLAN filter + * is deleted that is triggered by unregister_netdev(). + */ if (priv->plat->serdes_powerdown) priv->plat->serdes_powerdown(ndev, priv->plat->bsp_priv); - stmmac_mac_set(priv, priv->ioaddr, false); - netif_carrier_off(ndev); - unregister_netdev(ndev); #ifdef CONFIG_DEBUG_FS stmmac_exit_fs(ndev); #endif