From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F2C0C2D0A3 for ; Wed, 4 Nov 2020 16:55:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BFB22072C for ; Wed, 4 Nov 2020 16:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731257AbgKDQzR (ORCPT ); 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