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=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 7C091C433E0 for ; Tue, 9 Feb 2021 10:59:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D04364DC3 for ; Tue, 9 Feb 2021 10:59:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232147AbhBIK7j (ORCPT ); Tue, 9 Feb 2021 05:59:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbhBIKzx (ORCPT ); Tue, 9 Feb 2021 05:55:53 -0500 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 9D8A2C061797; Tue, 9 Feb 2021 02:55:12 -0800 (PST) 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=3/TUpESOFMiIecNRcH48chaK6zVBZGJlr46X+upUebA=; b=ORIeczxG6jbTmSEAuNEG1JdrR xGoiTu7oGesBibfvig3oGF/eDxko88zQN52GBNVNFyzH/LgbCNH5qlaS69+llTaJD2rTIwzASf9US UK3zl9y5TBYF31nbpMxSomHFgmJazlF02ICFaFTamhXN4wI4bRmdnbcgibxXm3TqLyywpDdkjRyY9 bkGCE3zuY3Zar5eR9uiiCPSMzZjwhT+mgRfrKTwFbH0qVG0ck78s/YSEJfHmYzApX7zxBpNmdZEtI jFRsdcjUxCqyn8ebdImG5vBccCYanY0+lbY97AH218dHtdUtqDYX2PtCqJH3tJXPa1h1LtixSgNt2 IkiPojVMA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:41152) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9Qfb-0003J3-5t; Tue, 09 Feb 2021 10:55:00 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1l9QfX-0003zQ-Vc; Tue, 09 Feb 2021 10:54:55 +0000 Date: Tue, 9 Feb 2021 10:54:55 +0000 From: Russell King - ARM Linux admin To: Serge Semin Cc: Heiner Kallweit , Serge Semin , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Joao Pinto , Jose Abreu , Andrew Lunn , Alexey Malahov , Pavel Parkhomenko , Vyacheslav Mitrofanov , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode Message-ID: <20210209105455.GO1463@shell.armlinux.org.uk> References: <20210208140341.9271-1-Sergey.Semin@baikalelectronics.ru> <20210208140341.9271-2-Sergey.Semin@baikalelectronics.ru> <8300d9ca-b877-860f-a975-731d6d3a93a5@gmail.com> <20210209101528.3lf47ouaedfgq74n@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209101528.3lf47ouaedfgq74n@mobilestation> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King - ARM Linux admin Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 01:15:28PM +0300, Serge Semin wrote: > On Mon, Feb 08, 2021 at 09:14:02PM +0100, Heiner Kallweit wrote: > > Nice analysis. Alternatively to duplicating this code piece we could > > export mmd_phy_indirect(). But up to you. > > I also considered creating a generic method to access the MMD > registers of a generic PHY, something like phy_read()/phy_write(), but > for MMD (alas just exporting mmd_phy_indirect() would not be enough). > But as I see it such methods need to be created only after we get to > have at least several places with duplicating direct MMD-read/write > patterns. Doing that just for a single place seems redundant. Anyway it's > up to maintainers to decide whether they want to see a generic part > of the phy_read_mmd()/phy_write_mmd() methods being detached and > exported as something like genphy_{read,write}_mmd() methods. I can do > that in v2 if you ask me to. Please not genphy_* - that namespace is used for up-to-1G PHYs. I thought about suggesting what you are proposing, but the problem is this is just making things less and less efficient. Every time we break a function up and export it, we increase the execution overhead of the code. That said, the PHY accesses are relatively slow. My opinion is that as this is just a single location at the moment, it is not worth the effort - but if we get more of examples of this, then it makes sense to provide the common accessor. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! 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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 44C4CC433E0 for ; Tue, 9 Feb 2021 10:56:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CEC0964E27 for ; Tue, 9 Feb 2021 10:56:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEC0964E27 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TUvLrcdMFDBB1y+eKt28cCMQPy2G5wvayCE4Zxr5gOo=; b=UYMNYmU0fb+tX+lMrK+pWNhu6 JngoWy3cm/o2eCQw8kzSt755AOvBMoUwwZOBMLGG/ASnESJRq7c6uDXCY85ROSeWwYURbfqeBukYz UO6hmyhCpvmJXgXWlfLjciD6nLIVnFpQ70mBYXzsncnv5JjhnuoLd6Xg6FKC50oBM3kpmLVtjOy6C U8Y9oF2t7o/AW1/Gp9WbofsvqZkL2nECbfIbF5pl70pEsVdrAatuRaQJHjo8NeL4vRCAIV3jHq9xT RX00PErlfb9v+R53wh7yqi9rkBAwdNezmw5PvQYEyDcxqOqZyKSBg36XHEUSTU1Yr/5D30sJeWdvA /ZzBJV4Dg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9Qfr-0004hI-UE; Tue, 09 Feb 2021 10:55:15 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9Qfo-0004gF-Qx for linux-arm-kernel@lists.infradead.org; Tue, 09 Feb 2021 10:55:13 +0000 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=3/TUpESOFMiIecNRcH48chaK6zVBZGJlr46X+upUebA=; b=ORIeczxG6jbTmSEAuNEG1JdrR xGoiTu7oGesBibfvig3oGF/eDxko88zQN52GBNVNFyzH/LgbCNH5qlaS69+llTaJD2rTIwzASf9US UK3zl9y5TBYF31nbpMxSomHFgmJazlF02ICFaFTamhXN4wI4bRmdnbcgibxXm3TqLyywpDdkjRyY9 bkGCE3zuY3Zar5eR9uiiCPSMzZjwhT+mgRfrKTwFbH0qVG0ck78s/YSEJfHmYzApX7zxBpNmdZEtI jFRsdcjUxCqyn8ebdImG5vBccCYanY0+lbY97AH218dHtdUtqDYX2PtCqJH3tJXPa1h1LtixSgNt2 IkiPojVMA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:41152) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9Qfb-0003J3-5t; Tue, 09 Feb 2021 10:55:00 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1l9QfX-0003zQ-Vc; Tue, 09 Feb 2021 10:54:55 +0000 Date: Tue, 9 Feb 2021 10:54:55 +0000 From: Russell King - ARM Linux admin To: Serge Semin Subject: Re: [PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode Message-ID: <20210209105455.GO1463@shell.armlinux.org.uk> References: <20210208140341.9271-1-Sergey.Semin@baikalelectronics.ru> <20210208140341.9271-2-Sergey.Semin@baikalelectronics.ru> <8300d9ca-b877-860f-a975-731d6d3a93a5@gmail.com> <20210209101528.3lf47ouaedfgq74n@mobilestation> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210209101528.3lf47ouaedfgq74n@mobilestation> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_055513_001559_65F1CC6D X-CRM114-Status: GOOD ( 16.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Andrew Lunn , Joao Pinto , linux-kernel@vger.kernel.org, Alexandre Torgue , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Vyacheslav Mitrofanov , Serge Semin , Alexey Malahov , Jose Abreu , Pavel Parkhomenko , Maxime Coquelin , Jakub Kicinski , Giuseppe Cavallaro , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Heiner Kallweit Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Feb 09, 2021 at 01:15:28PM +0300, Serge Semin wrote: > On Mon, Feb 08, 2021 at 09:14:02PM +0100, Heiner Kallweit wrote: > > Nice analysis. Alternatively to duplicating this code piece we could > > export mmd_phy_indirect(). But up to you. > > I also considered creating a generic method to access the MMD > registers of a generic PHY, something like phy_read()/phy_write(), but > for MMD (alas just exporting mmd_phy_indirect() would not be enough). > But as I see it such methods need to be created only after we get to > have at least several places with duplicating direct MMD-read/write > patterns. Doing that just for a single place seems redundant. Anyway it's > up to maintainers to decide whether they want to see a generic part > of the phy_read_mmd()/phy_write_mmd() methods being detached and > exported as something like genphy_{read,write}_mmd() methods. I can do > that in v2 if you ask me to. Please not genphy_* - that namespace is used for up-to-1G PHYs. I thought about suggesting what you are proposing, but the problem is this is just making things less and less efficient. Every time we break a function up and export it, we increase the execution overhead of the code. That said, the PHY accesses are relatively slow. My opinion is that as this is just a single location at the moment, it is not worth the effort - but if we get more of examples of this, then it makes sense to provide the common accessor. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel