Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp338002lqj; Wed, 10 Apr 2024 11:55:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVCrtUDbfKLuFcJaoxdXUuUf41aQHSTu1rYtyX2FOWE7lL0qlsVsW6abBRyBLYlgRWghxhZH3Fvm7toaK+ZrXXY3xOSAiM0AnGHOf2nuw== X-Google-Smtp-Source: AGHT+IGjgAPQVj+1/VKhe4ZFsSzLyzJlT9KiF64d++O8zTVyH+h6edkwQeOnk6Q7eAs712qLm/GN X-Received: by 2002:a81:9e07:0:b0:609:bfdf:8a32 with SMTP id m7-20020a819e07000000b00609bfdf8a32mr3503988ywj.44.1712775310850; Wed, 10 Apr 2024 11:55:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712775310; cv=pass; d=google.com; s=arc-20160816; b=Xa4wnfaoO7MaO0QU/fGJBbjYG3JQ/EraHVRTCTjTQAqc7QzB4EfIRV3TTnDvAvgkpI s+Bv/2zok2RtnB/4XLzEf5a+fyc4ZloZVlPZ1d4p8rae5d6rPXttsskQ4xH06QG8stnS 9bLi0rXK4bQ4qKgyJdYWHZjGpoBAjZAk03qR+3CZnm4czDeUvq/0i20LeSh0AsF0DTmo lDX+keHWsthuWhA4/VVX6uOevvWzv1x+1sA7H87q3RYIJCbxr8QUvkh59vWPKhrm6dMK RP5OMH01dJs1o2CpjgcShs6qAEpYxzeLn7qNZlRFj7jmQ2fdvVqpc/6k97KOFXo8w3hQ GgRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=u04ty4XeC+ToVpbCTU/qMTm1yQRrPUKOYomefkfVDGA=; fh=A51vzHpNcyWQyT48wRg1VqLmOXxQEyB3+tVFQWgop5U=; b=t283MRbYrZ7vZg82WQzxkATohd8AP3/+uMqcsaK2Vr2XeEh69v4UghMhqskz/md0Xo Jx7Yic2b2dKzhCqZlHZRZhZut2EOq50b181SB9w9EYWKzNbUveO8owr3vLWy25milteo G5FWI2WeMHHHn92zd2F32pLEIJFd7glMpZavaPdavfftwcC06Nf2Ocvq3zryZPA3IAFL wVVRIh/Ax3FSoZJ8uX0q1XfZXz1hkYHZvol27wobrBibI7f2EAYXaaJ/hoJAenre8Odl xMw9SwEJFgMLz2uIXSWuyPbMvqPhL0PySf64sciqm4wkJ2JYmhH0bcgqmUw9DKPoLOwK +qAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-139225-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139225-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t7-20020a05622a148700b004347a268701si10156507qtx.419.2024.04.10.11.55.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 11:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139225-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-139225-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139225-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C05CA1C238EE for ; Wed, 10 Apr 2024 18:53:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6592E17F376; Wed, 10 Apr 2024 18:53:06 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0A992E405; Wed, 10 Apr 2024 18:53:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712775185; cv=none; b=VT/TvYBVFVmpaODPA3ip1pjqrecNi1xeLq3r+RzcHwCDFUh2w9OtSJOdviARYW8z3h8Gd2AjHWLXIA6CZ0E7EiUZA0Ee4bMCib9vLoc1W4SjXRj/1emWIK3Ia3BTiDt9zR95sM4c/Hp5s0pXpXNCOUydqOZKvCPHRoNqJJpSzvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712775185; c=relaxed/simple; bh=MB/GDTg7r7l13A4bD83ZT67rRbSgLdSJjmRK2twUutQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Nokbph4ybGfF7b8riGLiwpXcSVo5WAQzTGKWGUMpTi61JQ06Bu850fn15scJvsld60lo/Rluv/zQf5HicV6rpPHCY3WwJDJBN8GI3TYMrbbRZnUggnc/n34oh1d/I+pkyMqAG7DNiZoWzixIBnhpeREGo8HVTyahydD5FVdPgGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rud3c-0001D4-1U; Wed, 10 Apr 2024 18:52:28 +0000 Date: Wed, 10 Apr 2024 19:52:24 +0100 From: Daniel Golle To: Paolo Abeni Cc: arinc.unal@arinc9.com, DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Matthias Brugger , AngeloGioacchino Del Regno , =?iso-8859-1?Q?Ren=E9?= van Dorst , Russell King , SkyLake Huang , Heiner Kallweit , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Florian Fainelli Subject: Re: [PATCH net v3] net: dsa: mt7530: fix enabling EEE on MT7531 switch on all boards Message-ID: References: <20240408-for-net-mt7530-fix-eee-for-mt7531-mt7988-v3-1-84fdef1f008b@arinc9.com> <1f2bc5416a0a73756cc1f45f3300619eb201b0a4.camel@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1f2bc5416a0a73756cc1f45f3300619eb201b0a4.camel@redhat.com> On Tue, Apr 09, 2024 at 01:58:56PM +0200, Paolo Abeni wrote: > On Mon, 2024-04-08 at 10:08 +0300, Arınç ÜNAL via B4 Relay wrote: > > From: Arınç ÜNAL > > > > The commit 40b5d2f15c09 ("net: dsa: mt7530: Add support for EEE features") > > brought EEE support but did not enable EEE on MT7531 MACs. EEE is > > enabled on MT7531 switch MACs by pulling the LAN2LED0 pin low on the board > > (bootstrapping), unsetting the EEE_DIS bit on the trap register, or setting > > the internal EEE switch bit on the CORE_PLL_GROUP4 register. Thanks to > > SkyLake Huang (黃啟澤) from MediaTek for providing information on the > > internal EEE switch bit. > > > > There are existing boards that were not designed to pull the pin low. > > Because of that, the EEE status currently depends on the board design. > > > > The EEE_DIS bit on the trap pertains to the LAN2LED0 pin which is usually > > used to control an LED. Once the bit is unset, the pin will be low. That > > will make the active low LED turn on. The pin is controlled by the switch > > PHY. It seems that the PHY controls the pin in the way that it inverts the > > pin state. That means depending on the wiring of the LED connected to > > LAN2LED0 on the board, the LED may be on without an active link. > > > > To not cause this unwanted behaviour whilst enabling EEE on all boards, set > > the internal EEE switch bit on the CORE_PLL_GROUP4 register. > > > > My testing on MT7531 shows a certain amount of traffic loss when EEE is > > enabled. That said, I haven't come across a board that enables EEE. So > > enable EEE on the switch MACs but disable EEE advertisement on the switch > > PHYs. This way, we don't change the behaviour of the majority of the boards > > that have this switch. The mediatek-ge PHY driver already disables EEE > > advertisement on the switch PHYs but my testing shows that it is somehow > > enabled afterwards. Disabling EEE advertisement before the PHY driver > > initialises keeps it off. > > > > With this change, EEE can now be enabled using ethtool. > > > > Fixes: 40b5d2f15c09 ("net: dsa: mt7530: Add support for EEE features") > > Reviewed-by: Florian Fainelli > > Signed-off-by: Arınç ÜNAL > > --- > > Here's some information for the record. EEE could not be enabled on MT7531 > > on most boards using ethtool before this. On MT7988 SoC switch, EEE is > > disabled by default but can be turned on normally using ethtool. EEE is > > enabled by default on MT7530 and there's no need to make changes on the DSA > > subdriver for it. > > --- > > Changes in v3: > > - Remove patch 2, it was revealed that it doesn't fix a bug. > > - Patch 1 > > - Use the internal EEE switch bit provided by SkyLake Huang (黃啟澤). It > > is a better method compared to unsetting the EEE_DIS bit of the trap as > > the latter method causes unwanted behaviour on the LED connected to the > > pin that pertains to the EEE_DIS bit. > > Since this leverages something relatively obscure, it would be great if > someone in the CC list could independently test it. Let's wait a bit > more. I've excessively tested this patch on MT7531 today, and reviewed it today and yesterday. I've also picked it as downstream patch[1] to OpenWrt, so an even wider audience will have the pleasure of working EEE on those switch ICs and in-SoC switches. Tested-by: Daniel Golle Reviewed-by: Daniel Golle [1]: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=98f9154316fe8371c709bd11ae8f263e22075ec6