From: Andrew Lunn Subject: Re: [PATCH net-next 1/3] net: nixge: Add support for fixed-link subnodes Date: Thu, 30 Aug 2018 19:54:19 +0200 Message-ID: <20180830175419.GD31581@lunn.ch> References: <20180830004046.9417-1-mdf@kernel.org> <20180830004046.9417-2-mdf@kernel.org> <20180830030420.GB16896@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "David S. Miller" , Kees Cook , Florian Fainelli , Linux Kernel Mailing List , netdev@vger.kernel.org, Alex Williams To: Moritz Fischer Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org > > The hardware has MDIO, but you don't have a PHY connected on it, and > > use fixed link. > > Since it's an FPGA design in that case we'd probably build the hardware without > MDIO to save resources. You can save resources, but is it worth the complexity else where, like in the software? > > It is important you have the mdio subnode, with PHYs and switches as > > children. The driver currently gets this wrong, it uses > > pdev->dev.of_node. > > Oh, whoops. Yes, and i also missed it. I generally review all new network drivers and look at their MDIO and PHY code. > Any good examples of drivers doing it right? Is the one going with > the DT snippet above a good example? That comes from the Freescale fec_main.c. It only supports DT, and always uses of_mdiobus_register. You need to be a bit more flexible for when you don't have DT. I'm not sure there are good example of this, since they either don't need this flexibility, or they get it wrong :-( Andrew