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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF873C77B7A for ; Wed, 31 May 2023 08:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235129AbjEaIMj (ORCPT ); Wed, 31 May 2023 04:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbjEaIMg (ORCPT ); Wed, 31 May 2023 04:12:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95D39BE for ; Wed, 31 May 2023 01:12:35 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4GwT-0006Bx-Ry; Wed, 31 May 2023 10:12:25 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q4GwS-0043cp-Ad; Wed, 31 May 2023 10:12:24 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q4GwR-00H83J-9T; Wed, 31 May 2023 10:12:23 +0200 Date: Wed, 31 May 2023 10:12:23 +0200 From: Oleksij Rempel To: Lukasz Majewski Cc: Andrew Lunn , Russell King , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] net: dsa: slave: Advertise correct EEE capabilities at slave PHY setup Message-ID: References: <20230530122621.2142192-1-lukma@denx.de> <32aa2c0f-e284-4c5e-ba13-a2ea7783c202@lunn.ch> <20230530154039.4552e08a@wsk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230530154039.4552e08a@wsk> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lukasz, On Tue, May 30, 2023 at 03:40:39PM +0200, Lukasz Majewski wrote: > Hi Andrew, > > > On Tue, May 30, 2023 at 02:26:21PM +0200, Lukasz Majewski wrote: > > > One can disable in device tree advertising of EEE capabilities of > > > PHY when 'eee-broken-100tx' property is present in DTS. > > > > > > With DSA switch it also may happen that one would need to disable > > > EEE due to some network issues. > > > > Is EEE actually broken in the MAC/PHY combination? > > > > Problem is that when I connect on this project some non-manageable > switches (which by default have EEE enabled), then I observe very rare > and sporadic link loss and reconnection. The interesting question is, do other link partner or local system is broken? In some cases, not proper tx-timer was triggering this kind of symptoms. And timer configuration may depend on the link speed. So, driver may be need to take care of this. > Disabling EEE solves the problem. > > > You should not be using this DT option for configuration. It is there > > because there is some hardware which is truly broken, and needs EEE > > turned off. > > Yes, I do think that the above sentence sums up my use case. As Andrew already described, current linux kernel EEE support is not in the best shape, it is hard to see the difference between broken HW and SW. > > If EEE does work, but you need to turn it off because of latency etc, > > then please use ethtool. > > > > Yes, correct - it is possible to disable the EEE with > > ethtool --set-eee lan2 eee off > > However, as I've stated in the mail, I cannot re-enable EEE once > disabled with: > > ethtool --set-eee lan2 eee on > > ethtool --show-eee lan2 > EEE Settings for lan2: > EEE status: not supported > > > As the capability register shows value of 0. Some PHYs indeed have this issues: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/micrel.c?h=v6.4-rc4#n1402 In case of your older kernel version, you will need to fake access to the EEE caps register. Regards, Oleksij