Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4401185pxb; Tue, 10 Nov 2020 15:54:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyY1YkEtAH6QhemRpHRDi/8FjoLL7xL6f3Zxb3Nvwy2108shue/3Dbr3hMeALc2comvH+OY X-Received: by 2002:aa7:c2c3:: with SMTP id m3mr2015012edp.361.1605052485452; Tue, 10 Nov 2020 15:54:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605052485; cv=none; d=google.com; s=arc-20160816; b=oLsmP5GjetMiIyc7V5NS7+ZviqRs6xQrrNIAVDBtx+CBIB0AMVDTn+LICDaWuEpXbI +X3OHZU+tMsEpvRYKVHEJfi8K4OoC3BfOR5bT3bS8X6UFn7WpRWczeUtFuMJKDIjgDZs ZmfHDIhZAzbYw2F/xLs9tjhNxKHuEFsq0tesZtRgDW/mw4+4mtzBsXonRrGosZF6qZeu gSuCxEn4552ngo8er1Q6OjhC0L8Ojr40QfF2sA5iok7ZYs0oJkZr40tOj2h8ncXBSGA4 Pb2bDZwA/J6Of6w1H1AVHivOLpIyE+DU/WlkDacU1kPBacYq07GDBNFF3jyco4Z1AI+9 t/EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=gfdBsqMbVxHRXfifvYxCdcLRRnH8W7sFGaByYARDc5g=; b=Wa3i4GO0y4U2XIDlpYLIeuQmlidocJkM+oSwikkv0/3HkBLOfDT0ulLpyY1qiIEjoj YdVXus5Fe3GVKcO0ZKCc2CzJJfrdzIC3aG/tOPPpHXXVcs9KWnqhCRpvmPlHGXkR5LMp TL8g1v7jmgY1dsf0RXAIey/nu5eD8fE6HTCjm1bHRlv2dJFEC4hG5j9kuufWWdwOWHha mZflfkGXXoei/Yk3cNbyYpN72wnF3W/3a2NQYLwXlgSGTmXHTeNV4YUjQzUcL9u9XIQZ uaz/HRJs6PMtMlfHE8QzDoIW2Tjv8l7Dq16B/N983t6syjFFOJvyuAN7jQGwN7DfIeg4 Iz2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fhobiSMn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pw16si110569ejb.430.2020.11.10.15.54.12; Tue, 10 Nov 2020 15:54:45 -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; dkim=pass header.i=@kernel.org header.s=default header.b=fhobiSMn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732317AbgKJXsr (ORCPT + 99 others); Tue, 10 Nov 2020 18:48:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:48790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730254AbgKJXsr (ORCPT ); Tue, 10 Nov 2020 18:48:47 -0500 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3023C207E8; Tue, 10 Nov 2020 23:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605052126; bh=wRBFRLvW3yQNab1zY31tsSRJ4SNnP8HEwm3V2HkrMqY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fhobiSMnzLxSvz8w/acYZFNFAdjO6S7nMnLGENliejDLk+irP0ccDoLNUnOMExnnm iI0JTLETEaLTJT56/fzfyFQc7d3RupdzF0fdf7BQY+bcmR140Vi5X9oorLTJiBhDwL mMdfAXrNCMoCtnLCAHgpV7ZS8GHXeMROisxGwZWw= Date: Tue, 10 Nov 2020 15:48:44 -0800 From: Jakub Kicinski To: Sven Van Asbroeck Cc: Andrew Lunn , Bryan Whitehead , David S Miller , Microchip Linux Driver Support , Roelof Berg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v4] lan743x: correctly handle chips with internal PHY Message-ID: <20201110154844.651c5f98@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201108171224.23829-1-TheSven73@gmail.com> References: <20201108171224.23829-1-TheSven73@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 8 Nov 2020 12:12:24 -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 > Reviewed-by: Andrew Lunn > Signed-off-by: Sven Van Asbroeck Applied, thank you!