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=-5.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 C53BAC4CECE for ; Mon, 14 Oct 2019 23:45:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91608217D9 for ; Mon, 14 Oct 2019 23:45:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Fh0dTqlc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726691AbfJNXpI (ORCPT ); Mon, 14 Oct 2019 19:45:08 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:45396 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbfJNXpI (ORCPT ); Mon, 14 Oct 2019 19:45:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Cc1o6O0GLcNmuIJAd1oHLMPB851qrt/yI8fCRGWgBCo=; b=Fh0dTqlc8R4ICOnWmHzdgesJtH NtyKe2TmNpUZ4B+dLAsXM78IGvzhTh4/psRIvHMWoSzR43MUd0tiZ9iBC0tuMn+K3gBhWycJ+osdJ OS85mC/uGOZCiWbN/e/sBfEnxmrlc5GdcbH2XvWbb4209XLKV1U4EkluWzKRy6vevIaQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.92.2) (envelope-from ) id 1iKA1O-00078m-TP; Tue, 15 Oct 2019 01:45:02 +0200 Date: Tue, 15 Oct 2019 01:45:02 +0200 From: Andrew Lunn To: Alexandre Belloni Cc: "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Zapolskiy , Sylvain Lemieux , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] net: lpc_eth: parse phy nodes from device tree Message-ID: <20191014234502.GG19861@lunn.ch> References: <20191010204530.15150-1-alexandre.belloni@bootlin.com> <20191010204530.15150-2-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010204530.15150-2-alexandre.belloni@bootlin.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 10, 2019 at 10:45:30PM +0200, Alexandre Belloni wrote: > When connected to a micrel phy, phy_find_first doesn't work properly > because the first phy found is on address 0, the broadcast address but, the > first thing the phy driver is doing is disabling this broadcast address. > The phy is then available only on address 1 but the mdio driver doesn't > know about it. > > Instead, register the mdio bus using of_mdiobus_register and try to find > the phy description in device tree before falling back to phy_find_first. > > This ultimately also allows to describe the interrupt the phy is connected > to. > > Signed-off-by: Alexandre Belloni Hi Alexandre > > - if (mdiobus_register(pldat->mii_bus)) > + if (of_mdiobus_register(pldat->mii_bus, pldat->pdev->dev.of_node)) > goto err_out_unregister_bus; It is normal to use a container node 'mdio' in the ethernet node to contain the PHY nodes. If you don't do this, you run into issues when you have Ethernet switches on the MDIO bus. Andrew