Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12036050rwl; Tue, 3 Jan 2023 08:09:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXss3YdXi2IiSHNnj7SWByobRLgKOeUnK6DrWgGAHzEqZCeHVDcZAHDohPFaAfSjv7tgsFFP X-Received: by 2002:a17:906:7f91:b0:7c1:5a5:f6bb with SMTP id f17-20020a1709067f9100b007c105a5f6bbmr38003273ejr.50.1672762144570; Tue, 03 Jan 2023 08:09:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672762144; cv=none; d=google.com; s=arc-20160816; b=sxXtQKscuqB9Qhui95QHdYxnmYnnPoVtrMd/9E6gwM8QKGkvSAs6yqb3G8mdAjeB0B lijpWPdslVCAO4M3u8+F7uT6Gy70FIWQL+dRXolyZGuVTXcQe9izFk9rWN8DTD7Y87ab pCX8+TixkE/t3VBgrFqUFZK8lHlB4DamchxeIG2ThE3KHfqlWwhlTS/mNfqfsZIURbBQ X3GayNr3LvWM08r6PYVfNv+83uNC/t9lIUq1orVJ7KN4uSZKWPBIRNY1dx1nBDV7v9y1 qDZFYGCo+6cL+FY8tjQHpCO/yCLOVxcrVmVpYxiBrbjaBz3oYzwVG4c4BQCnrmMZBWAh lgxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Bl7zNPyg/17oKHhmiSL8xm9swJqehU6paU/Oyhzf6vI=; b=mY9ewxAS23OGCE8n73fxh/1M0UwIfIiFxwuv6SIE35hETcx24AgwIKFprC6plRKSyI zfK2p4mKRcRHV5psRys9GE5sNgna+KmOb7OqQmrGg+nCvZnsD9asG8BLVn8Pjr4DzGjQ CX9Y3WKl+DDFSvczl51FfyBIzn0WhWaHnCIb25Gft+P05YIG2VwpaEgjErYS15f/DJsP IGPZnKskuESRyOGHJQxgnK8ChUXIPRC0zFhCwDwDElX86efveVtTCFBn0LqKFqtSIUGO lUbKb/MbB+pUH2GNcM8lrxOkN1slh6Ex8TEhh260/d4JZQu3IVd0ggQunJI0lCnn2gLO Qs9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tugNUhos; 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=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy9-20020a170906fe0900b007c14afc0ecdsi27295894ejb.479.2023.01.03.08.08.50; Tue, 03 Jan 2023 08:09:04 -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=@lunn.ch header.s=20171124 header.b=tugNUhos; 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=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238012AbjACPt0 (ORCPT + 60 others); Tue, 3 Jan 2023 10:49:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231249AbjACPtY (ORCPT ); Tue, 3 Jan 2023 10:49:24 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FFA512080; Tue, 3 Jan 2023 07:49:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Bl7zNPyg/17oKHhmiSL8xm9swJqehU6paU/Oyhzf6vI=; b=tugNUhosNDBEkmAtZH7CviKjAx EVZIPwfPfDBEo1tIq1mPP6dzRFul1Q9rpGo8qGLcg7AKlvemJkbedaPzVt9d2EhIBw5NcFaPsFF/D VOA707yX2El8ta6EhLXJyvw39L5fWM5yoJ+eG00iuvg/bYzUqbwgxGdCyQ1qqpn/NTIg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pCjX9-0013iX-VA; Tue, 03 Jan 2023 16:48:59 +0100 Date: Tue, 3 Jan 2023 16:48:59 +0100 From: Andrew Lunn To: Vladimir Oltean Cc: Michael Walle , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jose Abreu , Sergey Shtylyov , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , Sean Wang , Landen Chao , DENG Qingfang , Florian Fainelli , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Geert Uytterhoeven Subject: Re: [PATCH RFC net-next v2 11/12] net: dsa: Separate C22 and C45 MDIO bus transaction methods Message-ID: References: <20221227-v6-2-rc1-c45-seperation-v2-0-ddb37710e5a7@walle.cc> <20221227-v6-2-rc1-c45-seperation-v2-0-ddb37710e5a7@walle.cc> <20221227-v6-2-rc1-c45-seperation-v2-11-ddb37710e5a7@walle.cc> <20221227-v6-2-rc1-c45-seperation-v2-11-ddb37710e5a7@walle.cc> <20230103153134.utalc6kw3l34dp4s@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230103153134.utalc6kw3l34dp4s@skbuf> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 > Since clause 45 PHYs are identified by the "ethernet-phy-ieee802.3-c45" > compatible string (otherwise they are C22), then a PHY which is not > described in the device tree can only be C22. So this is why > ds->slave_mii_bus only deals with clause 22 methods, and the true reason > behind the comment above. > > But actually this premise is no longer true since Luiz' commit > fe7324b93222 ("net: dsa: OF-ware slave_mii_bus"), which introduced the > strange concept of an "OF-aware helper for internal PHYs which are not > described in the device tree". After his patch, it is possible to have > something like this: > > ethernet-switch { > ethernet-ports { > port@1 { > reg = <1>; > }; > }; > > mdio { > ethernet-phy@1 { > compatible = "ethernet-phy-ieee802.3-c45" > reg = <1>; > }; > }; > }; > > As you can see, this is a clause 45 internal PHY which lacks a > phy-handle, so its bus must be put in ds->slave_mii_bus in order for > dsa_slave_phy_connect() to see it without that phy-handle (based on the > port number matching with the PHY number). After Luiz' patch, this kind > of device tree is possible, and it invalidates the assumption about > ds->slave_mii_bus only driving C22 PHYs. My memory is hazy, but i think at the time i wrote these patches, there was no DSA driver which made use of ds->slave_mii_bus with C45. So i took the short cut of only supporting C22. Those DSA drivers which do support C45 all register their bus directly with the MDIO core. So Luiz patches may allow a C45 bus, but are there any drivers today actually using it? Andrew