Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp167242imm; Thu, 30 Aug 2018 10:55:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZqRKRWcgkCRzr4djXiKIhzMlXFH7mAjV0j+nC2iEmn+txRIpF7ToKEO8+TgPwnCSApN8zi X-Received: by 2002:a63:fc07:: with SMTP id j7-v6mr8455051pgi.1.1535651751846; Thu, 30 Aug 2018 10:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535651751; cv=none; d=google.com; s=arc-20160816; b=OwJqM5PlN/QGErPHlHT14TXk1Xw1na0V3h3VFoZHkomMsGjSavDjHzfcC0g6Y+kvEz kh8mR/6wOcFe9fvLDugw49YtrMT/Pz3X1xrc5y+x3ilTHS5TweYR/4cQohrZE3c8HXXf GNofpjrz4dkZIhfP1ZXJJRVUxbkoggUd+QZlNgFKeXniVierqQkWgXJvr1Btd26+Dp/s AvbDivtzmygoLeBEx9VKTZjjW7LCt7w6T3jD0d9pjdTkjIuz1RBIt+hBL+YezTOVHe6q wNRqg6CzvB7/DM6rXF2/zhNNlaH8EmA116AIcikJzr6S70HzZNhx0yn1YvhJOyDmuIKv /3NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=gMCS3yQpaLcaO5MfisqCQUK6USTF+oSFHCtShor2TTg=; b=VdSGSajbYgf08PvBhYaglaJJrVSl/8wxj8gbzEQf6tpzBlB9R9Ja1jMC6BUSUHBSFH nWZBrhmD94eDP7Kn/TxB3xVTi1bzR0nlUT63IgRdfvWNnTqJZfSX+cx1a+LHFQVLYq4B caU01M4xknelHnLmDq267JLD3VLrQGgBS6yyhn4tM7I1d++OW1Y23pp5GjQXfLVoNIkh CER8TQF6jR7GGCJIYUCIO/I109Zypykf2bjwrwcXszuDWwnwDXfKtKNglo9C+QppkinI pY8RWNR4r1Nlji81EYT3mvNezsP2tJq4uhe5nnxBLp49e4k8v/dsn4Alr9KmcSFrm2c+ tHfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=VrzDFWqL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f34-v6si7141281pgf.488.2018.08.30.10.55.34; Thu, 30 Aug 2018 10:55:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=VrzDFWqL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbeH3V5k (ORCPT + 99 others); Thu, 30 Aug 2018 17:57:40 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:48017 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbeH3V5k (ORCPT ); Thu, 30 Aug 2018 17:57:40 -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; bh=gMCS3yQpaLcaO5MfisqCQUK6USTF+oSFHCtShor2TTg=; b=VrzDFWqL5z0Vlbyj+oQHi1JldDdSGHJdmHsOrDGsHONlbJe7+rzxH7Vty/GHoHuAhX/SIlR4EMzMtcBaAhwq4NOpTEaeGr1ldD5jbEnwGhf7yUmSILEJr7hucTuzkm1CkBqNpdvQyNOOEEkve7VtoFv5b1Rsv0dp9O2adjWP5iQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1fvR99-0001E3-40; Thu, 30 Aug 2018 19:54:19 +0200 Date: Thu, 30 Aug 2018 19:54:19 +0200 From: Andrew Lunn To: Moritz Fischer Cc: "David S. Miller" , Kees Cook , Florian Fainelli , Linux Kernel Mailing List , netdev@vger.kernel.org, Alex Williams Subject: Re: [PATCH net-next 1/3] net: nixge: Add support for fixed-link subnodes 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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