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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B94A1C636CD for ; Fri, 10 Feb 2023 10:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=eHVnSNLp24VkU+F+vlAEyrEUlulHg16Kzi8rB+EhoXw=; b=i1pTfO7xRP6d57 GDInpoHEOiWZ3knL0TzL6PdJhJ80SLMv4ziCQzgfBrQr6O2p9jHQspwbhIl9ZfpdAAFrU5SydA9qG zjN7QS1a20Di0KK8YEYurMUjWOW7QYVjSN1CYHYB/F/f2KyRr91jkHXibLvIjybgwdc8AV7YdkGTA V1IdH8y/7qs/5Aerp+xvbGIg5TajMRk3xdVPfZp5DVvGZKXLrfKkEhZQERsYQhqqV5FidFwrfmIE1 huM2no9x/m7DA6mL4mnarF4bIGINPDpg/V/5FplvX5+Fpp5pZk/R01aYFXfduUQHApv0aLuyvhAWf cOZ3TIBVNf6a3C6QtRcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQQoA-005JzH-Iz; Fri, 10 Feb 2023 10:39:10 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQQns-005Jrj-Ek; Fri, 10 Feb 2023 10:38:54 +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=2OUA7HlYXogwM8qpdJDrZwtYflzFDq9HBMiwA08oRKM=; b=HMRpaiphWDk/DkQhDFVSnenS7r QWasYa8MlAUK5cojxWkk1gmQXQsgQgXYLd/08Ag1P5+Ca0G00vbY0uLRaLn8aErbrph/gK8FGDmo7 kL0N1dhqdIN/FwfM07L3HqzX//P0Ujig9IYQVDtBa21jkukIP01mpkfznDTvUA1Y6RHEEuaVrNRfO NUSf2QGWkBkeHEuJtddur+5ih+hRPRJwPePwuKtDyGOxp8oV5Vy/nGuc7+9pgwA22zm1MYYjXdeaP DR6Ixx3mDorResI5ys8WhtK+qg7IYGpHulnErtVo9CzKh8sYU4tEmT5/AUCt2IBCjUAWE70J52PWN aksFGXhQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36506) 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 1pQQnq-0001II-Ev; Fri, 10 Feb 2023 10:38:50 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pQQno-0005Us-Su; Fri, 10 Feb 2023 10:38:48 +0000 Date: Fri, 10 Feb 2023 10:38:48 +0000 From: "Russell King (Oracle)" To: Daniel Golle Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Heiner Kallweit , Lorenzo Bianconi , Mark Lee , John Crispin , Felix Fietkau , AngeloGioacchino Del Regno , Matthias Brugger , DENG Qingfang , Landen Chao , Sean Wang , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Andrew Lunn , Jianhui Zhao , =?iso-8859-1?Q?Bj=F8rn?= Mork Subject: Re: [PATCH v2 06/11] net: ethernet: mtk_eth_soc: only write values if needed Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230210_023852_539278_D326E052 X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 07, 2023 at 02:21:25PM +0000, Daniel Golle wrote: > @@ -106,16 +101,21 @@ static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode, > regmap_update_bits(mpcs->regmap, mpcs->ana_rgc3, > RG_PHY_SPEED_3_125G, rgc3); > > + /* Setup the link timer and QPHY power up inside SGMIISYS */ > + link_timer = phylink_get_link_timer_ns(interface); > + if (link_timer < 0) > + return link_timer; I know I asked for this to be placed inside this if(), but I'd prefer it if it were before any register state was touched, so if it returns an error then no register state is affected by the pcs_config() call. IIRC, we don't touch any state before the if(), so it should be a matter of placing it as one of the first things in the if() block. Thanks! -- 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