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 E7179C83F01 for ; Wed, 30 Aug 2023 19:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239122AbjH3TaG (ORCPT ); Wed, 30 Aug 2023 15:30:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244039AbjH3MSC (ORCPT ); Wed, 30 Aug 2023 08:18:02 -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 C765B198 for ; Wed, 30 Aug 2023 05:17:58 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qbK8h-0006sH-9B; Wed, 30 Aug 2023 14:17:39 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qbK8g-00012d-51; Wed, 30 Aug 2023 14:17:38 +0200 Date: Wed, 30 Aug 2023 14:17:38 +0200 From: Oleksij Rempel To: Lukasz Majewski Cc: Eric Dumazet , Andrew Lunn , davem@davemloft.net, Woojung Huh , Vladimir Oltean , Tristram.Ha@microchip.com, Florian Fainelli , Jakub Kicinski , Paolo Abeni , UNGLinuxDriver@microchip.com, Russell King , Heiner Kallweit , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] net: phy: Provide Module 4 KSZ9477 errata (DS80000754C) Message-ID: <20230830121738.GJ31399@pengutronix.de> References: <20230830092119.458330-1-lukma@denx.de> <20230830092119.458330-2-lukma@denx.de> <20230830101813.GG31399@pengutronix.de> <20230830125224.1012459f@wsk> <20230830105941.GH31399@pengutronix.de> <20230830135151.683303db@wsk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230830135151.683303db@wsk> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 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 On Wed, Aug 30, 2023 at 01:51:51PM +0200, Lukasz Majewski wrote: > Hi Oleksij, > It looks like the most optimal solution would be the one proposed by > Tristam: > https://www.spinics.net/lists/netdev/msg932044.html In this case, please add the reason why it would work on this HW and will not break by any changes in PHYlib or micrel.c driver. If I remember it correctly, in KSZ9477 variants, if you write to EEE advertisement register, it will affect the state of a EEE capability register. Which break IEEE 802.3 specification and the reason why ksz9477_get_features() actually exist. But can be used as workaround if it is written early enough before PHYlib tried to read EEE capability register. Please confirm my assumption by applying your workaround and testing it with ethtool --show-eee lanX. It should be commented in the code with all kind of warnings: Don't move!!! We use one bug to workaround another bug!!! If PHYlib start scanning PHYs before this code is executed, then thing may break!! ... it is broken as hell.... -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |