Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2215502rdb; Tue, 3 Oct 2023 14:03:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5SG5WwI6W70Ehf4+2IPaFX4E8bx8DW7/kRSfdk0t9VIRNhB0SHub5RTAdWYQRYR6PTme7 X-Received: by 2002:a17:902:e74e:b0:1bc:3908:14d with SMTP id p14-20020a170902e74e00b001bc3908014dmr6521782plf.2.1696366995572; Tue, 03 Oct 2023 14:03:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696366995; cv=pass; d=google.com; s=arc-20160816; b=fR7q3t3M3A1dy3vo+tU+81V86s+dGQO3WRaoCc3E3k7OYN9Ro6CVJ4BFBGzULXV9ZY MiRjntHdWD8ezxC/xTG/BXzYKwKSmwmFy0oJ1m4nY6wE0Yy/9bfzZ8I60cW0l2UWAx4H smf7c+bcrSLjiFxWVxaRsFz9PyXAuOLRRLiCvZ3jqnFMCWdxQ/obzeSDqGC7RNxYAtDR OtDaVYPHMFnKewUeQJ4+d9JdKP19jWTx1wrSMIAaT/ObEevncWLEbf46L+O5TwQ+rGd0 C5Il/8/6D5ACr1q+RAB6yLqlB56weRWhwuW4Gq/nPiDuIuLIGOvHOtAqyy2xni8T0sgZ hAFQ== 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=64KRXe9lAEsvqO4h72TkhDPfpP0Ec9+Teo9EB5gp9U8=; fh=GexOBZ79NDopv4g+DK1/2zxiuFwrZZFyt4VIJ7oES70=; b=f4J/Z1Xz5CYXWiZmvH/LaZSmknq4kxfyvZHb726ChtEJxDHsQH1TfOVU7Nn21JFq2Q sd2VbepjUL2qY+Bti2syrfertPPeXSDbmv/C1IWJtnosQItw2uEJg8GHKjUNYFP6/9LU QkAewCK8vaFuNjLTd2W+Nd1JWRuL+CuKoX1YI9eSq0mHCZZo769yii9vDgGXGQRJsixO jyX6EWvJrmW3KRNBMqBTE0hJHQ9UisqEzjIa9AA46hRdb2VvPybvXRPLhgiaWyZr+O3w Ada8EszPxdr96EOuDxb8MqtWVEYlJH4o+nV6go4YG/AHkLu2F9eoBXVsTp+xrut5Zzeo 8WOw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=q9VKRsn6; 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 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j3-20020a170903028300b001b02e8d8976si2309863plr.300.2023.10.03.14.03.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 14:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=q9VKRsn6; 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 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2823A81B8033; Tue, 3 Oct 2023 14:03:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241091AbjJCVDO (ORCPT + 99 others); Tue, 3 Oct 2023 17:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241038AbjJCVDN (ORCPT ); Tue, 3 Oct 2023 17:03:13 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2046.outbound.protection.outlook.com [40.107.104.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D773AB; Tue, 3 Oct 2023 14:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AxV+02jPru9LFm2Yh+4Ijy0HrmKqGFTNjXjtfLTUlMB6Y/v60SBkBnZDUcA1+Qn1ThJN7U7LB9dn8qAsv9O8n+73dPl0I7fwmWSY+Xhd0qgeCoBDPPBCIBldvUl0Xi7TIEUVsRQf1BlpCe/mbkcz4LZ344O8xMWefNi4wCFcvsenb17afbLrddnof7D/snheV8cUWzPSj2oZV9k7LfhNDUCcZj1+1k31Pje6e5kD0Rk2Ydh6nfq04Al1PqcCoPpHWtmBP0VfD5SGAJpmUfWXRTCIS2Kzm0iBe2ggeMwLtdWHRAvoRghJiGx2I+9kEBnX7SHx5W3t6X144NF4FRtsGw== 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=64KRXe9lAEsvqO4h72TkhDPfpP0Ec9+Teo9EB5gp9U8=; b=hfDcbfJ1n7VGSIn5gSICdCNKpoQtrZCydOE9Se+90k95Dndisgcn1lDpEOGFaivNExymfet7Hx1vj2AapvKtXDvUMZoRloOeEok/L4EGb5q6FUEyJbSOVMgdscD0rOGh0sBae/nIWYMWsTHyllRJfYpetYIpEXwh5c1sHIGhSsw0KPSqjD6KcuLqrfHk9XPlfwxQgs2W4Q9UJc9fppCS0NoW2ZZlJIeSmgcyFfK1Sdkh0ppgNC8TEY8F4mUHK41NiAljZdEQ3MC1G9ucqx81bZb0Vb54LUQiWd3/SzxitXs2AV0i9eTcNOXxhvJEfGQWkd6nyenr+k+tYGITiHtofQ== 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=64KRXe9lAEsvqO4h72TkhDPfpP0Ec9+Teo9EB5gp9U8=; b=q9VKRsn6DRzKY3pE0mB8CyiZPGTZWUakb5GAhpziLLYq7I/XXrsi6VsbLe6tfc+P6Ir/FlTf81+HtqV0vBQmT7s3ez8kdILF00L5WqIHxSl6DEioScr1LjGWCi1W64STodAi1xTnwRRPgyks6vn+WIJn9rrOnHnG2tdF1LTzIew= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by DU0PR04MB9442.eurprd04.prod.outlook.com (2603:10a6:10:35a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.34; Tue, 3 Oct 2023 21:03:07 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::568a:57ee:35b5:e454]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::568a:57ee:35b5:e454%3]) with mapi id 15.20.6838.024; Tue, 3 Oct 2023 21:03:07 +0000 Date: Wed, 4 Oct 2023 00:03:02 +0300 From: Vladimir Oltean To: "Russell King (Oracle)" Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Heiner Kallweit , Andrew Lunn , Florian Fainelli , Madalin Bucur , Ioana Ciornei , Camelia Groza , Li Yang , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sean Anderson , Maxime Chevallier , Vinod Koul , Kishon Vijay Abraham I Subject: Re: [RFC PATCH v2 net-next 07/15] net: phylink: centralize phy_interface_mode_is_8023z() && phylink_autoneg_inband() checks Message-ID: <20231003210302.sxz6jmcs7t5jmcqz@skbuf> References: <20230923134904.3627402-1-vladimir.oltean@nxp.com> <20230923134904.3627402-8-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: AM0PR02CA0008.eurprd02.prod.outlook.com (2603:10a6:208:3e::21) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DU0PR04MB9442:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a0b560b-658b-4269-734f-08dbc454247e 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: bknmfz09as6TJkXstb8BEwbXqOaOM8JpU2ILcl5W9QtXApOqqFoSXdKUENpeOvgLBzmKJ9RnJG5sTqhuJpdyWIcEJlmYel3uIKq5p1VNT5wVo6RiL/srn74kfdoLx3Em9BYTyMxTip73/MK2dr/NKJGux9DZ/EppFni3FFZ3UkTkkzbC1ytmvpaKEBcyeC/vZaCOnJfh3XdkfbZtmSai5/3PXz7ptevoyhNDg5t00dGhlctqvTm9erKBOfIvJji49c9ytx7+xKcAIHwM7Cq6Zbsztmpy2bHP7xvm++eRbL7soyDKV9My1OI/LqggarYZyYUrceLFaBG1mGzgpll4X/z1S8+cXI53wFlk/reQbH3zuhQcrkTcauevZQkmIMRrWm5LSQqMXe4sKJ81aOxGR7qW49+VVwPdvMGriRbilbdOFnE6Myz2kZUYiDx1vE0m2SN2Vk7e6Vo61gJ+/UCedS431FQo3YMxjU1R1FLbOHVJho/PPZ04sWHll9QcMG5DPPcYYL4PWaBDYnch7+E28CVqZi/IHsUvI5Kd0EchE/NpztJrvki8iGvfj6P0zkQ/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(376002)(136003)(39860400002)(346002)(396003)(366004)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(478600001)(6506007)(6666004)(6486002)(6512007)(9686003)(1076003)(7416002)(83380400001)(316002)(41300700001)(6916009)(8676002)(5660300002)(44832011)(66476007)(66556008)(4326008)(8936002)(66946007)(54906003)(2906002)(33716001)(86362001)(38100700002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UlKYPLsub8ZAKMB5ILhjYMsx0KHaaNQt5NlveuArefdIn/Xak5Hr5mfs0Qls?= =?us-ascii?Q?vRX5SIkNzk52BSKZjEWXQoOV+tI2osMrVF4WmIKT3Agbd+NavuCB/tHKmuyi?= =?us-ascii?Q?PZdIFi7KC7Ww7qb4EL+Gk2GeWa7E6a62T1Oblw1NroFHojZpSJthYEx/C4d0?= =?us-ascii?Q?WCPA9KLxvszgcepz2JwuYLBxkjj7U3SeYF7q4pUTC8mFvtwskx8GEleD4hAe?= =?us-ascii?Q?cKEuRHQ4kzjHStcB0xagQralVDl7Lmkk57uBGBRiSuKK//VLbQ07EHDWP0/e?= =?us-ascii?Q?O5XZZWiSMfIWstk3H+L4I/1llmBrRwFei1b5ZWaiRcPWWQF8QrzHQZo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WADxhVM9GjM4N5a9V3nf7swlz?= =?us-ascii?Q?DwGmGgKxUifXZ2cQ7VNZHLYMx+4Octr2JkixdXzCsWgKRj8ZvIq4hs7d3NQZ?= =?us-ascii?Q?844/SwnE5G8E6YCOY+HxaWw230S3WQ0IGybtX7oEaU7qnAA1+lXII8z/ckgH?= =?us-ascii?Q?rLKP/cJ+X7SqZzssmvabdYHoxbTXBzLlkmz4x5AU7VCT84i6ivEj60QZr8uI?= =?us-ascii?Q?mHpd2y/6Lv+r4nyhsVUOM31+sTku6sD1OQrKwrSnwCblcTaF0duOc8sXzcC9?= =?us-ascii?Q?v8que06ToShHAPpwSSlO4gHwuCUWdjkdyl16QBEX/1J80xGrTuYMxOlBfeBL?= =?us-ascii?Q?O3LEfBj6J+czuLgmvX8drr8Z06r+i5XY+Zf77UEtukAUl51bZQftxUZ4Izwz?= =?us-ascii?Q?IQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a0b560b-658b-4269-734f-08dbc454247e X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2023 21:03:07.4556 (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: ePzfbjoo93wuAAbjOqZL7SFV6WdvBNOv+2crxQ4T1oBru1eHH+nTDJUJrYijuxyNy6W/A/MpNf5mYibb9ng22Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9442 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 14:03:14 -0700 (PDT) On Tue, Oct 03, 2023 at 12:27:56PM +0100, Russell King (Oracle) wrote: > On Sat, Sep 23, 2023 at 04:48:56PM +0300, Vladimir Oltean wrote: > > In a future change, we will extend the PHY interface modes for which > > phylink allows the PCS to handle autoneg. Group the existing occurences > > into a common phylink_pcs_handles_an(). > > I don't see anything wrong with this change, despite my comments on the > next patch. However, including INTERNAL in this may cause problems with > DSA. I think maybe these two patches need to be tested on DSA setups > that make use of INTERNAL. Prompted by your observation in a different comment, I've searched for PHY_INTERFACE_MODE_10GKR and found aqr107_read_status(), which sets phydev->interface to this value based on the MDIO_MMD_PHYXS : MDIO_PHYXS_VEND_IF_STATUS field. I am now of the opinion that phy_interface_t is a phylib-only property, more than anything else, and a slightly obsolete/hard to extend concept, at that. The selling point of phylink_pcs is the possibility to have an optional phylink PHY, so I wouldn't want to reinterpret phy-mode = "internal" and managed = "in-band-status" to mean "clause 73 autoneg in the phylink_pcs", because that would quickly clash with the phylib PHY's desire to see the phy-mode set to something else (it is definitely not "internal"). I don't have access to an AQR107 with firmware provisioning for KR on the system interface, but presuming the feature isn't entirely bogus, I shouldn't deliberately close the door for it. I am exploring the possibility of adding support for 'managed = "c73"' as another autoneg mode in phylink, among the existing MLO_AN_FIXED, MLO_AN_PHY and MLO_AN_INBAND. It is quite clear that MLO_AN_INBAND != MLO_AN_C73, because the former is the PCS doing the negotiation and the latter is a dedicated block selecting a technology-specific PCS. So I think there is room for this extra autoneg mode. I am also trying to see if there's anything hardwired into phylink to require a phy-mode when a phylib PHY is absent. I will find that out in the following days, while working on the v3. I guess for optical SFPs, it just made sense to reuse the same data structures, to present MAC drivers the same kind of API as for SFP modules with PHYs. But with C73 autoneg, I don't think it makes as much sense. If phylink can be made to not require a phy-mode, I would prefer to pass PHY_INTERFACE_MODE_NA, and for it to be completely ignored for MLO_AN_C73, both in phylink and in phylink-using drivers.