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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 0477BC282C3 for ; Tue, 22 Jan 2019 19:09:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C622E20856 for ; Tue, 22 Jan 2019 19:09:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nx8i6lI2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726218AbfAVTJS (ORCPT ); Tue, 22 Jan 2019 14:09:18 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50948 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbfAVTJS (ORCPT ); Tue, 22 Jan 2019 14:09:18 -0500 Received: by mail-wm1-f67.google.com with SMTP id n190so15344467wmd.0 for ; Tue, 22 Jan 2019 11:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3NKvLxTOOqkWNp7o0eB0TCQUsVitFnFZGx+5RpIYdjI=; b=nx8i6lI2OYUiW8QL0YmsleXmtosDLFKFyQzSL2q41mo1CHhqjfSvGTF9Kz12eU92im xfPnlDEAsnRrgUL/Wv9RgquzjC3CeWx7tu2bOg8ICaTRMTXcOXZmzQNTme9WEvAGe46b mAUqYQB2Tad+4On9i5b/9Ss+m1T1L59C/84FiOlm4m+uvpEN3coMhkKBhm0RkRCogYrU NPljKk+vRLTzCaZniw33CsIWmVDSLCV9s867+PMR2bCgX/66+bTuOxVtM26J9BjBc5E/ uL9Hq9XMvMUJV9BUB2+R8HJ/pWb105lljQt8Dcg64+9E42UlQ1p8bXRdC6wBuMvcXQVT lx5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3NKvLxTOOqkWNp7o0eB0TCQUsVitFnFZGx+5RpIYdjI=; b=Hu2LP5leyp5QEz6mjLHo7QbdxoyilkRcNOhB9MUSwVl0k8ewzFXSAPG4c5AajVzS5F eL/p1QBI7x6MLFF3VzhC44xbME2BEc/Dwp7ifJaZrokIS62ISg8zDeIKdvGvz8EJza/g WnDiULCdqqz8VcyuHT9DDdGyPnU4Ksg9PO1JrT9NdVXCm6fTUt64VTmpFSlKzWvH/UkA lkdwiFlj6aUgC1JAGpSYHjYRMB7xHZcsh5qWlu9DzJLxuDHWnAq8VLuHyBxzchbF4iJb sBFwa9ohlX0C4gqtNoLcGGaRqUE6sGxOSESqaC39JvqP1f+K1SR8RnM6hacxUs2udX0z PlWw== X-Gm-Message-State: AJcUukdq3fMJbpcD6KsjRqaeHku1sLzHKz9I+vWWqCBEGXbEGo920JVR H4akJQ138zBMzlivg4qCKNvbm489 X-Google-Smtp-Source: ALg8bN4EYeX7xRjOX1IkNs4SqkpPBGNVsl0uz7wZhXZCobLKiGPK/0+ccafbt4VC4aPa4V36T2FFZw== X-Received: by 2002:a1c:d082:: with SMTP id h124mr4609246wmg.21.1548184155189; Tue, 22 Jan 2019 11:09:15 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:e51b:82a9:abd5:2eeb? (p200300EA8BF1E200E51B82A9ABD52EEB.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:e51b:82a9:abd5:2eeb]) by smtp.googlemail.com with ESMTPSA id 133sm57897037wme.9.2019.01.22.11.09.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 11:09:14 -0800 (PST) Subject: Re: [PATCH net-next v2 1/4] net: phy: start state machine in phy_start only To: "Lendacky, Thomas" , Andrew Lunn Cc: Florian Fainelli , David Miller , "netdev@vger.kernel.org" , "S-k, Shyam-sundar" References: <36a3f6a9-7f4c-7d51-05aa-71e847132102@gmail.com> <20190121163506.GE8620@lunn.ch> <477939ff-14df-eca7-d652-0164ad6e5f41@gmail.com> From: Heiner Kallweit Message-ID: Date: Tue, 22 Jan 2019 20:09:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 22.01.2019 15:46, Lendacky, Thomas wrote: > On 1/21/19 12:36 PM, Heiner Kallweit wrote: >> On 21.01.2019 17:35, Andrew Lunn wrote: >>> On Sun, Jan 20, 2019 at 10:01:15AM +0100, Heiner Kallweit wrote: >>>> The state machine is a no-op before phy_start() has been called. >>>> Therefore let's enable it in phy_start() only. In phy_start() >>>> let's call phy_start_machine() instead of phy_trigger_machine(). >>>> phy_start_machine is an alias for phy_trigger_machine but it makes >>>> clearer that we start the state machine here instead of just >>>> triggering a run. >>> >>> Hi Heiner >>> >>> Documentation/networking/phy.txt has a section "Doing it all yourself" >>> It would be good to review that, and make sure that documentation is >>> still valid. I'm not sure any MAC driver actually does do it all >>> itself. So it might be worth reviewing the whole document and making >>> updates to remove parts of the text. >>> >> Right. I figured out that I have update phy.txt anyway because I >> recently removed phy_stop_interrupts which is referenced in the >> documentation. OK if we leave the patch series as is and I submit >> the documentation update as a separate patch? > > I think you need to be careful here and not break what is allowed in the > "Doing it all yourself" section. The amd-xgbe driver makes use of this > functionality and does not use phy_start()/phy_stop(). Specifically, it > does: > get_phy_device(); > phy_device_register(); > phy_attach_direct(); > > At which point it uses phy_start_aneg(), phy_read(), phy_write(), > phy_read_status() and phy_aneg_done(). > Thanks for the hint, Tom. I *think* the changes should be safe. However, if AMD has a regression test suite I'd appreciate if you could test the changes upfront or once they reach net-next. > I'm not sure what other drivers out there that make use of this support > within phylib. > > Btw, I did notice this revert that was applied that eliminated a warning > that I started seeing in 5.0, so that is good: > d9f903f6af3d ("net: phy: fix too strict check in phy_start_aneg") > > Thanks, > Tom > >> >>> Andrew >>> >>> >> Heiner >>