Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2642164pxb; Sun, 8 Nov 2020 08:00:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJy68eyUuOIWxlEqKEU5Sek3PsttVcIpWB5DpPEE5s+v54Bz/C8MvHDi65kxLrijLSsK3YHD X-Received: by 2002:a17:906:4351:: with SMTP id z17mr10983713ejm.110.1604851218767; Sun, 08 Nov 2020 08:00:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604851218; cv=none; d=google.com; s=arc-20160816; b=G114JCifmOKZcUhalLgbZB4mq4S44DXWzH0cSW3Z130ByWi7ZTmmToZK0F5ttbnQms dAzfYNbDJ54NAw6H8mJcDNb3wSWHQuGInTNa1R7fxHkDfC2WkOsubs6au3Mwy3eDbHTr kpZSgZ2Fj2meR0fNFG9Hp6z6m99NG0JLPGzH6k/a/LLa6760t96pQlhLKgIwQSvY9osD gHsEUlsXTNF5LDgK5dC0NQh7RGMDdnQvw7+urgor7lAVYBZ+mvWDHLy5bh2xUmTStC4l ClT1Zf0F/hKvloVFbI8czgUV/5I139FWjCyO7f6mik/D0f+sEv62Ov9moAEJPo2/NdE7 uaxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=RP80/g8Edlx/kigvi6NryMhDGekh32SvY+7on+1HGRc=; b=rT4LMjqpypmnJ0ExhXe5OwRdDjAJy52bwXoyYF4Jbh8hjMRUsM3akAn472Z6CzbaSf M2cC56cesfou0SB252Z2lkngZ65m6vNeOurhYy4cDEaiU5BgZCu8fOu1nx1DD/3o1Wsb FFcPFCZp2oq5JwnJBPwtcb2liHZZEiEZIWrx7wokrHfFyfbRxhS5yTFPmaFT7akwcLnx 7/7HeVb6jVJYFZ+PcjbSMbsKYRajv+FiN7ao12L4563ADGxyGDkMvz4Yio4WYcNHmOq3 J7pgL/mj+UMBffPEYA4tHh90KCM10E8Y8vuzMqwR1t4Tv9MakZCsOf6mmkJBuauB+/bU SwRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si759903edw.195.2020.11.08.07.59.30; Sun, 08 Nov 2020 08:00:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728300AbgKHP6H (ORCPT + 99 others); Sun, 8 Nov 2020 10:58:07 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:41616 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727570AbgKHP6H (ORCPT ); Sun, 8 Nov 2020 10:58:07 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kbn4m-005wcu-HR; Sun, 08 Nov 2020 16:57:56 +0100 Date: Sun, 8 Nov 2020 16:57:56 +0100 From: Andrew Lunn To: Sven Van Asbroeck Cc: Bryan Whitehead , David S Miller , Jakub Kicinski , Microchip Linux Driver Support , Roelof Berg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] lan743x: correctly handle chips with internal PHY Message-ID: <20201108155756.GA1399052@lunn.ch> References: <20201108140653.15967-1-TheSven73@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201108140653.15967-1-TheSven73@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 08, 2020 at 09:06:53AM -0500, Sven Van Asbroeck wrote: > From: Sven Van Asbroeck > > Commit 6f197fb63850 ("lan743x: Added fixed link and RGMII support") > assumes that chips with an internal PHY will never have a devicetree > entry. This is incorrect: even for these chips, a devicetree entry > can be useful e.g. to pass the mac address from bootloader to chip: > > &pcie { > status = "okay"; > > host@0 { > reg = <0 0 0 0 0>; > > #address-cells = <3>; > #size-cells = <2>; > > lan7430: ethernet@0 { > /* LAN7430 with internal PHY */ > compatible = "microchip,lan743x"; > status = "okay"; > reg = <0 0 0 0 0>; > /* filled in by bootloader */ > local-mac-address = [00 00 00 00 00 00]; > }; > }; > }; > > If a devicetree entry is present, the driver will not attach the chip > to its internal phy, and the chip will be non-operational. > > Fix by tweaking the phy connection algorithm: > - first try to connect to a phy specified in the devicetree > (could be 'real' phy, or just a 'fixed-link') > - if that doesn't succeed, try to connect to an internal phy, even > if the chip has a devnode > > Tested on a LAN7430 with internal PHY. I cannot test a device using > fixed-link, as I do not have access to one. > > Fixes: 6f197fb63850 ("lan743x: Added fixed link and RGMII support") > Tested-by: Sven Van Asbroeck # lan7430 > Signed-off-by: Sven Van Asbroeck > --- > > v2 -> v3: > Andrew Lunn: make patch truly minimal. This is looking much better. Thanks. > > v1 -> v2: > Andrew Lunn: keep patch minimal and correct, so keep open-coded version > of of_phy_get_and_connect(). > > Jakub Kicinski: fix e-mail address case. > > Tree: v5.10-rc2 Since this is a networking fix, it should be against: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git Please also put in the subject [PATCH net v4] to make it clear it is for the net tree. You can find more about this here: https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html Reviewed-by: Andrew Lunn Andrew