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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 80319C433F5 for ; Fri, 17 Sep 2021 14:58:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 636DA61212 for ; Fri, 17 Sep 2021 14:58:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239030AbhIQO73 (ORCPT ); Fri, 17 Sep 2021 10:59:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236034AbhIQO72 (ORCPT ); Fri, 17 Sep 2021 10:59:28 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 508CDC061764 for ; Fri, 17 Sep 2021 07:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rwghMVgjahZVVBvOrycIfyU14EpdySi2pjQ0lErZJm4=; b=QripXe0n1mgrqQVkXeAil0QhUr AAmo++xwtpypFI7pmWQQe3GYhYil+RLf6mpvcCkRfoG7o1olrxEKbaox9J8BfkKcK8sSoVXAzJfCi IDx/dQ3zOM+bwojY18RGJdeEWyUtYGOZUrcDqY+Co2sdVP8eLtv++Wgs1ycG/oY5Sx/kUSVxkLLU3 VszT0A9r0yEzpRMg723+80qBH4kiLk2UYngTcW1IsSiVwxptX+jLEFvuCZaRRm4WcEJIxWXq0a2F/ zGY3nWuDhj2cZbOmqF5SdF+h67Sj9lh4NUtxe4glIRd9MtmZNJKvMvZgF5d44tWGeDbSbtNuLj1vx tdm8qmdQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45126) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mRFJU-0007nN-8w; Fri, 17 Sep 2021 15:58:03 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mRFJR-00060T-Iz; Fri, 17 Sep 2021 15:58:01 +0100 Date: Fri, 17 Sep 2021 15:58:01 +0100 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org, Marek Beh__n , Jakub Kicinski Subject: Re: [PATCH net-next] net: phy: marvell10g: add downshift tunable support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Sep 17, 2021 at 04:45:03PM +0200, Andrew Lunn wrote: > > +static int mv3310_set_downshift(struct phy_device *phydev, u8 ds) > > +{ > > + struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev); > > + u16 val; > > + int err; > > + > > + if (!priv->has_downshift) > > + return -EOPNOTSUPP; > > + > > + if (ds == DOWNSHIFT_DEV_DISABLE) > > + return phy_clear_bits_mmd(phydev, MDIO_MMD_PCS, MV_PCS_DSC1, > > + MV_PCS_DSC1_ENABLE); > > + > > + /* FIXME: The default is disabled, so should we disable? */ > > + if (ds == DOWNSHIFT_DEV_DEFAULT_COUNT) > > + ds = 2; > > Hi Russell > > Rather than a FIXME, maybe just document that the hardware default is > disabled, which does not make too much sense, so default to 2 attempts? Sadly, the downshift parameters aren't documented at all in the kernel, and one has to dig into the ethtool source to find out what they mean: DOWNSHIFT_DEV_DEFAULT_COUNT - ethtool --set-phy-tunable ethN downshift on DOWNSHIFT_DEV_DISABLE - ethtool --set-phy-tunable ethN downshift off otherwise: ethtool --set-phy-tunable ethN downshift count N This really needs to be documented somewhere in the kernel. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!