From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 325291AC448; Mon, 14 Oct 2024 15:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728918814; cv=none; b=X+EflPo4dtlG/ISb/PebzoJe1+AdLhet4mR80+1RRmBBgkn39UuolnG5YwWuHiXLs1zqokEWEJ5480FhqsabBq7kJDxdLAlGhSWU00iMzyGGU11cos4aCrZX4qiVt2iQF4EBx7n5uUXhUp68ycXvkrcG0JuP473Vh8Tn7LztsTs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728918814; c=relaxed/simple; bh=L8RK0nRRwUnVCraEn3BaPgiqMgQky8+BdSsTlUGcmO0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Wgu61XP4xaLY5iMlg2Ct+q/qc3Uuql/QBnKU3XR+b9VFqzzNgJG0xcwR/lLVBTfHi92ouk4XUMISf5lWgSy1wDWZQ9PEJIdBbiMldFtXpyrRPIc/dK4Vzy7YuWOZGws7hWJwazZaWs5UFpsumyid3LisTFGu/bfLuxAx8DKIy8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Xlb16O1i; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Xlb16O1i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96CCEC4CEC3; Mon, 14 Oct 2024 15:13:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728918814; bh=L8RK0nRRwUnVCraEn3BaPgiqMgQky8+BdSsTlUGcmO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xlb16O1i6bHvGzigC+ELE0SOek/fDmJ0qcFTOHbgu5J3o2mPxMFMHQpGKcUEAIdtC qLtEOaJdTE+pxNM3SBuqMbtwBnD9LBIBnFtXf/KovVAs5VD0A0aBh8B5tNsdyXa5SO cu2aUqvstyxpvyOv4bGqJqgGfEEUfM0R+3GZl1pc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andrew Lunn , Shenwei Wang , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 399/798] net: stmmac: dwmac4: extend timeout for VLAN Tag register busy bit check Date: Mon, 14 Oct 2024 16:15:53 +0200 Message-ID: <20241014141233.621578574@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014141217.941104064@linuxfoundation.org> References: <20241014141217.941104064@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shenwei Wang [ Upstream commit 4c1b56671b68ffcbe6b78308bfdda6bcce6491ae ] Increase the timeout for checking the busy bit of the VLAN Tag register from 10µs to 500ms. This change is necessary to accommodate scenarios where Energy Efficient Ethernet (EEE) is enabled. Overnight testing revealed that when EEE is active, the busy bit can remain set for up to approximately 300ms. The new 500ms timeout provides a safety margin. Fixes: ed64639bc1e0 ("net: stmmac: Add support for VLAN Rx filtering") Reviewed-by: Andrew Lunn Signed-off-by: Shenwei Wang Link: https://patch.msgid.link/20240924205424.573913-1-shenwei.wang@nxp.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 687eb17e41c6e..c75868f3ceae1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "stmmac.h" #include "stmmac_pcs.h" #include "dwmac4.h" @@ -469,7 +470,7 @@ static int dwmac4_write_vlan_filter(struct net_device *dev, u8 index, u32 data) { void __iomem *ioaddr = (void __iomem *)dev->base_addr; - int i, timeout = 10; + int ret; u32 val; if (index >= hw->num_vlan) @@ -485,16 +486,15 @@ static int dwmac4_write_vlan_filter(struct net_device *dev, writel(val, ioaddr + GMAC_VLAN_TAG); - for (i = 0; i < timeout; i++) { - val = readl(ioaddr + GMAC_VLAN_TAG); - if (!(val & GMAC_VLAN_TAG_CTRL_OB)) - return 0; - udelay(1); + ret = readl_poll_timeout(ioaddr + GMAC_VLAN_TAG, val, + !(val & GMAC_VLAN_TAG_CTRL_OB), + 1000, 500000); + if (ret) { + netdev_err(dev, "Timeout accessing MAC_VLAN_Tag_Filter\n"); + return -EBUSY; } - netdev_err(dev, "Timeout accessing MAC_VLAN_Tag_Filter\n"); - - return -EBUSY; + return 0; } static int dwmac4_add_hw_vlan_rx_fltr(struct net_device *dev, -- 2.43.0