netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* enetc: fix bitfields, we are clearing wrong bits
@ 2021-03-21 16:25 Pavel Machek
  2021-03-21 17:44 ` Vladimir Oltean
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2021-03-21 16:25 UTC (permalink / raw)
  To: kernel list, Claudiu Manoil, David S. Miller, Jakub Kicinski,
	netdev

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

Bitfield manipulation in enetc_mac_config() looks wrong. Fix
it. Untested.

Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index 224fc37a6757..b85079493933 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
@@ -505,7 +505,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_IFMODE_MASK;
 		val |= ENETC_PM0_IFM_IFMODE_GMII | ENETC_PM0_IFM_RG;
 		enetc_port_wr(hw, ENETC_PM0_IF_MODE, val);
 	}

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-21 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-21 16:25 enetc: fix bitfields, we are clearing wrong bits Pavel Machek
2021-03-21 17:44 ` Vladimir Oltean
2021-03-21 17:49   ` Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).