Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3528938pxf; Mon, 15 Mar 2021 11:34:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtBasHJiM8mJH7unWFyU5mvI06agAep892KXonHD07Gq5BqcxVuMbaa8qcok40CStRLmOF X-Received: by 2002:a05:6402:26c9:: with SMTP id x9mr31056480edd.322.1615833286833; Mon, 15 Mar 2021 11:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833286; cv=none; d=google.com; s=arc-20160816; b=LvUdUbPAwlmL+IW/sPYWNCf0TSHWjhKCac1JKiCfhmpzyUNxuE6Ci52iB2moFeOruz 7ln44DHtLjD1a9h93Jx5SUFiXSAn7A60wOAtoJ5nnDnj0efJI/dr6sUB09NXvmuIJkIs Obz0NV5+MUeS7HGt26MR7AeZ/xc80Xo5ntDKazzGp3S0KI7aQ4Po79Xq+4sT4VQuebQU C223ooQ2XfCfjOEcexGicqs9Ljx8r791AtS/IGELOgpkSCZnweYfMzzPoM77gOOLX++y TAZ5opRU9a26SktAj3GAWB28KkbmdrCnCdmszV9eHofDSf7EPCmIWLl+woenot6O5tL/ NjYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ILwiRh+KgmkdmlYOhnWPFFINYFTVmILtmx5JqtfkPwc=; b=aDR3jcU8OJrSgB2uMBU6fPQEeFoAHB3Wc4gRBD5Zch/CV/vZxQRlZ8UAKlGmitC+K+ VoJg3vxkZWymxdvqNVAWzGShT0pNrlz9vzruKaybRjgJqzogsqNp0Mx4NMvf+6Tzgf3C 5MPBuUxYIjybem4ngDH6Vb7Q+3OMUe7nh7XqRHg+WRU8RxSwbRQ7hH5sEh+q6LpVd1Me kGMePYUEEjen0YM9Lnye+FkkgNTXJuAxEbsnX5/kKL8TwSBkul7ekzDjOqni0ryyW9vh /7d4RtsuvX5zxV4u18OZ2keVIihW8mAvODOHk5B3MgMyXhO/X0paNC3sFasnxi1DnBE8 fHbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bnnz3dVU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb37si11814442ejc.81.2021.03.15.11.34.24; Mon, 15 Mar 2021 11:34:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bnnz3dVU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239603AbhCOOrJ (ORCPT + 99 others); Mon, 15 Mar 2021 10:47:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:36614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231630AbhCON6J (ORCPT ); Mon, 15 Mar 2021 09:58:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE69764F04; Mon, 15 Mar 2021 13:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816688; bh=RmiTjGr/R0DfF63LCOp6JPHByS43EkqYkA875oYey3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnnz3dVUGzySUo28RTb13B/2kI4p3/vVWuyOiq/QRhig5FqNtqEeRWLUMdZZX5wFz SEINzrq7puZGpndzBctfehTlLDZP2g03AIwfDEDurfkMUlfwd/8mW5Tw5eIOIwaEOk bRY+RZLbJId+UYvjNhCYY4t+XFLXPXxa0hZG9Jvo= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ong Boon Leong , "David S. Miller" Subject: [PATCH 5.11 065/306] net: stmmac: Fix VLAN filter delete timeout issue in Intel mGBE SGMII Date: Mon, 15 Mar 2021 14:52:08 +0100 Message-Id: <20210315135509.841157981@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Ong Boon Leong commit 9a7b3950c7e15968e23d83be215e95ccc7c92a53 upstream. 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5144,13 +5144,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