From patchwork Tue Jan 14 16:47:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13938970 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2065.outbound.protection.outlook.com [40.107.247.65]) (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 6B66C23245F; Tue, 14 Jan 2025 16:47:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873268; cv=fail; b=N88HTPPu1SV4bMRPsnnhAeOhSHkKXbVUZfJ+hRvkj6/Br6GRn9WOMpsdFTaPIeRfGVOcidyG0seXtztRxHVzLFFu+BXgBQK6P3+VqIfrUoRi98y34NhztdsUdb7B76aRrqa+GlnHKIuBkBv3n1BF6mXSOLpyWk2ol342GfssKAo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873268; c=relaxed/simple; bh=Ideg3GKQTxywHaEATnmJXotK3Xmb1PJ/b3FEHkW56w8=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=hAO9hv+q0vmeELpyWn+YL9yvKY9JYcFX4Iz9mf9LYkwEaXK/xX2zRCjvijPMhbf8Jf97ZnDJMWQGl5kFkz6VP4myr4HlzQ6gfpv3plpOmHJfdUQSj8/OrROVRzCWBrOZtpbcQRN57vMNqckk1uJV30kZJhxAqXxSctuIKjvBLYw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=O4yKsZo3; arc=fail smtp.client-ip=40.107.247.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="O4yKsZo3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mhoMz42c33++G6nnqsGIopuwgFF4nWVyHJGQym+omCyYOKWbHFvIEUn0WDkm48cg5DDl3epZ5+4/DdL6jGtfGcbRc7qzMYA6Vl0UPuwoxx3xnc7UvZfSFvjfto7Q9PGe9i241uwHZgBoK3JKAy7e+GEBTGvhlPh+MylCNfdT9Q5jqSFiaZV3cvU31uqscdBcuZ4YMrz+JeF97AxpaR5kS96s/Ocuzb2um6ksYwk1U4qY86Qj8n2sckQesGoGTlAO9h8CxIxhAyACTYEk2/KWlGi6YKrE56ORWiUPsgbcuIXOmugGvGnrOMKYvRZmQgAdpeztELQK5Kze6tnLjOjuZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RcETxrsdQZdZmRlN8+aEk5wgm4Y7acius+plmrO5lQw=; b=LVKR9MDZWJ+K/ZvUZghsYIPoey8dtuzHOAGo6/66PfS6T7oDNpG4UEPAUaIK+Kh4f8JpRT6B0rc/wwmIlA7+iJTpIZtpr9lWLddyjQIWbPFKi4jas9kDlQpRgzQ5Knr6zeizF2fVms/4fVcPODYnL7ks3zFTMk3JgjObaUF456xX20n7zepdv2G3k44kNiMZGhFtwaNf5HMnccb++4AlIwDIdYSsM6diMVtK6dakZe/+yNwWRyFVoKqXl75hZkJvqO2t046R9ac/zZrtIryBoJjb6Mc2JGX5vrNMOXiU1cLIkKDvxUKt3JIbbpQDLBTJ1b2qQbE8kVfjqSxajBJT9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RcETxrsdQZdZmRlN8+aEk5wgm4Y7acius+plmrO5lQw=; b=O4yKsZo3f1r9aWbHngosrl/mFy3MNlqvYlXGgYs+n3M71uE67k3/4zjGqDr6rI80pQw8O5QsYdIEx5sOxYZtiJlGXslnZBH/BIpmBFJo2te5k4TVcDbvEYJO2O9xEHySiLhn1VZ+ui3h1jDRtGPIHxmGcqlnQvb+Tc4CSRnUWnsXOUf6UX/w5kBCtQqIX9U4cjGWVEmnxMwkmQX08ofWmtN1uOpVFNduwp+AEpLtM3B0itrbUC4RDBctMbscbiQ3BGqhhc1NILfi65Ju8fND+nV6q4e6R/XqwzJrpx6/CxYTeKyyp1Yc7pSkRSlK4m3h/IWqfgjS7e2Kff2EXkHmFA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) by AS8PR04MB9205.eurprd04.prod.outlook.com (2603:10a6:20b:44c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan 2025 16:47:44 +0000 Received: from AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2]) by AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2%6]) with mapi id 15.20.8356.010; Tue, 14 Jan 2025 16:47:43 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Jose Abreu , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Russell King (Oracle)" , Voon Weifeng , Michael Sit Wei Hong , linux-kernel@vger.kernel.org Subject: [PATCH net 1/2] net: pcs: xpcs: fix DW_VR_MII_DIG_CTRL1_2G5_EN bit being set for 1G SGMII w/o inband Date: Tue, 14 Jan 2025 18:47:20 +0200 Message-Id: <20250114164721.2879380-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM4PR07CA0024.eurprd07.prod.outlook.com (2603:10a6:205:1::37) To AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8PR04MB7779:EE_|AS8PR04MB9205:EE_ X-MS-Office365-Filtering-Correlation-Id: edbb0d00-6899-4472-d69e-08dd34bb2ab0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|7416014|38350700014; X-Microsoft-Antispam-Message-Info: u5HCRXBWAJUWularQt1QwXHSt0hQX7uQZVzQhC2BUblOwvH0qZ4u7qfAwHNuk7aYYUFzvadSGAbEGg2K/RQkoegQ63yuphYQEifuQz2P37AkyGxhRwjV79u9JAUfE0dkzR+jY3tZJJjSiaqYRjaXpfTfVdEuW50Tqd5nb8w7iyeCI4Y+zKKbjLOwUJN+rDUl6EWC8cUsxQ0dcqJk0KTNtK7VsLdNJu8N55X6PFYmMRrTbdBkmBG0gOFb96MspGQqgfm79T84keXxyp6uKpVRSH5g9NPcPT6WuSwu7KgCAJc8O69c6fEi6psKT6vmqXuplanX52Tk0Zei1PsJkl2VxxDbvJJjsl+huQz5E3G3t0dktXR7CWRXa/R2837ENMDC9J5o4cJ2kUk4H0v6dOn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Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR04MB7779.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: W1uqR3GJDP8Or0wT7EfY8XlCBHIKY3vMDQOHEFMkf6rY52BspsM/9i3zSL62kIDBmnDh8xHNiLqzgzmmxUV4PV1QKVFaBjHRshBidoxr0gFB8lidRoSHaFXAsBhnWBgue+k0patFLK79HdJQrpzHwbaW0ktrexBEoUS+sLY/Qa+ZZV5U45IDBLd2CJbckDQnKtRl0/UfTIm54UaHEnCm0u6InbKXTNPLshwy0rrGRp0JRBJyx5N1d778LmMA1hQNYRQyaekoy/EYawJyVMN8l83qrzATVLTtAOKUcWiQoq93PpCj5+riLC/2J1CeLDS+MemmLuDaUW6zwke4vSpCtAK8SUBs7KA+O/Lclb9gCKFpL4gtNf3oohZZFifwIb8OfeDMzwakCQpKBoxW1mDb4K9/vqoessnHM++RKr2NWP2bDI4vz2STxcI6L2sFryoUbAmnTKRn09ylwoa+rcLh6aNoAttoT/d0M7rMwxx17yDDXHa0rMePwXQ+cdth2moAL2Qtab+wEtz3+39KHyRzWQMa78nT3SOsieXucNZMHcYkONbO5V67kKWGGsw7TvF2QIp7xtDjiPbBOrQnPcY4LbGOcXs4Io/wBeeOgEdUT/XUFD+rtC2ozJATHtqfL/I8wUCcsjYvWJAA7ug3V2flSYpM/f92bSDg4L8f2EGRnsL9P6L1l0Jv73oIcpoQbLg0UqzoePgEg9Dmp3CShw8IDtzxdw1zEy1neC8Vg+PmqG8ld5fpxqqgUmgEQkZCE7azWPdi0yA/IPFK9Rm9dHZcF3snhWIzR0XIFaaXovLGohXYWjjBbBzBFjKFB/52S7ezUpfThN/XBy0bg0yUgAxv7XdeSW5MFZKKb38nHr3eqaactywYc8s2XSvrB3IhYXE2qzAL3j4fLY6W9Qc827AlB7HnhtM2Ird/XHij8vBkmG7mSDYHWvHhRizKlYBX6q6H5jINWZ59Ss5g4Mg81/kcSGFDaY316svFWusewtSXavn3SgWH4wdRkbMGBUEWEwTIezOdR4i3I8t6WAqouC3UWnIgx/ZVslSM6GfU5mWJ2bx/OKONKNGVzisQEJQh0s3f8CAFoOg4X7iuzp0xFdaFpkjkGDN/WcoAfE5iUMCnU+EZyANmEU+C7hSfTfJbtFGvuZr15+9NkHyNASk1N55IxzWN6fwYrg+nmam+toZOUnRDYSDx2hs/eA+8B7bQM+gZVtOW10JC1zNhtFFhyGLKNnMvZxpwSqJ8T3XtcZ+iBGFrrzADlP6ZQw+Blkm+COuYZ7sDN3yKts6gxbZrnXPocLEuJuSUFiZ+Uhw+yuTTEm50MyEzUYLyiMbbM81JkguhZvAvEb66v4shBhKlcE95yGOosoeTDOb9LVvnONtYwMgzvlhRi9lr3WQGhtevLsF2SeWZGiLax7Z1BsRm7Xnp5eKrblY0Tjpcsve9BFn8qN2po0g4Sfv7MCTVnlJatqZG896aOO21yIs3OJhj9BA6PDDES67KJP0l3+nyD8Aarz3BSihELDDYhnPYw6wzJu2LqucfQX7UcNCE9d+BqxpdbDLbBJO3lDPqFM4It/Z5VgfkdOJSZLhyWG8vVhsld5cnd+3s+VWsdxuO8uFB/28o6g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: edbb0d00-6899-4472-d69e-08dd34bb2ab0 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7779.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 16:47:43.9006 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: o5GA3wnKgf3zf1acsM/D6tDl1mjzF2YhuQzyaaq0X2NUojpIUBuLD2RnH0SAZjevUc2Qz4s/WfRPDGQx3wWBpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9205 X-Patchwork-Delegate: kuba@kernel.org On a port with SGMII fixed-link at SPEED_1000, DW_VR_MII_DIG_CTRL1 gets set to 0x2404. This is incorrect, because bit 2 (DW_VR_MII_DIG_CTRL1_2G5_EN) is set. It comes from the previous write to DW_VR_MII_AN_CTRL, because the "val" variable is reused and is dirty. Actually, its value is 0x4, aka FIELD_PREP(DW_VR_MII_PCS_MODE_MASK, DW_VR_MII_PCS_MODE_C37_SGMII). Resolve the issue by clearing "val" to 0 when writing to a new register. After the fix, the register value is 0x2400. Prior to the blamed commit, when the read-modify-write was open-coded, the code saved the content of the DW_VR_MII_DIG_CTRL1 register in the "ret" variable. Fixes: ce8d6081fcf4 ("net: pcs: xpcs: add _modify() accessors") Signed-off-by: Vladimir Oltean Reviewed-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) --- drivers/net/pcs/pcs-xpcs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index e270a75a988c..3de0a25a1eca 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -728,6 +728,7 @@ static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, if (ret < 0) return ret; + val = 0; mask = DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW; if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) val = DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW; From patchwork Tue Jan 14 16:47:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13938971 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2065.outbound.protection.outlook.com [40.107.247.65]) (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 B4F4C1B2180; Tue, 14 Jan 2025 16:47:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873270; cv=fail; b=kqRwNY1Mc2wrj72ZjP9rDXfchyDhdBVBMYcMLpTR0bKr2XEJWB1jWW3boB3gIMIGUugcV9XUgXfkYfQ76g1W/l0u6860ZVHa71L0bBnoaDzkltka5DgKiJN2GxvqsaE0crPpqf3k0YFP49Jm76wO/yWLmJnTUxPhxWjU+A/7eeI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873270; c=relaxed/simple; bh=9ATifKY/tAmH83o0EUtlVDvnXXNKt4Uq/qjawXHTih0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hFM9Goi14jkJNRJBNd52qOkcrVFHhmMFO3Cx8F/4nDVZkZodnBS4TC+GM/cFHIQI3/dX5AijmiQkt59XdhP874lrr3qpbxgkw6S1XmDlX2ra3EwUsBL86yxth+VNTMilTiBzvenc5yP4W92cMAmJgRdwgqKl8MjZzX3pXwp8A8g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=KYJ6oY8M; arc=fail smtp.client-ip=40.107.247.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="KYJ6oY8M" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IUb++dPCn9s0Nvsdeon7X+HcXLWlFRzC5qu9AwniVSJTupbKbCmPpf+Un+Tznl5LB+SM5rqe8XWPfwu/TGEhpfSveJgbFuo30KFGt/QBZ5Xf8tLaBnmvFXorOSoakDvKBMZ5TcvaBuWxpnt1NuKCHQeZ4Xvxt090Mv1lIRJAouoBKlxDblwrzHUxxYd0l+rAHZ3alijdAyBEkDe/RJYIdCI4nwhuYRnr06AQFG/7qwomMirVbgohL2gULvmh6+OQis66uAz7+oLY0sWOcOLE5DrWhis1YDa5Cm8Z8ZD03hvjeL/6tO5kPTo6+7mq16QDA5xm/GB1P77NUWJhZJHIQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KAFDw/yjBwZN+1TiS0+ytoXf78smzHP0i2X8OhZxhaE=; b=Ru/trASFDhHDc3UWW5vNOe1AfBy3RH9/HKGwtyzHE+9pUE7JCTcXpn0vNoCPe1H45EpprBqQUKJVRske/83f8P1csAl2kbVYABMRDUQqwIXRcB7odwTehqI7xMyHp5aJd1S1f4jfNwY7gkSU8FfuE3kg/xnJ960DFqvFbOYHs4wPz+vFCfwYIyzllZL4E4+tGCyNPYLxBglDv+xqygQK8BLoY+TH1H7IcFwwM9y4zYQE12l+YIQC50ShhRhqtsEjTmZLJ0ELpThpnL1wTrRQDFm96I3R+Wa7HPyTrnZcGTvvP9hSoLD6n2YsxmaW0Q6tglYg2IbOzfh5LmBp0yWm1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KAFDw/yjBwZN+1TiS0+ytoXf78smzHP0i2X8OhZxhaE=; b=KYJ6oY8M7HOavPih/3HFesRr8oHRpXIjYB8eCWFPIkz4n6G0UhkJq2EKEh53pCfaBuCYvTH6EAINOGj38rq0z4EW0O2YPcvcEkEmp8d6/VNs4jTzsteIabhKTikZqsq8PZ4gnpr9/sXRB56wtheH/25CUIszJcgnuHQUkaT2+30pR0CZyiB+ShEKBN0PeCGg33q0twHhjnvMlSZtmTIeTr3JdmWOV60J5fzUEiucrU07EabErYdU7oS41B9AyA0Rg+JXNerDNZIbssQnhvZbXrET5w6pQ7EZNIgxuH1fLCb1C3Jcr1Ap4zPl9ceXlHvuJexLk5tiphXSdIh0gFzYzw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) by AS8PR04MB9205.eurprd04.prod.outlook.com (2603:10a6:20b:44c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan 2025 16:47:44 +0000 Received: from AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2]) by AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2%6]) with mapi id 15.20.8356.010; Tue, 14 Jan 2025 16:47:44 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Jose Abreu , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Russell King (Oracle)" , Voon Weifeng , Michael Sit Wei Hong , linux-kernel@vger.kernel.org Subject: [PATCH net 2/2] net: pcs: xpcs: actively unset DW_VR_MII_DIG_CTRL1_2G5_EN for 1G SGMII Date: Tue, 14 Jan 2025 18:47:21 +0200 Message-Id: <20250114164721.2879380-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250114164721.2879380-1-vladimir.oltean@nxp.com> References: <20250114164721.2879380-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM4PR07CA0024.eurprd07.prod.outlook.com (2603:10a6:205:1::37) To AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8PR04MB7779:EE_|AS8PR04MB9205:EE_ X-MS-Office365-Filtering-Correlation-Id: dd11c351-30d6-4a9f-2cd7-08dd34bb2b4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|7416014|38350700014; X-Microsoft-Antispam-Message-Info: bX0qqBcO1agvumef52QdsxCWmFR6Y6ZY3k/wR0BEUY109DBI/p6LG1/lobzUgkBw1iV4HfDNGRncmvYcsdYwZpfvcXGZVDMIed8jrWVXCGpDkPQSZVm00XiH0nIi3ffxtX0DR8VXR7JCvZ7Acvj7/z8C/AVyr/Z8FeQTnFdnlfVqtx0KSm9UhGgKMkywVj/EcBK5dKZh/PaHI13bh31ch4u4/Tj6npd9ijk+hDKLIeeld9gZM4NJsAPfOa2mKSnDlts50YyzEqAGJfr5At3AsM90IvcYzOer0c4KTqEuOfPEdbFCOupQs5hDRP2VWrSbC2FG6evTewHAQQADeQoxf199ANVcwA507z1x7K9/TW+fEl+Cswz2QDAN4R4k2dVJ1bqIje9Vc1F9c3u685xlMxrmhHvdR860RewurjHgUohn6zoPSa9kP+rzQyxFW7PwMerBe4j0aJONxo28Vt5LhILEhz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NSPM;H:AM8PR04MB7779.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WX+sd0n1ERVtVmx9CPKxEFHKRq6MJ5BN1Dg2TjVu08vP2JE8+UjtQENgxRAAx8Fnax5f4w4EE0bQ2L8pN3IT+76w9YNFdOWeSQXsQe62VUSSN5IKaFCauu4lqILptgDWqjuTH/iHS41aecd5vtdTJ8CRvaQmYhmmAyVjkxJ/m5jBO/EyXVmgbbF+nqzYjiz4zMWQcHgclCY5HI6+L8h87lR+fuQ4GwsbwIdn5/Cb2++mufv/tY+9dzd1x/y9tzLXi+0AoZTJsOsslRYjRVNFyTueDc/tFL7pNoU0KGjKNCSWKSpBGvH9TpYtqWv+AabumyrNd5gu4cSRw0ksLMNpw5KpoH7v591kdl2ul5lpeCXEqN5Pivb8h+mFlyEssKD4CRoTmw0MoZxS4Jx5dVcGFEg8CUIxGkK9gjRhHs8flh1ERZRd3t4UaLIOTHCKqv72eiMlfMWyuyYpS++JscRLuqnnSlvv6MGrgktw99HweCwWDvEmGHaFZ+ItIPAZpSVfOWE/5ClD5xBbM2+b3eSmrif4HPW3mnYmkopiff84PAGszbSSVb6wKkkVxdD6WiHsI6C8E0pK14FTVKx6DsjbNjwI2ckPfYQhSE13bw+Xq5X5aR2QYmwfPv8zSvs4RXC8iImcp2RlmAg+QG0kjr2LsZevEEzLwiVAaqK2d+IzpzK30Y0Bc15CjfH99B/vWUedWI918qWehNxEQIRpFg74/f+2hG8rFjgSGvfA1qbveXEgxLYdNqUmSDJHVxh5Iou1kceB+9gwGnit2mgo2iGO3hL3N8geKMI4OSl6oDl+gmBH1oGTYuuI5e/mlH+763mZyHZEQspZ21iBB5b4r0KWg+ToeO04gLVS70qtSCU9F++dAQbSgTOaegypHrld9xKRCJByvRzmwzpxpwkXkHPWAQBvLoPsSNpWA5PMYOAT/q5vj/CSUVU1UBBZWm23xbM5wkJ+LPhFtLIwoGsR0Y+Gt3LMbHIfOZXZ3eBN/dEMd4KKhzFaVF+LDwrctfPIH5LDMGlyha6qSSyHgylDgKPe68nHlbZkusqoTjnF4+h2zgZOtEVhe6SRatZrOQjyZUaKyigmoRxQ3cX+s4IWeS4tZ094TtztCPziRWQWqYP4Kv8PkqBbhlzLHlhQvUtWnL9PkDe1f88AkjQLxLECc22LxoCDyAA60/QWClrO/Rtbk66s4ICGi4mrKc+2KJa7cyHHgqa9Jw2n+26QVy3z1iTJrmmccgFF8iMOO2cmHe37T7PD6NkL+idfZwQmUE+/Pcn0n8uE8WLxqK+OJDxvVbd+1iPdoxWlZGuYeH2ahGQFBGsktDoquz88ToepI0ZCPheqXn8rBxWfDGXpBXmHzpqpoXBqWNUP2kvI3u8Cs/3PAwb5EHjb+NtGybyo0vTeeMOdHAZvh7W7mc7CtJHdDsTAn9ktEnQrZsNLpYI2P62O4/jG+6wyWuwxNIjJEaiWmqtHOeNpwfOGt8QgfB78ZgXkVWnHNmthjo3oISJcdKV85Fyd3txiTCFILjAoiq6uMd5RNpYh8KGRuawnyCR+E59TYWZH2trUNTX7hJm7kFlnaMJJK72ePeaMoJBDWZckaRBr0Un6DjaKbpxtapzunikuog== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd11c351-30d6-4a9f-2cd7-08dd34bb2b4e X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7779.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 16:47:44.8047 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oHit+06l3GYCH7nB/qMFZGInSyELJFNSU8YgVKKbaTeQ+6e5IeruGDSdP538fNijTIFSV0fWsdhLJBGuzSyfhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9205 X-Patchwork-Delegate: kuba@kernel.org xpcs_config_2500basex() sets DW_VR_MII_DIG_CTRL1_2G5_EN, but xpcs_config_aneg_c37_sgmii() never unsets it. So, on a protocol change from 2500base-x to sgmii, the DW_VR_MII_DIG_CTRL1_2G5_EN bit will remain set. Fixes: f27abde3042a ("net: pcs: add 2500BASEX support for Intel mGbE controller") Signed-off-by: Vladimir Oltean Reviewed-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) --- drivers/net/pcs/pcs-xpcs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 3de0a25a1eca..2e2cc6153fdb 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -729,7 +729,8 @@ static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, return ret; val = 0; - mask = DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW; + mask = DW_VR_MII_DIG_CTRL1_2G5_EN | DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW; + if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) val = DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW;