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 B7506C636CC for ; Sat, 11 Feb 2023 16:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbjBKQLz (ORCPT ); Sat, 11 Feb 2023 11:11:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbjBKQLw (ORCPT ); Sat, 11 Feb 2023 11:11:52 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E8F28A66; Sat, 11 Feb 2023 08:11:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=QIsGxB3foIcUzmrB1itBt2fP/mbnt75It4usqWhNhqE=; b=P7 vtKGwpGWflFG3N+B1RRIjxiM27gprx3GRBS7un6JwuWk8/FV4d9LEQ4CwLk+IFnSxLF22ydIkzt32 X9aBWQyuop1jYaVXEqsxufkvQT5F3P3eUtKeDSavDF2GGB9RX3+B35o5Hygx+fQ2daJPJiXTvnERk aEASDZm9A+FlUko=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pQsTP-004iBC-Gy; Sat, 11 Feb 2023 17:11:35 +0100 Date: Sat, 11 Feb 2023 17:11:35 +0100 From: Andrew Lunn To: Cristian Ciocaltea Cc: Lee Jones , Rob Herring , Krzysztof Kozlowski , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Emil Renner Berthing , Conor Dooley , Palmer Dabbelt , Paul Walmsley , Albert Ou , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Sagar Kadam , Yanhong Wang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com Subject: Re: [PATCH 08/12] net: stmmac: Add glue layer for StarFive JH7100 SoC Message-ID: References: <20230211031821.976408-1-cristian.ciocaltea@collabora.com> <20230211031821.976408-9-cristian.ciocaltea@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230211031821.976408-9-cristian.ciocaltea@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + > +#define JH7100_SYSMAIN_REGISTER28 0x70 > +/* The value below is not a typo, just really bad naming by StarFive ¯\_(ツ)_/¯ */ > +#define JH7100_SYSMAIN_REGISTER49 0xc8 Seems like the comment should be one line earlier? There is value in basing the names on the datasheet, but you could append something meaningful on the end: #define JH7100_SYSMAIN_REGISTER49_DLYCHAIN 0xc8 ??? > + if (!of_property_read_u32(np, "starfive,gtxclk-dlychain", >xclk_dlychain)) { > + ret = regmap_write(sysmain, JH7100_SYSMAIN_REGISTER49, gtxclk_dlychain); > + if (ret) > + return dev_err_probe(dev, ret, "error selecting gtxclk delay chain\n"); > + } You should probably document that if starfive,gtxclk-dlychain is not found in the DT blob, the value for the delay chain is undefined. It would actually be better to define it, set it to 0 for example. That way, you know you don't have any dependency on the bootloader for example. Andrew