From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5833C77B73 for ; Sun, 30 Apr 2023 18:49:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229725AbjD3StH (ORCPT ); Sun, 30 Apr 2023 14:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjD3StF (ORCPT ); Sun, 30 Apr 2023 14:49:05 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 794881BD5; Sun, 30 Apr 2023 11:49:04 -0700 (PDT) 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=1+r4sj5Wdu1YqQif08HC/Zm726AJ0OzaSQ6z+naTJaY=; b=expERG4bmIxY87IpV8nRXZhvdR vufaEvswXY9oMHSRXHPhPyXLQo+w9iAi01USwoZ9h9lZpnpHbnyReCRIvibzmh3tKDwjHxfsknAyc wb9UALy4ac1X4Xr36VP7JDI7TyFF6bNkNBRCL/mKFxTfLqQyzbuNZ83rEEfEimvV1/vY=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1ptC69-00BZ9O-7M; Sun, 30 Apr 2023 20:48:37 +0200 Date: Sun, 30 Apr 2023 20:48:37 +0200 From: Andrew Lunn To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: David Bauer , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Landen Chao , DENG Qingfang , Sean Wang , Daniel Golle , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 2/2] dt-bindings: net: dsa: mediatek,mt7530: document MDIO-bus Message-ID: <207753d6-cffd-4a23-be16-658d7c9ceb4a@lunn.ch> References: <20230430112834.11520-1-mail@david-bauer.net> <20230430112834.11520-2-mail@david-bauer.net> <396fad42-89d0-114d-c02e-ac483c1dd1ed@arinc9.com> <04cc2904-6d61-416e-bfbe-c24d96fe261b@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Try setting ds->slave_mii_bus to the MDIO bus you register via > > of_mdiobus_register(). > > That seems to be the case already, under mt7530_setup_mdio(): > > bus = devm_mdiobus_alloc(dev); > if (!bus) > return -ENOMEM; > > ds->slave_mii_bus = bus; > > The bus is registered with devm_of_mdiobus_register(), if that matters. (My > current knowledge about OF or OF helpers for MDIO is next to nothing.) > > The same behaviour is there. Maybe take a look at what is going on in dsa_slave_phy_setup() and dsa_slave_phy_connect(). The way i understand it, is it first looks in DT to see if there is a phy-handle, and if there is, it uses it. If not, it assumes there is a 1:1 mapping between port number and PHY address, and looks to see if a PHY has been found on ds->slave_mii_bus at that address, and uses it. So i don't think you need to list the PHY, the fallback should be used. Andrew