Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7242671rwl; Fri, 30 Dec 2022 05:52:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXt4g8zCUN5re+qnRFMbimfAG5ZBWe+E/YMKDesQA18ZxQ2UJulog9AOe2k6D/VlvIEPBv26 X-Received: by 2002:a17:906:6b8c:b0:841:df6e:a32e with SMTP id l12-20020a1709066b8c00b00841df6ea32emr35992108ejr.25.1672408323818; Fri, 30 Dec 2022 05:52:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672408323; cv=pass; d=google.com; s=arc-20160816; b=U9FpBaO1jM3oRtFP+ZSPg38Fy19okJaPBdgf6xECXhaCuhst46ggvg+Gww+87tmX5+ MQA1ksbCQJLMfqmJy2ylQrtf6btJX0pGQRi3ePdyfmWB0gPELC1U+Ds4EywyQqt3bmyX qL018fYGfabRH7oy/JTbitgv/Go5rlffXzDmIAHkrQ6zmSeZ3vtDlRO/skRaHdEaU1z/ zYiJpiIjFCgk14/P+PMAjDiRvD2ZRR+CKbmIynE23rBILaK3B0nDl4aqlzWA2oCOpcpw 8jz/hp8bffAOxupqPVCDRKodmXiLaH7PPAMINb+xXCqNjiDJu3NPnqyuo9QtF3kNQnaD 5e4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Mg1qbM58YgDsuDsdehYFajKEy2Unq6coY9Q3S5vctv0=; b=M1l0t7OD0hjCRvqsmKtLiHCLHJr/XNc1Oez4R4NGA6Ske1HHPgHNrHf4V2IZqpaGte i6g3z77VxDo2Sx3CGkDfDYhq4/Gc+ll2fAUks+524nvxaPrlMl4FOR4Nl6vPTNDAHX72 oDFtQhNiKTKKE6PiDzoxW1b7VFShTtnnVFUl9bacZO3RBeiIoquFCzVOWOukfj/3iIVw e7c+z0ROg7aXfGGue/2lTr1PzVuavBoYELIYG89ejfZlw6ruDcuMD4ir2NALVeAnnYs7 xD2MQkOcnUOtq6RQTq7CHv4aG2TrUbL7BPvo6M27JUo8W9MwWorSsYcSFGvD8QaUHQnY yKvg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=XQ5xmb7m; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn21-20020a17090794d500b007c4f6870a9fsi19847208ejc.554.2022.12.30.05.51.48; Fri, 30 Dec 2022 05:52:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=XQ5xmb7m; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234957AbiL3Ncf (ORCPT + 64 others); Fri, 30 Dec 2022 08:32:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiL3Ncd (ORCPT ); Fri, 30 Dec 2022 08:32:33 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2055.outbound.protection.outlook.com [40.107.6.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30471193E5; Fri, 30 Dec 2022 05:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MJjfTBZigwJQx1ZyCQFIDAoa8Rm3dHPLiqfEkxvhZZOK+1VODfjinXy4VMnP3XCEw+Vak/fLNUOcdQ5D758tDIa5hQBpSp7CmSYMKBhFFXMzxbS33alqZtHYh3RWWvLFOPcwP1Zg94pOKeAVTJ5LW4sPhl5AGYBhUETHaa4GT0jH3YVv+XTyyPf3Mx6DkI4x2uYFVDkRLFFjDgay8BmRTNwGcQu3lpNT+hpr73mTPQ6Yfm+OzX0lM1aBCegHc/2P8qq/fz/SIpqB70KHathYxeJcw0nGh3CLL8QH+mcPdM1K0sv5dLRNcyBA/Js/MwtenkwlSotrfxa7qGirpTsfQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Mg1qbM58YgDsuDsdehYFajKEy2Unq6coY9Q3S5vctv0=; b=bZk5WZn2ApXi1Yan2OFo2JsLpZxWS3k9VOVohvjb0y/ldHzDedFXCVIdAyrntQz0QErc6kJoy6Tbwap/I2JMbHqVkVcgGTKklYqgkinUddGXYek5OgEAL+ODUn5c5q0cQH2vUOMp416E3bflO6KETXxNKEqiQ04DhnwcYQ6ZDnv5XPIPuoDFCwRpbuf5iw0XHm0zCZKEBTqGPrrsEXWp03W8aeW5NKSBp9z+rhSAQaRidCjP392kP6amr3wj/cLPng779LydZtZxJEf7mpntCwx3cCREBMQt9eIT7gPk2lWNWns7t6NGYfTfqiWVzu6Zy9JvJgaQUym/CIGUN5DTsQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mg1qbM58YgDsuDsdehYFajKEy2Unq6coY9Q3S5vctv0=; b=XQ5xmb7mvU/5VPDbo3BFAe9JuzF1D3mi7V2CC95wziezKAns6KUiiY7mIQM2eFitMAU2KNvZb0OIOLhob8E0N3ZjI0Wf15gMl07P6hdgP8gR5mxcorCP1bbuL/ZrVSD4STb9hC3EzAmvdX7bEJEmULYmM6myAn8CxKAAg9OWgIQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9055.eurprd04.prod.outlook.com (2603:10a6:150:1e::22) by AM8PR04MB7473.eurprd04.prod.outlook.com (2603:10a6:20b:1d0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Fri, 30 Dec 2022 13:32:29 +0000 Received: from GV1PR04MB9055.eurprd04.prod.outlook.com ([fe80::5863:1b8c:c11a:ad1b]) by GV1PR04MB9055.eurprd04.prod.outlook.com ([fe80::5863:1b8c:c11a:ad1b%6]) with mapi id 15.20.5944.016; Fri, 30 Dec 2022 13:32:29 +0000 Date: Fri, 30 Dec 2022 15:32:24 +0200 From: Ioana Ciornei To: Sean Anderson Cc: "David S . Miller" , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski , Eric Dumazet , Paolo Abeni Subject: Re: [PATCH net] net: dpaa2-mac: Get serdes only for backplane links Message-ID: <20221230101710.btdw227v62nnj3le@skbuf> References: <20221227230918.2440351-1-sean.anderson@seco.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221227230918.2440351-1-sean.anderson@seco.com> X-ClientProxiedBy: VI1PR09CA0083.eurprd09.prod.outlook.com (2603:10a6:802:29::27) To GV1PR04MB9055.eurprd04.prod.outlook.com (2603:10a6:150:1e::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9055:EE_|AM8PR04MB7473:EE_ X-MS-Office365-Filtering-Correlation-Id: 655fd58e-c278-4454-1874-08daea6a4c0c X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T2PcaSk7mqcUBAT4pFesY8nNt/dnEmkI/fLaj0wusamk0Ee1EbJILlY6xw30D7AC9rkf/70QWs/rvQ++b3iJP9rpn2l2i4I22Ebe++RMu4o8kmP2k7Yu5vSwbGVyEKUUcfdno1wtWoX793uHoY6S26bvtq+BFPTYMpxrvZyTRjfUdTUS87ySfMZ0x6qb1RmrEvLqzbMGOkFdovc4vWz/NX6PeIKDDfel9Cu7CoaO3AwQju6DGx6nlPcdu/Q/eyb6rvS6+Bs6gdp3G2NxbztjN1O11Y9iHdLK/59J1woC2Jqb9JPE1WucJRMdb9QyD1lgej4bVMBTDDvJBWVU1MmGu6CGSe3+rzxFzJclCkxJDOO/JbOa4WqgZ0nw7ot4wPtranx2gU9m/i0QR+S2D0sHJqafCDNnagJevZ0FxfIIckjggBSj//g0KP6wtxHDw7W1BhdXU5H+TSEZtfGPD9lKCmQrsurDCvWtK72yvt1ACK+pUNvbfeKrcD5X/SOAhV3TcMkhxJKdUhGZMhtx4qCOuW18kuZzGwX3lqcSYPhwbmEXIVF8F0pV9d/Y4EaPSTDM6L2COo6/7AonywFNs3SJa2DTbpJCUFQoHuArcr8Fhta48vGLVs84d0o0613QEXY+cIvcumOoBHwuUq6HCiQ2UKQE72PdLdA/6gcOgqAHfS0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9055.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(4636009)(136003)(346002)(376002)(39860400002)(366004)(396003)(451199015)(6486002)(966005)(478600001)(316002)(186003)(2906002)(54906003)(6916009)(33716001)(6506007)(83380400001)(38100700002)(6666004)(86362001)(1076003)(6512007)(66946007)(9686003)(4326008)(26005)(8936002)(66556008)(66476007)(5660300002)(8676002)(44832011)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2jz7N+b++05iA1PFVhjHb/c4O+vaKTiR/xLNizG4bMiXy9DrXUK6BktCb2Pa?= =?us-ascii?Q?v7YIuer0db1z9z2IAbVc0P/TXjGQnScDHDL3BRYhPBoYpgi8r4xI7zCW4c+a?= =?us-ascii?Q?qCizALHVBeSvnmSSsvcs6Yik5H5Vd97JWUXHI8qsK+rDv/Ewb0ERDRdmU4+v?= =?us-ascii?Q?iAeALLE0IwbrTbmNAsjvzBzIvrk/lXNd8BgcgroY3Oq6eP9/JF2of01TnNCy?= =?us-ascii?Q?U1uMAgA8G3fkyUDI3J5W79/KrOhmxdF+aB56IxquJssJVBCRm66UCQLkH6Z8?= =?us-ascii?Q?pfhAaKS0VyflGeD7PfNdU2vTmHuZztTcXqSPMfeZLn+JaFS6ZzM0SCUlTK0M?= =?us-ascii?Q?b17q8lEyHvA6MI1zY7W8C2XbaeiOaIBcy/gVhVURC80WiA7TU/2lqodCMopH?= =?us-ascii?Q?uYUcywAYU0EaO6nvWlOH6AAIbFDbRgAxXpy4zXfNuF6zKbnR0T9siHrHhxEG?= =?us-ascii?Q?VBBTDCHb+eQowSv26VWzGYjuuJSH0tK8oFKXgc36X5awjsUlZp82oQlFp/ZW?= =?us-ascii?Q?IF4dMNstYrSk2Yllda+5gOiIXz5dY5nqR2NCpGMOXZwiSp/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xQplVMZB0PN1EGGlIygLYC9nVryf3hVB3jv6RM1/HtcbUmu5b?= =?us-ascii?Q?SD5KjXKzmmnzZUuubcYvvKymyT2jU77/oK4InRgV8xm90YZirr6MIMba6lD2?= =?us-ascii?Q?qf5FjIKR6ZjUllgPChz+eVhHnd6u/bHNC2L4R9gs?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 655fd58e-c278-4454-1874-08daea6a4c0c X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9055.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2022 13:32:29.7313 (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: MchzOg+cJH1fPxcKyHhOPJkeOv5w6kHbgrt1+yADyONVWXrnCDPVRdM23OuT4L93MnHLOVaqFePSsxlbmAH6mA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7473 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean, On Tue, Dec 27, 2022 at 06:09:18PM -0500, Sean Anderson wrote: > When commenting on what would become commit 085f1776fa03 ("net: dpaa2-mac: > add backplane link mode support"), Ioana Ciornei said [1]: > > > ...DPMACs in TYPE_BACKPLANE can have both their PCS and SerDes managed > > by Linux (since the firmware is not touching these). That being said, > > DPMACs in TYPE_PHY (the type that is already supported in dpaa2-mac) can > > also have their PCS managed by Linux (no interraction from the > > firmware's part with the PCS, just the SerDes). > > This implies that Linux only manages the SerDes when the link type is > backplane. From my testing, the link fails to come up when the link type is > phy, but does come up when it is backplane. Modify the condition in > dpaa2_mac_connect to reflect this, moving the existing conditions to more > appropriate places. > What interface mode, firmware version etc are you testing on LS1088A? Are you using the SerDes phy driver? > [1] https://lore.kernel.org/netdev/20210120221900.i6esmk6uadgqpdtu@skbuf/ > > Fixes: f978fe85b8d1 ("dpaa2-mac: configure the SerDes phy on a protocol change") > Signed-off-by: Sean Anderson > --- > I tested this on an LS1088ARDB. I would appreciate if someone could > verify that this doesn't break anything for the LX2160A. I will test on a LX2160A but no sooner than next Tuesday. Sorry. > > drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c > index c886f33f8c6f..0693d3623a76 100644 > --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c > +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c > @@ -179,9 +179,13 @@ static void dpaa2_mac_config(struct phylink_config *config, unsigned int mode, > if (err) > netdev_err(mac->net_dev, "dpmac_set_protocol() = %d\n", err); > > - err = phy_set_mode_ext(mac->serdes_phy, PHY_MODE_ETHERNET, state->interface); > - if (err) > - netdev_err(mac->net_dev, "phy_set_mode_ext() = %d\n", err); > + if (!phy_interface_mode_is_rgmii(mode)) { > + err = phy_set_mode_ext(mac->serdes_phy, PHY_MODE_ETHERNET, > + state->interface); > + if (err) > + netdev_err(mac->net_dev, "phy_set_mode_ext() = %d\n", > + err); > + } > } This check is not necessary. Just above the snippet shown here is: if (!mac->serdes_phy) return; And the 'serdes_phy' is only setup if the interface mode is not a rgmii. if (mac->features & DPAA2_MAC_FEATURE_PROTOCOL_CHANGE && !phy_interface_mode_is_rgmii(mac->if_mode) && is_of_node(dpmac_node)) { serdes_phy = of_phy_get(to_of_node(dpmac_node), NULL); if (serdes_phy == ERR_PTR(-ENODEV)) serdes_phy = NULL; else if (IS_ERR(serdes_phy)) return PTR_ERR(serdes_phy); else phy_init(serdes_phy); } mac->serdes_phy = serdes_phy; > > static void dpaa2_mac_link_up(struct phylink_config *config, > @@ -317,7 +321,8 @@ static void dpaa2_mac_set_supported_interfaces(struct dpaa2_mac *mac) > } > } > > - if (!mac->serdes_phy) > + if (!(mac->features & !DPAA2_MAC_FEATURE_PROTOCOL_CHANGE) || > + !mac->serdes_phy) > return; > > /* In case we have access to the SerDes phy/lane, then ask the SerDes > @@ -377,8 +382,7 @@ int dpaa2_mac_connect(struct dpaa2_mac *mac) > return -EINVAL; > mac->if_mode = err; > > - if (mac->features & DPAA2_MAC_FEATURE_PROTOCOL_CHANGE && > - !phy_interface_mode_is_rgmii(mac->if_mode) && > + if (mac->attr.link_type == DPMAC_LINK_TYPE_BACKPLANE && > is_of_node(dpmac_node)) { > serdes_phy = of_phy_get(to_of_node(dpmac_node), NULL); > If the goal is to restrict the serdes_phy setup only if in _BACKPLANE mode, then why not just add another restriction here directly? What I mean is not to remove any checks from this if statement but rather add another one. And this would be the only change needed. Ioana