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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 11DC2C433C1 for ; Sat, 27 Mar 2021 14:46:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE988619A9 for ; Sat, 27 Mar 2021 14:46:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbhC0OqU (ORCPT ); Sat, 27 Mar 2021 10:46:20 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:51084 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbhC0OqI (ORCPT ); Sat, 27 Mar 2021 10:46:08 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lQAC8-00DLHu-FL; Sat, 27 Mar 2021 15:45:44 +0100 Date: Sat, 27 Mar 2021 15:45:44 +0100 From: Andrew Lunn To: Ilya Lipnitskiy Cc: Sean Wang , Landen Chao , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Philipp Zabel , Russell King , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next,v2] net: dsa: mt7530: clean up core and TRGMII clock setup Message-ID: References: <20210327055543.473099-1-ilya.lipnitskiy@gmail.com> <20210327060752.474627-1-ilya.lipnitskiy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210327060752.474627-1-ilya.lipnitskiy@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2021 at 11:07:52PM -0700, Ilya Lipnitskiy wrote: > Three minor changes: > > - When disabling PLL, there is no need to call core_write_mmd_indirect > directly, use the core_write wrapper instead like the rest of the code > in the function does. This change helps with consistency and > readability. Move the comment to the definition of > core_read_mmd_indirect where it belongs. > > - Disable both core and TRGMII Tx clocks prior to reconfiguring. > Previously, only the core clock was disabled, but not TRGMII Tx clock. > So disable both, then configure them, then re-enable both, for > consistency. > > - The core clock enable bit (REG_GSWCK_EN) is written redundantly three > times. Simplify the code and only write the register only once at the > end of clock reconfiguration to enable both core and TRGMII Tx clocks. > > Tested on Ubiquiti ER-X running the GMAC0 and MT7530 in TRGMII mode. > > Signed-off-by: Ilya Lipnitskiy Thanks for moving the comment. Reviewed-by: Andrew Lunn Andrew