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=-4.4 required=3.0 tests=DATE_IN_PAST_12_24, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=no 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 0C88BC10F14 for ; Tue, 15 Oct 2019 12:46:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D1C0B218DE for ; Tue, 15 Oct 2019 12:46:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XNZAcwvW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Fh0dTqlc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1C0B218DE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B4xl1y6bM0ugx9zuMozY3VUQ8lKqrIsFVII4d+fjBms=; b=XNZAcwvWzvieES tj49mtArDulLUVOm8zbrdTp9x/K+7FAH9cGB4OKy5Qz9UrOQNRT673jQfVObdSv861tT3/cPJxOha tcWzvEwt74yCgfPsOPWqrMY0OroXjx4eIPYE0oL5RK0ilvossJKbXSoE9wTaFqZh2Nsku5Y6PsM/9 V6L1OLVhKcigwwFdVCD/o7FQM+CUln+B1fze7SXdaWsVB0rvLSIcvQ3677Cz4vKby5D2KIMs8r7gF F6CP16uk09bLJfq9lagt8/UZ739XN0fizXvI0AQxt7Ia9/Whfvk2qJk+YU5HZrfsFSNjamiICm3aM ZHqQIhl1vHROBTZYNjtQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKMDq-0001HU-LZ; Tue, 15 Oct 2019 12:46:42 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKMDa-00015I-Nv for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2019 12:46:28 +0000 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 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-Disposition: inline In-Reply-To: <20191010204530.15150-2-alexandre.belloni@bootlin.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191015_054626_796276_09D01980 X-CRM114-Status: GOOD ( 13.65 ) 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: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Zapolskiy , Sylvain Lemieux , "David S . Miller" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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