Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3530129pxf; Mon, 15 Mar 2021 11:36:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKWO7WAcIl1Z6uIMZ7LA7CaBu8NR31DTwDw1fBSjHDIz63RkqB7w3+VEM0bVcM4SJ7OYxb X-Received: by 2002:a17:907:10ce:: with SMTP id rv14mr25642438ejb.56.1615833381526; Mon, 15 Mar 2021 11:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833381; cv=none; d=google.com; s=arc-20160816; b=Y26Ll+iJkrC/YWXjSCiAhPOVJBzBb3gKKaOFlxY39V3GgLPGcub8Y/XxUmITtCDa1I xnjFHzPQslGp4m6yfCwPj79TZdZsdGapRtwSbBzViX+NMTMwkPvnKfgUbt4vTgPadAlH DQ6mE9lyv1LMvZl/HoF8V3J/4EXZWy3j6Ca9IMmh83Cv/OS0+xNDtm7JWEuOt9Y+I7Yk roB/TfS5Vu6Owc3HsquVrYjumX7kvMBJ667OOucnaE1+pOfZstd3/WVRw5WNJy1wVrBl LnD4kVhcfCYvOMX1ovzcG0TJgkqP+AXhoXkwx8/HufriT8Nm3VDIymBKanyJrMUGmWQY 854g== 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=a8iWn2dY90Cnk2HTNNbo8U5Pr1r8DndWiUI3xWIAiqU=; b=F1ynVou2hGrYzTqrCJ+npD2o7K18i5+r/TfDYE4ukcf8AkdJqlcvnO7aCHQaRTr/tq dY52L8QqOk18wtpTyGxpzISmP1tThrUXsFStZVAtE0/MTYLHAqkLN1j+rNApDfAIGEM7 xqy/Fh393Rbc4MeFKQCHdrJE+DIcqrMMc9vgWjMTR0C9LUqQ1FjO7+6+kvbOtZJNeIvV J2WIAkeqvbnDJd2xw4YB423Y2Xg0G1koB/02S7cdbCEES4bUONAV549ILgqyzTyz8xuR Bk7Ndqm9VMfUu8Vr973j9vCo/npFfQoHwQgGejpq+EQRQW0fts9xkDU70BhkMWt9u93t u1ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qnnfteiw; 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 e16si11277952edq.338.2021.03.15.11.35.59; Mon, 15 Mar 2021 11:36:21 -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=qnnfteiw; 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 S239712AbhCOOrN (ORCPT + 99 others); Mon, 15 Mar 2021 10:47:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:36796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232105AbhCON6H (ORCPT ); Mon, 15 Mar 2021 09:58:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C143364F26; Mon, 15 Mar 2021 13:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816684; bh=wdYP8A9YSW13Zm9rj4iecbtkbcaVWHR0gA37V1xYZGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qnnfteiwzMNig/MtCnAe+84Zv3a8ySqDp6xJRjVB0K5BhmGNZmx+eIvtOWTX5btUS TgEJymPJLe17PYwoM418OUIeg3J6HTaRFoKq0QIWt/d+G4b3b6bRCGlQhMh5Z9VBDr fb5ka3UJysxvFvMX8FF+4Cin+oSA7MpqXSgo7OEE= 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.10 054/290] net: stmmac: Fix VLAN filter delete timeout issue in Intel mGBE SGMII Date: Mon, 15 Mar 2021 14:52:27 +0100 Message-Id: <20210315135543.756630933@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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 @@ -5114,13 +5114,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