Patch "net: stmmac: Apply redundant write work around on 4.xx too" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: stmmac: Apply redundant write work around on 4.xx too

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-stmmac-apply-redundant-write-work-around-on-4.xx.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit aa786dcc7951728865bf387d921e8f3a70035154
Author: Vincent Whitchurch <vincent.whitchurch@xxxxxxxx>
Date:   Fri Jul 21 15:39:20 2023 +0200

    net: stmmac: Apply redundant write work around on 4.xx too
    
    [ Upstream commit 284779dbf4e98753458708783af8c35630674a21 ]
    
    commit a3a57bf07de23fe1ff779e0fdf710aa581c3ff73 ("net: stmmac: work
    around sporadic tx issue on link-up") worked around a problem with TX
    sometimes not working after a link-up by avoiding a redundant write to
    MAC_CTRL_REG (aka GMAC_CONFIG), since the IP appeared to have problems
    with handling multiple writes to that register in some cases.
    
    That commit however only added the work around to dwmac_lib.c (apart
    from the common code in stmmac_main.c), but my systems with version
    4.21a of the IP exhibit the same problem, so add the work around to
    dwmac4_lib.c too.
    
    Fixes: a3a57bf07de2 ("net: stmmac: work around sporadic tx issue on link-up")
    Signed-off-by: Vincent Whitchurch <vincent.whitchurch@xxxxxxxx>
    Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230721-stmmac-tx-workaround-v1-1-9411cbd5ee07@xxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
index df41eac54058f..03ceb6a940732 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
@@ -240,13 +240,15 @@ void stmmac_dwmac4_set_mac_addr(void __iomem *ioaddr, const u8 addr[6],
 void stmmac_dwmac4_set_mac(void __iomem *ioaddr, bool enable)
 {
 	u32 value = readl(ioaddr + GMAC_CONFIG);
+	u32 old_val = value;
 
 	if (enable)
 		value |= GMAC_CONFIG_RE | GMAC_CONFIG_TE;
 	else
 		value &= ~(GMAC_CONFIG_TE | GMAC_CONFIG_RE);
 
-	writel(value, ioaddr + GMAC_CONFIG);
+	if (value != old_val)
+		writel(value, ioaddr + GMAC_CONFIG);
 }
 
 void stmmac_dwmac4_get_mac_addr(void __iomem *ioaddr, unsigned char *addr,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux