Patch "net: enetc: fix the incorrect clearing of IF_MODE bits" has been added to the 5.10-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: enetc: fix the incorrect clearing of IF_MODE bits

to the 5.10-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-enetc-fix-the-incorrect-clearing-of-if_mode-bits.patch
and it can be found in the queue-5.10 subdirectory.

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



commit ebf665f291bd765448dff2e285fff37602b0c32d
Author: Vladimir Oltean <vladimir.oltean@xxxxxxx>
Date:   Thu Sep 23 16:23:33 2021 +0300

    net: enetc: fix the incorrect clearing of IF_MODE bits
    
    [ Upstream commit 325fd36ae76a6d089983b2d2eccb41237d35b221 ]
    
    The enetc phylink .mac_config handler intends to clear the IFMODE field
    (bits 1:0) of the PM0_IF_MODE register, but incorrectly clears all the
    other fields instead.
    
    For normal operation, the bug was inconsequential, due to the fact that
    we write the PM0_IF_MODE register in two stages, first in
    phylink .mac_config (which incorrectly cleared out a bunch of stuff),
    then we update the speed and duplex to the correct values in
    phylink .mac_link_up.
    
    Judging by the code (not tested), it looks like maybe loopback mode was
    broken, since this is one of the settings in PM0_IF_MODE which is
    incorrectly cleared.
    
    Fixes: c76a97218dcb ("net: enetc: force the RGMII speed and duplex instead of operating in inband mode")
    Reported-by: Pavel Machek (CIP) <pavel@xxxxxxx>
    Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index 68133563a40c..716b396bf094 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
@@ -504,8 +504,7 @@ static void enetc_mac_config(struct enetc_hw *hw, phy_interface_t phy_mode)
 
 	if (phy_interface_mode_is_rgmii(phy_mode)) {
 		val = enetc_port_rd(hw, ENETC_PM0_IF_MODE);
-		val &= ~ENETC_PM0_IFM_EN_AUTO;
-		val &= ENETC_PM0_IFM_IFMODE_MASK;
+		val &= ~(ENETC_PM0_IFM_EN_AUTO | ENETC_PM0_IFM_IFMODE_MASK);
 		val |= ENETC_PM0_IFM_IFMODE_GMII | ENETC_PM0_IFM_RG;
 		enetc_port_wr(hw, ENETC_PM0_IF_MODE, val);
 	}



[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