Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp948281rwb; Thu, 10 Nov 2022 09:14:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM6EranHuscw5ubCJ92FEFQK9Z5p3FknV9zeVplheHkqYYfH9RKafj9p3XQgmVwDgGc2G0ZX X-Received: by 2002:a17:90a:1b83:b0:212:20f6:ca94 with SMTP id w3-20020a17090a1b8300b0021220f6ca94mr1513413pjc.117.1668100458713; Thu, 10 Nov 2022 09:14:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668100458; cv=pass; d=google.com; s=arc-20160816; b=eAsD/r0xhEg0VB4ErXPchOp5MCGFf1yVXszgpy1AAVRkMtURRDY+jvFrV5GhMlWjGO wKf3mwr3TBYP/ZTGGlL6Iinqne7n/uk3csPWn9Xxn7nUwliaBY5vyuchFWEqoy58qM01 bn9N0irnRHLeCKbZooLHO8LgEl3HoYVa1sTLgZ4M5t5+ps4H+HPzZK7GZ195/qKTzDJN 1QZh/P1DzyqDHWboXNzRYrPMu+q9Tdm0O1U0Ak7ZTFx6tRb1QyrVUb5sgF4CIoYfxyfq J3/sBv4lQ1g28O3pDxU8RZkrZlWg0sZPTI3Twb/jW8ZxcqppFRRtF60t/t6maxIH+/E5 3bTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=/8Hz+Bk9EQflfkT2+GO5wfHftgoEuT8PjxVbwU7V35M=; b=l6yhktQlSafG0efsdhoRcLjOS2mgXx0ANIlHw+4LRnWvGF7rw2ROtHe/49f1eVlTa2 x0VLzHP0i7mZn39iy8l5oHtNDbbaowcv2vWezMnPjYDlWM7AcA6ALKwBIoxFB6TPc/nJ j5gKkmwJS0e9vmKAg4P8ZxQUrOputbS/GSVP2DVCfdekQ194QsMgH8oabQqKKjX+beJj HDequ5f3V9zldy+02/zOl9dg3NOqH0B19pbcudf2W078GHxctWAqCrm/CEVIOJqCt2/S WlpKkBSCSguGjJTu7yIVxjJh75hnjKoeGC0U+YEl8OQquRlNnIce7iAemmm5Mv8GjL/A BZIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=Hj13Mswt; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.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=REJECT sp=REJECT dis=NONE) header.from=seco.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc9-20020a17090b3b8900b00213353d1107si87867pjb.172.2022.11.10.09.14.05; Thu, 10 Nov 2022 09:14:18 -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=@seco.com header.s=selector1 header.b=Hj13Mswt; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.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=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232496AbiKJQ4e (ORCPT + 92 others); Thu, 10 Nov 2022 11:56:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232367AbiKJQ40 (ORCPT ); Thu, 10 Nov 2022 11:56:26 -0500 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2073.outbound.protection.outlook.com [40.107.247.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA0A1903F; Thu, 10 Nov 2022 08:56:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IZAdxyPT8xgGmeBbPcleOP/e75U38/yluiseyc5ZvQJoNCjXaOkoGGSjasviLzwVrCxHa+xSKbXjNc3niTl3f6ZM1vKcbSg272pv3sv/adRsOxIFbQ0kRHeGNPiQ6tdG6X0ck+5R1bSBJCyArlx2lIwwSzozkhpasMftzhiCNd9IJhQkjegHJjzTXDxoy++9CI69WVqueUzdREUZF/RdQXRlxaKJpDlcLWQhzZvAzffmdFPzTqFSR84qi0N1diwyIHwRvbHgw3e8jMV7TOo35Ja7NnAdzwVxJzF+cemL2NFdVlnzjREcHr9yLDytyD1FdsMA1PAMGG5E849W4cWznQ== 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=/8Hz+Bk9EQflfkT2+GO5wfHftgoEuT8PjxVbwU7V35M=; b=LLODOpOD5cPNzD0MSRhdFNXyS/kPrmlkNCaCc3ymYSXzszbttKzGwNoDiMtAh+xVfSqPjm49RDR4nH/GxdtmZuG/3+oHdskWRv3arK+bRhdFbsZXqjcXSqwOedhjWnxAY1Y3yCug3HXq1iAT5w03NDsXjtHmlKyG4wBPqcUbF0rKTEkjltgeTN9EMDHg0tFeV2z6c9Uy7W2Ib/L7tCYtv7EEhd+ej2CV8UsZ4bqac/pLB2+fDqBnc3OHC/NmQiP8HJAssDSHZ/aJOaegUWaYRLpiHNIHlOixb8ViyERov8nskADX6zsWXcOLurPV3I9SCbsPnpGXKxSSujjUGxY9Ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/8Hz+Bk9EQflfkT2+GO5wfHftgoEuT8PjxVbwU7V35M=; b=Hj13MswtM9lDiw+BJTCKykLuNbXIPeCRJ9SB+kU+0DrjQ23VJZl7ZRV+jIzSJAHWv2WWuapDmr2vZ+9eVBKpaQQzUb9l80QDFU/p9suOvKcuPjJGuM+9uheS3HtH9rGX/ywHI/HnGY0mYrz6Sy/AMjvsioGB0yegwDpg8O3jr4jKj5SBH636Vz7F1bMYRbxkeosovdfOydvwDIOtf7QXOzHNa6vZH+A0XYI9YqXOVMJCnXnIm/y0w0TJ4x5Qw+7DWemXqJvsEY6BKzgKxIu5epu5MNghAnAUFDvXlz98gr/VvmCMQRwexZkqHdqPUlELxAY3EiIoKvYnVc9ecdnP+g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AS8PR03MB7905.eurprd03.prod.outlook.com (2603:10a6:20b:420::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20; Thu, 10 Nov 2022 16:56:21 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 10 Nov 2022 16:56:21 +0000 Message-ID: Date: Thu, 10 Nov 2022 11:56:15 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH net-next v2 00/11] net: pcs: Add support for devices probed in the "usual" manner Content-Language: en-US To: Vladimir Oltean Cc: Vladimir Oltean , Heiner Kallweit , Russell King , "netdev@vger.kernel.org" , Eric Dumazet , Paolo Abeni , Jakub Kicinski , "linux-kernel@vger.kernel.org" , Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Alexandre Belloni , Benjamin Herrenschmidt , Claudiu Manoil , Florian Fainelli , Frank Rowand , Krzysztof Kozlowski , Leo Li , Michael Ellerman , Paul Mackerras , Rob Herring , Saravana Kannan , Shawn Guo , "UNGLinuxDriver@microchip.com" , Vivien Didelot , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linuxppc-dev@lists.ozlabs.org" References: <20221103210650.2325784-1-sean.anderson@seco.com> <20221109224110.erfaftzja4fybdbc@skbuf> <20221110152925.3gkkp5opf74oqrxb@skbuf> <7b4fb14f-1ca0-e4f8-46ca-3884392627c2@seco.com> <20221110160008.6t53ouoxqeu7w7qr@skbuf> From: Sean Anderson In-Reply-To: <20221110160008.6t53ouoxqeu7w7qr@skbuf> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MN2PR10CA0035.namprd10.prod.outlook.com (2603:10b6:208:120::48) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|AS8PR03MB7905:EE_ X-MS-Office365-Filtering-Correlation-Id: 19bae4df-7afd-427e-6ce5-08dac33c7e47 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6O2F6/6PHjGnleEuq22jQFo6nnVbPvwQc4egQjd4VZ2Kdri6v8VdOn4XKehKepLlbhj97syRULn9mpC9fGDH9Bjv7cA5+LZAkHiG4kbOuPUudKTV9XJ5CFIgenOv+CBUgDFHPp1poymqijUUQiPEqFgnXFAsgqLI4vFdvNNfLq8JjMCMc+E3wjgZGjXTgxzq8PsOREzF8/407f9xPkGS7rHue6vgWKyd1kmxAR6iuQ6In+2GHfqU234ix6wWaCUNhj1vDsoDdc30gxSWMetvbHhMsOr+m+FD/VLDl4NdCVlarNUm15ZwdLheFBVPtierdTtjXquJfThIzN2rBNn5wsVNkehcD2FZikmpR7YyjObnSz3nJ2xMhPnkaXTkFvkmsjvj8x61FTCBkZhbyQiJRgWzLi3gUykkRHDEXUcGyVSX+psf6ntWHpRojJ3BuaNBhcQj1ghD4UpxxQDjoWb32PwktlxRM7/8wcTor8sdsD+u16DIDdnb0dGeiZCcKtsZuJHNftqez+V3oc+apZQ4n1VszX+TDjD8rPotWv1SgYPNZdwQEwBZ91fOlqAnbZ86GklwajFD2CP2gwLfxt9U2sZqAP5VnVTBanjNZK0v9BpRLzK1hFZvRBPcxYcky0hIccaH4bX/UIiWbR9furjhgNRaJm9FUPxRI8Ok5Fj992aCDObs+uddlrc8qOV619mW9ouBflyIuJj4E/ulejERUaWNDFa9bcx8j21yI69pczAP7zb0BhQi7KF0InT/ot6kfCjZrCN2SHJ14pWkmO9RtZxMDZU00KK+xQOE514TqtYNyH95pMVA8zI+pzL6KuFL2JKsZpFV8Dxhj++mCicSTySwm2TJSyA7htEW4YJ3BS0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(396003)(39850400004)(136003)(376002)(346002)(451199015)(66946007)(41300700001)(44832011)(966005)(6486002)(36756003)(8936002)(7406005)(7416002)(83380400001)(6666004)(2906002)(66476007)(316002)(66556008)(8676002)(478600001)(5660300002)(54906003)(4326008)(6916009)(186003)(31686004)(38100700002)(86362001)(38350700002)(26005)(6512007)(53546011)(2616005)(6506007)(52116002)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-M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lTmxlMjFHdW13RmJH?= =?utf-8?B?SG5wVjU0a1htU2tlcFpXemRrZXpESzdxMzlSY1pISEh1ZEl4SFBWOGxadTZ2?= =?utf-8?B?Mmh6L3ZKRERZejJmVWhrNWRjVU80V0FNVyt0T3kydDQ5d09zdWg0MTFtMkhs?= =?utf-8?B?cHArbkVhWXBTTnVGSlM5YnhIWm5ncDlHYkhLZE8wZVRnSVZ1MHZvT1VKL3lI?= =?utf-8?B?YUVEY2RNWWk1eVNxMjJOTU83WXlKVXJ5R29tenIrV3drMlpFYmF6elM0R0Q3?= =?utf-8?B?UktXWEJZTUQ3MjZSQVFjUVBWMTQxWGplT2M1R0txektHSGFqbE1qSWQ2Z1dQ?= =?utf-8?B?YkgrVGM3UTdrNUdmOWVzN0FxanRZRmU4SDdMdE82cjlXWUQ3QmthUkxKNnIx?= =?utf-8?B?eVgwQSthRUcyOUJoMEI1VDdnVEkvWTVOTy9jdWZVRmh3UzhpaGloSmQ3d1FE?= =?utf-8?B?cXc9PQ==?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19bae4df-7afd-427e-6ce5-08dac33c7e47 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2022 16:56:21.3379 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aGavneTPkX5IAvP4TbyORM/wSarwMWtEbpB89HJ/s7b9A6mjzXJP+hytiHefmrcEnE0uHv1sEqCCDAshCuqtLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7905 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 On 11/10/22 11:00, Vladimir Oltean wrote: > On Thu, Nov 10, 2022 at 10:39:30AM -0500, Sean Anderson wrote: >> On 11/10/22 10:29, Vladimir Oltean wrote: >> > On Thu, Nov 10, 2022 at 09:55:32AM -0500, Sean Anderson wrote: >> >> On 11/9/22 17:41, Vladimir Oltean wrote: >> >> > On Thu, Nov 03, 2022 at 05:06:39PM -0400, Sean Anderson wrote: >> >> >> Several (later) patches in this series cannot be applied until a stable >> >> >> release has occured containing the dts updates. >> >> > >> >> > New kernels must remain compatible with old device trees. >> >> >> >> Well, this binding is not present in older device trees, so it needs to >> >> be added before these patches can be applied. It also could be possible >> >> to manually bind the driver using e.g. a helper function (like what is >> >> done with lynx_pcs_create_on_bus). Of course this would be tricky, >> >> because we would need to unbind any generic phy driver attached, but >> >> avoid unbinding an existing Lynx PCS driver. >> > >> > If you know the value of the MII_PHYSID1 and MII_PHYSID2 registers for >> > these PCS devices, would it be possible to probe them in a generic way >> > as MDIO devices, if they lack a compatible string? >> >> PCS devices are not PHYs, and they do not necessarily conform to the >> standard PHY registers. Some PCS devices aren't even on MDIO busses (and >> are instead memory-mapped). To implement this, I think we would need to be >> very careful. There's also the issue where PCS devices might not be >> accessable before their mode is selected by the MAC or SerDes. > > I don't get where you're going with this. Does any of these arguments > apply to the Lynx PCS? If not, then what is the problem to using their > PHY ID register as a mechanism to auto-bind their PCS driver in lack of > a compatible string? > > You already accept a compromise by having lynx_pcs_create_on_bus() be a > platform-specific way of instantiating a PCS. However, the only thing > that's platform-specific in the lynx_pcs_create_on_bus() implementation > is the modalias string: > > struct phylink_pcs *lynx_pcs_create_on_bus(struct device *dev, > struct mii_bus *bus, int addr) > { > struct mdio_device *mdio; > struct phylink_pcs *pcs; > int err; > > mdio = mdio_device_create(bus, addr); > if (IS_ERR(mdio)) > return ERR_CAST(mdio); > > mdio->bus_match = mdio_device_bus_match; > strncpy(mdio->modalias, "lynx-pcs", sizeof(mdio->modalias)); // <----- this > err = mdio_device_register(mdio); > if (err) { > mdio_device_free(mdio); > return ERR_PTR(err); > } > > pcs = pcs_get_by_dev(dev, &mdio->dev); > mdio_device_free(mdio); > return pcs; > } > EXPORT_SYMBOL(lynx_pcs_create_on_bus); > > Otherwise it could have been named just as well "pcs_create_on_bus()". Yes, this could be made generic when we convert other drivers. This really is just intended for (non-dt) platform devices. It might even be better to do this with swnodes... > And this is what I'm saying. What if instead of probing based on > modalias, this function is made to bind the driver to the device based > on the PHY ID? > > The point about this functionality being generic or not is totally moot, > since it's the driver who *decides* to call it (and wouldn't do so, if > it wasn't an MDIO device; see, there's an "mii_bus *bus" argument). > > It could work both with LS1028A (enetc, felix, where there is no > pcs-handle), and it could also work with DPAA1/DPAA2, where there is a > pcs-handle but there is no compatible string for the PCS. The crucial difference here is that if we have a pcs-handle property, then the node it points to will have a device created by the MDIO subsystem automatically. The reason for this create_on_bus stuff is to make the process of 1. Create an MDIO bus with no firmware node 2. Create some MDIO devices on that bus 3. Bind them to the correct driver 4. Get the PCS from the driver less error prone. But for pcs-handle stuff, this should be something like 1. pcs_find_fwnode() 2. Look up the device for this node 3. Bind it to the correct driver (but taking care that we don't unbind an existing driver if it is correct). And then the driver can call pcs_get(). With your suggestion to use PHY_ID, we wouldn't need that. But we would still need driver involvement, since probing MDIO busses is not safe in general (since as Andrew mentioned there are things on the busses which don't have PHY ID registers). And IMO if we need the driver to go "yes, it's OK to probe this non-phy on this bus," then we might as well do what I described above. This could be a bus flag, which I think would work with existing devices. I'm worried that this could cause regressions and take a while to iron out. My current approach is fairly conservative and doesn't require changes to unaffected code. >> >> As I understand it, kernels must be compatible with device trees from a >> >> few kernels before and after. There is not a permanent guarantee of >> >> backwards compatibility (like userspace has) because otherwise we would >> >> never be able to make internal changes (such as what is done in this >> >> series). I have suggested deferring these patches until after an LTS >> >> release as suggested by Rob last time [1]. >> >> >> >> --Sean >> >> >> >> [1] https://lore.kernel.org/netdev/20220718194444.GA3377770-robh@kernel.org/ >> > >> > Internal changes limit themselves to what doesn't break compatibility >> > with device trees in circulation. DT bindings are ABI. Compared to the >> > lifetime of DPAA2 SoCs (and especially DPAA1), 1 LTS release is nothing, >> > sorry. The kernel has to continue probing them as Lynx PCS devices even >> > in lack of a compatible string. >> >> I believe the idea here is to allow some leeway when updating so that >> the kernel and device tree don't have to always be in sync. However, we >> don't have to support a situation where the kernel is constantly updated >> but the device tree is never updated. As long as a reasonable effort is >> made to update (or *not* update) both the kernel and device tree, there >> is no problem. > > I don't think you'd have this opinion if device trees were not > maintained in the same git tree as the kernel itself. You have to > consider the case where the device tree blob is provided by a firmware > (say U-Boot) which you don't update in lockstep with the kernel. > Has nothing to do with "reasonable" or not. This is exactly the reason why I am saying that we need to have the device tree updates in the kernel for a bit before these latter patches can get merged. Actually, it is probably unlikely that these will make it into the next LTS release (either 6.0 or 6.1), so these will probably be in device trees for a year before the kernel starts using them. But once that is done, we are free to require them. --Sean