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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 4902CC43457 for ; Fri, 16 Oct 2020 21:01:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E51A4205CB for ; Fri, 16 Oct 2020 21:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2410483AbgJPVBC (ORCPT ); Fri, 16 Oct 2020 17:01:02 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:60348 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392572AbgJPVBC (ORCPT ); Fri, 16 Oct 2020 17:01:02 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kTWqN-0023YY-3V; Fri, 16 Oct 2020 23:00:55 +0200 Date: Fri, 16 Oct 2020 23:00:55 +0200 From: Andrew Lunn To: Lukasz Stelmach Cc: Heiner Kallweit , Russell King , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?Q?Bart=C5=82omiej_=C5=BBolnierkiewicz?= , Marek Szyprowski Subject: Re: [PATCH v2] net: phy: Prevent reporting advertised modes when autoneg is off Message-ID: <20201016210055.GK139700@lunn.ch> References: <20201016180935.GG139700@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Oct 16, 2020 at 09:37:22PM +0200, Lukasz Stelmach wrote: > It was <2020-10-16 pią 20:09>, when Andrew Lunn wrote: > > On Thu, Oct 15, 2020 at 10:44:35AM +0200, Łukasz Stelmach wrote: > >> Do not report advertised link modes (local and remote) when > >> autonegotiation is turned off. mii_ethtool_get_link_ksettings() exhibits > >> the same behaviour and this patch aims at unifying the behavior of both > >> functions. > > > > Does ethtool allow you to configure advertised modes with autoneg off? > > If it can, it would be useful to see what is being configured, before > > it is actually turned on. > > > > ethtool -s eth42 autoneg off advertise 0xf > > > > does not give an error on an interface i have. > > Yes, this is a good point. Do you think I should change the if()[1] in > mii_ethtool_get_link_ksettings() instead? I really think these two > function should report the same. Yes, i would change mii. Ideally we want all drivers to use phylib/phylink, not mii. So i would modify mii to match phylib/phylink, not the other way around. And then there will be drivers which do their own PHY handling, hidden away in firmware, and not using either of mii or phylib/phylink. You can expect them to be inconsistent. Andrew