From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH] net: mvpp2: initialize port of_node pointer Date: Mon, 27 Aug 2018 20:44:25 +0200 Message-ID: <20180827184425.GA22547@lunn.ch> References: <96a50db3fefc2f1be9ecb6bf8ca91c71508e8eb1.1535371973.git.baruch@tkos.co.il> <20180827134723.GD15473@lunn.ch> <20180827181721.usbb2vvaenzxclkq@sapphire.tkos.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Maxime Chevallier , Antoine Tenart , netdev@vger.kernel.org, Russell King , Ori Shem-Tov , Jason Cooper , Gregory Clement , Sebastian Hesselbarth To: Baruch Siach Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:44320 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbeH0WcN (ORCPT ); Mon, 27 Aug 2018 18:32:13 -0400 Content-Disposition: inline In-Reply-To: <20180827181721.usbb2vvaenzxclkq@sapphire.tkos.co.il> Sender: netdev-owner@vger.kernel.org List-ID: On Mon, Aug 27, 2018 at 09:17:21PM +0300, Baruch Siach wrote: > Hi Andrew, > > Thanks for reviewing. > > On Mon, Aug 27, 2018 at 03:47:23PM +0200, Andrew Lunn wrote: > > On Mon, Aug 27, 2018 at 03:12:53PM +0300, Baruch Siach wrote: > > > Without a valid of_node in struct device we can't find the mvpp2 port > > > device by its DT node. Specifically, this breaks > > > of_find_net_device_by_node(). > > > > We need to be a little bit careful here. I've seen this done wrongly > > before, breaking DSA support. Is you intention to use DSA? Can you > > quote a section of DT, and indicate which node is port_node. > > Yes. This is for the Armada 8K based Clearfog GT-8K. The board has a Marvell > 88E6141 switch connected to the &cp1_eth2 port. > > Here are the relevant DT nodes: > > &cp1_mdio { > ... > > switch0: switch0@4 { > compatible = "marvell,mv88e6085"; > ... > > ports { > ... > > port@5 { > reg = <5>; > label = "cpu"; > ethernet = <&cp1_eth2>; > }; > }; > > Without this patch, dsa_register_switch() returns -EPROBE_DEFER because > of_find_net_device_by_node() can't find the device_node of the &cp1_eth2 > device. O.K. This all looks correct. Reviewed-by: Andrew Lunn Andrew