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 X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2E1DC433DF for ; Thu, 23 Jul 2020 22:10:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF6F0206C1 for ; Thu, 23 Jul 2020 22:10:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xzh6xuky"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="STBwMtzO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="Bj8cadf6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF6F0206C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sthNxwnS1nP6eRGuVQQLXq84cDv0KhiRgDkLCab9fRk=; b=Xzh6xukyWjuosAm+6Zj/IMtna fB4AltywhGTe7WDq2MA5s2wWipvz/aWWiBjJ9jkyVIHf85ToFJHq/hwKNTSH6M6iO7dGF/yfsdCRR k5Xl80UunKSS7AQd7/xJExvyglSaIH/F8HgMhrSw82GYxGHBBJI2wjs+bYKm6YertEvI999WbaRPE 6Qfs1e6snyFzHDDdh0Tlr5YjPy7tJbMPSEH1kdZp1H1S7Nw09DdRtsMORaN5BLF5SS2ZJxAQkTukq hzbkNGK4V+NnXyJWaWGN1f+v44PyDC5BcX+YtrLBl8h+mxixur0Y8r1Mfu73p7bKp0sMQMOC4wT3/ 5LsUIY59Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyjOf-0001X8-S1; Thu, 23 Jul 2020 22:09:01 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyjOd-0001WM-2c for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 22:09:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595542139; x=1627078139; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=yXHnu6gTvmNIXIQWtB7t+9sAxDzQ1uzE9BKVE+FJ4oA=; b=STBwMtzODzzeKN8U4Q0+4davwYSycGDlUrc9Tbjd5+yucIxucBuWqezH hmOS9pHb7Z9KKKN11LpnlTPAeh7dlFWuq2P67UwAMuH8+/Gbh+i8d9sZ+ jm43uGfh7hsHxradL381JHYYzs/iqpo7+DesVfQ4LMiMNFEME010zlaa8 Y4xMwExfJfbiRm0rCpQzeSM6uj3zHmUfL6nF4CLBtTWz9ZQE1/50ZATpB H9cF2K+9+lvgYtD02ZSSVSbUHbB0+6Hb5oXg+SdWsjqVl5hUr5DYPqvYY PhJVjNUN6+LAevjHKOI634gNU4j6OrErVdm0KHNy96GfJ058aGr+bvDdA w==; IronPort-SDR: TOEGqNsJG8QJfzDzTQ0eMEkmcSZV6paiP8HFO2rS80Q2dfbF/IxxAQ0BtvPUtTCqdEIiMepI1U +MoBF46e/evXsKEDnKd8Erw6/roZexfCG8GWaGDikpeei05v7j18epT917vzeErFG30RpkSEaQ fSLWfH94Fj7VUV7Va7gS59PlKweIcZqfEgUNLppHbgCWCoRuTP920hgJzVv/mpXg1XCkItynwh 89RbJcbrEZXENQ31Zuf0BUsHqohL3kKk6FPfcz1rbJde4w0GD2JhsNFLQcdnW/+jzJXWSmOdUl 7kQ= X-IronPort-AV: E=Sophos;i="5.75,388,1589266800"; d="scan'208";a="84409853" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Jul 2020 15:08:56 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 23 Jul 2020 15:08:15 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3 via Frontend Transport; Thu, 23 Jul 2020 15:08:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iA2Fn7GVQO6JWns+uerQl28AH8mElhGh9VMGqslS/eZ0SzK+zABVppZNc7xbt+3AsoQVoyaGpoyaaz81tpO0DzO4jTdB5uaOHnDWL7pOWIPOR9pE1uS2aabGwC86cX9+v0ujbnT/pRTzqhZ/z7RnDCQtNSHpKqEYybuOlAmExaz+JNy2Z7Aq2nEoLp/23P+ogBRwqe+WCKH8dDEKDHiOrAGsbWWpO9t2NvHqRrTgDXnaHfcR/7A/20MuyHQ7ugN6QdB1aRUVBCJ1WtH4zoVIg/LrlnvIxghCuVMkZZ2YTc+JOLakLBX3TL+88GbRDoKWRsGJ+HlI3ar2Y+uCUaWIPA== 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-SenderADCheck; bh=yXHnu6gTvmNIXIQWtB7t+9sAxDzQ1uzE9BKVE+FJ4oA=; b=VH4R08WQcGpawzZ9bcff8wlQVKTpBK48UK9kY9l6I9yXU5Jwwz6fw0Sqct044TjnJijnCgfmLP9gUJk34cnsOWuYOmK6StDOtXGn9m5wbbt+96mrsNDp0XWUl69x+Aamd3DkJ1gxpj8Rc/bmNQt6QzPHBXxn69SiVgvqiDV14qexy95GZlTcfIKzM1EzGmj28LepAtHY2WwShiEXerurQBzzXPWckiHB1VnbpuwPbGqa4pROYmaa5hSkB9uI+VQtjyBxdMSNmZpQ5xmnkaP7YN9GM7VRMDQDoRtW/HxycXouP4wQYco0E3Ytc6by//im4z/LYdyNDVP/GTzPWUN9yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yXHnu6gTvmNIXIQWtB7t+9sAxDzQ1uzE9BKVE+FJ4oA=; b=Bj8cadf6yLB5WJwMzgkY7ttgucgslx4Tj7rey7Zxqfue5m23f/tDDXLzJK1SYXIZ68REHtUbBlM3OgJKGjJ7QLe+IzTkwPKOW0AE9mou9ZS7aQX0SirQRjh0wOM5mO7xycYIDKxJLgsPqoxzhUKebiHVrCEFsaNnAMN7w28py9A= Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by SA0PR11MB4672.namprd11.prod.outlook.com (2603:10b6:806:96::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.24; Thu, 23 Jul 2020 22:08:51 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::851c:67fc:a034:9ea0]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::851c:67fc:a034:9ea0%4]) with mapi id 15.20.3216.022; Thu, 23 Jul 2020 22:08:51 +0000 From: To: , , , , Subject: Re: [PATCH net-next v2 3/7] net: macb: parse PHY nodes found under an MDIO node Thread-Topic: [PATCH net-next v2 3/7] net: macb: parse PHY nodes found under an MDIO node Thread-Index: AQHWX4MOpDLDucI5kUq6RMoIO+hGv6kVh78AgAA06wA= Date: Thu, 23 Jul 2020 22:08:51 +0000 Message-ID: <1ba55a2a-487a-dbd5-29e6-5d4231e80167@microchip.com> References: <20200721171316.1427582-1-codrin.ciubotariu@microchip.com> <20200721171316.1427582-4-codrin.ciubotariu@microchip.com> <460e5f3d-f3a0-154e-d617-d1536c96e390@gmail.com> In-Reply-To: <460e5f3d-f3a0-154e-d617-d1536c96e390@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=microchip.com; x-originating-ip: [84.232.220.208] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 383a2c63-637f-49a9-6ec3-08d82f54fba0 x-ms-traffictypediagnostic: SA0PR11MB4672: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-bypassexternaltag: True x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nKQC3NAyH55CYFgmmplwcJLJGlhXtfybd/7+iCoA2imcxoJnWZcRlF2XM+cegwbV486lIGdaGkxer8QQ3+3gevAlZnxRxNZmuKgojHafSQE0UhZRAOW9Fzs22oqT/w0q9ROOlpa5Bofu6T4v9B766J3yngrIqVSwdPBTBr7/36iq0SB07YQ6YbopazmLUPV3iTEnm7y9Evi+DxfdWF2AVkY+Jyp8dEmeDDC9evu9V0dJ+TyEgdix7REdtiIzrUNLSjLeBlKPfNKP8BZ41RG3W/BHJvH64JfitF7G4w3nXZS3yKiCYJmFdbzO8FsWwoekMMRdHhn//uBB+i6d03SP9nyAJ+xPF+JNDzvjrEeYmzDV1/yIYs33c9wo20xEt55E x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39860400002)(136003)(376002)(346002)(396003)(366004)(6486002)(186003)(107886003)(26005)(8676002)(8936002)(86362001)(36756003)(64756008)(7416002)(2906002)(66446008)(316002)(478600001)(66476007)(66556008)(110136005)(66946007)(31696002)(6512007)(76116006)(91956017)(31686004)(6506007)(53546011)(2616005)(54906003)(5660300002)(4326008)(71200400001)(43740500002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 3IL7XJ4XujXgIVk7J7hYIR9uJNb9tn/eQnaJ9uMVb8Q2tD41vuTpL41QllSlHVmQhZwzN6Fy+afmnAQuVAh4xZjVzwRGb4L0LNSIoi5JnU4w9JUswAGYS1DqkReWsccfJ9JjOospwDwzNcFRJbt3S6vYJQgKHW2rdmgPQu3eqj4ixfEiFs7gbmfSQ89V1s4/5RnGmnPuuJYVcIsEn2C1TJDlEb74Sh1TucbmQf115OmuEscr9Gk0G3MqJeIam1bRETBAH50limoRCXzNcn8h8cL7f1Gu9zHP77j8jpj38eHCqNvxXarzd6CtPiEj0DDL7L7yaY4ZATROGKi+Q7k6uRvlw5Ih1DVSbuKSGBP1MyDDwqYTqPXaIaMD94rTrEKC9C224aTB4trC22SFNa9RJiOdxwSLN8H+ZmMWVcxUeHvA8+Glcs9osfYwlWgb1KSl4Clgojt92G8+t9SyotVMU6IlpIeC3yeQArHk6W84V7fBLmXTg6UlD3GAC5ugoyDa Content-ID: <11926891E0FCFA4D80A77C57D1AFF233@namprd11.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 383a2c63-637f-49a9-6ec3-08d82f54fba0 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2020 22:08:51.7239 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MA6d7Wg9R2Rh73oNuoGrSdPd5VVr9PHVCcD968hjk4Z8vlB3dyh3fxgo0VcKvNXNo+mZbWZX3ilzGiFbIb85/PY3yimibkYyGrSCdvSqakQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4672 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_180859_383456_1A982977 X-CRM114-Status: GOOD ( 23.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrew@lunn.ch, alexandre.belloni@bootlin.com, Claudiu.Beznea@microchip.com, Ludovic.Desroches@microchip.com, robh+dt@kernel.org, kuba@kernel.org, davem@davemloft.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 23.07.2020 21:59, Florian Fainelli wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > On 7/21/20 10:13 AM, Codrin Ciubotariu wrote: >> The MACB embeds an MDIO bus controller. For this reason, the PHY nodes >> were represented as sub-nodes in the MACB node. Generally, the >> Ethernet controller is different than the MDIO controller, so the PHYs >> are probed by a separate MDIO driver. Since adding the PHY nodes directly >> under the ETH node became deprecated, we adjust the MACB driver to look >> for an MDIO node and register the subnode MDIO devices. >> >> Signed-off-by: Codrin Ciubotariu >> --- >> >> Changes in v2: >> - readded newline removed by mistake; >> >> drivers/net/ethernet/cadence/macb_main.c | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c >> index 89fe7af5e408..b25c64b45148 100644 >> --- a/drivers/net/ethernet/cadence/macb_main.c >> +++ b/drivers/net/ethernet/cadence/macb_main.c >> @@ -740,10 +740,20 @@ static int macb_mii_probe(struct net_device *dev) >> static int macb_mdiobus_register(struct macb *bp) >> { >> struct device_node *child, *np = bp->pdev->dev.of_node; >> + struct device_node *mdio_node; >> + int ret; >> >> if (of_phy_is_fixed_link(np)) >> return mdiobus_register(bp->mii_bus); > > Does not this need changing as well? Consider the use case of having > your MACB Ethernet node have a fixed-link property to describe how it > connects to a switch, and your MACB MDIO controller, expressed as a > sub-node, describing the MDIO attached switch it connects to. Right, this is what I was discussing with Claudiu on the other thread. I am thinking to just move the look for mdio before checking for fixed-link. This will probe the MDIO devices and simple mdiobus_register will be called only if the mdio node is missing. Thank you for your review(s)! Best regards, Codrin > >> >> + /* if an MDIO node is present, it should contain the PHY nodes */ >> + mdio_node = of_get_child_by_name(np, "mdio"); >> + if (mdio_node) { >> + ret = of_mdiobus_register(bp->mii_bus, mdio_node); >> + of_node_put(mdio_node); >> + return ret; >> + } >> + >> /* Only create the PHY from the device tree if at least one PHY is >> * described. Otherwise scan the entire MDIO bus. We do this to support >> * old device tree that did not follow the best practices and did not >> > > > -- > Florian > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel