Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1439224pxb; Wed, 4 Nov 2020 08:57:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5uwMLRFto220TI9KkhZrfpjDg5J9eKe3HFJYtjEAyR7gMwSf+hCHg3ZN5WVeZLh2fF0qo X-Received: by 2002:aa7:df89:: with SMTP id b9mr28075599edy.335.1604509057735; Wed, 04 Nov 2020 08:57:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604509057; cv=none; d=google.com; s=arc-20160816; b=hleITqvgj0LeS/t4+51g0lpYumWo84vDsF47OTO2M8lBLVoXh5PCDDJtin3mw6q2Ia xWGBH/nFtZRG39kjykvI0c48ikwmsrFkIL1sgXYSMT/Rc59VCBmBp5/yHNFWijKTWTx7 LUDUbUVAxJWDm8HfLtY2Nmmr/XCFEaie7vB92WI7Mc/RUzCQ+JpF3EqMirIvcm0BhSPJ zTmNbSh5k03xLUKWk2iGL3kzoc4qDUVEExoL351MK8whhbw8j8l+qWV4xwQaqTPr27Gt /fDg8tbC1HGdLqdu/JB+jncUWBhkRSZjhkTFfvb7NN+kWViJ6un9hrF7DvTvRPwk9t0p HVUg== 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=pS89ZqgWBFCcZXN9dAKDizNmtunW83Nam6UqglqR5ow=; b=Xr2RM+oP1pCzDGFrGfxiFrfvbzTpG/Mxn+pSrr+DrEH6ydnNPFDOKC760CC6GLuXQb dKpya4ZpzHV30KMqglsSPpQzqPMMtwNEcRGLYfLqr9YYFSuDRX1w79ZR9oWHXUO6LTlw SWowHbWCLaQlspfvlZSspXSZNtr17IV5hoKGP1Dr1uouJ5ofMuV4g25lc/qReRWbmnsj 6L66CLuQskWcxtiEEwW0H2pnWosG/QmOxMyp19+iJr45SbIv+IBlhz7E0VN4bpkujETs lLpsTGHxFJLMrYdugs8YcUR2Xutqtbyc48s2uzs8SmMPyxkUR+vzDewzF7pgekq4o01p nHeg== 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 yd28si1618069ejb.606.2020.11.04.08.57.14; Wed, 04 Nov 2020 08:57:37 -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 S1731156AbgKDQzR (ORCPT + 99 others); Wed, 4 Nov 2020 11:55:17 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:35612 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729430AbgKDQzR (ORCPT ); Wed, 4 Nov 2020 11:55:17 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kaM3x-005FOf-Di; Wed, 04 Nov 2020 17:55:09 +0100 Date: Wed, 4 Nov 2020 17:55:09 +0100 From: Andrew Lunn To: Sven Van Asbroeck Cc: Bryan Whitehead , David S Miller , Jakub Kicinski , Microchip Linux Driver Support , Roelof Berg , netdev , Linux Kernel Mailing List Subject: Re: [PATCH v1] lan743x: correctly handle chips with internal PHY Message-ID: <20201104165509.GB1249360@lunn.ch> References: <20201104160847.30049-1-TheSven73@gmail.com> <20201104162734.GA1249360@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 04, 2020 at 11:39:47AM -0500, Sven Van Asbroeck wrote: > Hi Andrew, many thanks for looking at this patch ! > > On Wed, Nov 4, 2020 at 11:27 AM Andrew Lunn wrote: > > > > > Note that as a side-effect, the devicetree phy mode now no longer > > > has a default, and always needs to be specified explicitly (via > > > 'phy-connection-type'). > > > > That sounds like it could break systems. Why do you do this? > > Because the standard mdio library function (of_phy_get_and_connect()) > does not appear to support a default value. The original driver > code duplicated that library function's code, with a slight > tweak - the default value. > > The default value was introduced quite recently, in the commit which > this patch fixes: > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/net/ethernet/microchip/lan743x_main.c?h=v5.9.3&id=6f197fb63850b26ef8f70f1bfe5900e377910a5a If you look at that patch, you see: - ret = phy_connect_direct(netdev, phydev, - lan743x_phy_link_status_change, - PHY_INTERFACE_MODE_GMII); - if (ret) - goto return_error; That was added as part of the first commit for the lan743x driver. Changing that now seems dangerous. This is a fix you want backporting to stable. Such fixes should be minimal, and obviously correct. So i suggest you keep with the open coded version of of_phy_get_and_connect(), and make sure it keeps with the default as PHY_INTERFACE_MODE_GMII. That can be committed to net as a fix. You can then consider a refactoring patch for net-next, and see about modifying of_phy_get_and_connect() to do what you need. Andrew