Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1554769lqt; Wed, 20 Mar 2024 07:29:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUNwLp9QibNUI9pnc/RPkM/XRFdvEy8gwVX/UoBKuezPxPdsK1B5fI3gk7Jzj4bplyLvrxIG1UbEqkFE1zdgJ50N6VdYuJGhx4tFrtd3A== X-Google-Smtp-Source: AGHT+IEQo/aS8UXaMZPzz720248hhRdZqzysTRYrXpM2N1/T+wHK69HNFS8eAUsdHe/G6pymRs8O X-Received: by 2002:a05:620a:1aa8:b0:78a:24f4:4c7a with SMTP id bl40-20020a05620a1aa800b0078a24f44c7amr1894340qkb.51.1710944940542; Wed, 20 Mar 2024 07:29:00 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u10-20020a05620a454a00b00789ea73d108si11452918qkp.16.2024.03.20.07.29.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 07:29:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-109010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109010-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1F0C61C22C15 for ; Wed, 20 Mar 2024 14:29:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BB6F45948; Wed, 20 Mar 2024 14:28:53 +0000 (UTC) Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4C72446DC; Wed, 20 Mar 2024 14:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710944932; cv=none; b=NUPDP1NeyHNq4wkSQQe1l1JdQq1ymHHscNoGh4OS+7j5X28qgFlWd6ufAY7xFS4/7Yllxi3BqIUHYnK9EDB3zL+86ogK9a7gsEciZBmNIV/5lghXHzAK4LipItlcXbPF07gIwjsu7uFI6ncxtQvlZleR0ahmplZyFAUTBoB3W1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710944932; c=relaxed/simple; bh=n7Qf9UdJwRH34jQxS+mXGbofBAvO4f5PiVJjc4drzzQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Y835CaiaEcJ/fU9Rw0WC9nuOW15ZxH71Jpw0y5SKHz18OnDwCDEQW4sRulpzKUpZHIwXiM2p+px8ifhoZdP9fepIwDhdjmhulMr3gJAaiBw3MZlhprspU14ht1RmMTdmob8lvjaCIu8/SVFCguHJnkAyN/smOhmfe0vn8X4Ufk0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-609fd5fbe50so72347627b3.0; Wed, 20 Mar 2024 07:28:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710944929; x=1711549729; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PNEkSKkVWT+9MCxMbsjwWRjuZvzej3VkUeX2qsKaTBc=; b=m4upX/j9I2TqCoxkQR0RCORg4nZkJIaj3ulCYGAPhDMt27ho+1zHKhrfwJND0DrxqC PPleUx1Mznp3poZQkw5jc8GNBG7KCIcTBImj3JE6mnolmvwNr0dpfegmiqP1YydFMjk7 x+YuLGzPiFoJ3ImFQOBo+lb4LUumMQSMqThNI1IEvT2OZ4Z38Z6YzenKtUa8PP+yJ+AX 1vsU5eUhZjIkhAUGp4ovocoMUAlGQ4+G6EU7DP1VMgH4FXsIiOby3Wvi3eS2KzZcOMcm 5k8cDEQ5rdXqbM/B6eIKmDDjWNnYJ+a0NJZUxCvPv2iHqHNFvBL5d3MOIBwKOSUG42ct JTkg== X-Forwarded-Encrypted: i=1; AJvYcCUr8MWml2TeJ5l+3XaWXKljKShdOSVOu+FFAqBlJj6boPOZxQXI19AnRc6Ru4fXjVyM189FnrXMOwgx9mB6/sQ2+qERdPzlcB93Repn X-Gm-Message-State: AOJu0Yyy4LxnMBIlpkiA7OuYiuMNMdFuyytoKMhJxR2h1wNn2DE5oed/ s6wuLUrtDz5GlBd54e2aP3DQOyyWWuxD2e6bv5dtXtNyV9SjrLBXUSWzXKsc8os= X-Received: by 2002:a25:8392:0:b0:dc7:347e:c6f4 with SMTP id t18-20020a258392000000b00dc7347ec6f4mr15212897ybk.32.1710944929159; Wed, 20 Mar 2024 07:28:49 -0700 (PDT) Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com. [209.85.128.176]) by smtp.gmail.com with ESMTPSA id s10-20020a25830a000000b00dcdba3056e9sm2534961ybk.25.2024.03.20.07.28.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Mar 2024 07:28:48 -0700 (PDT) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-609eb3e5a56so73037587b3.1; Wed, 20 Mar 2024 07:28:48 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXvh12kQfhWC3Si7/fUUtOhxYM7ruYESUFdFuhJkfeyLZSMMZz4Bx8s0a6tOtcTS2wJlC3VhM9Z2H5uq6kB8LakXJmXovWA+SYl18zM X-Received: by 2002:a25:68c1:0:b0:dcd:2d3a:b528 with SMTP id d184-20020a2568c1000000b00dcd2d3ab528mr15753354ybc.9.1710944928665; Wed, 20 Mar 2024 07:28:48 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <47bddec7-953d-4ea4-84f1-b0dcf0641baa@sifive.com> In-Reply-To: <47bddec7-953d-4ea4-84f1-b0dcf0641baa@sifive.com> From: Geert Uytterhoeven Date: Wed, 20 Mar 2024 15:28:37 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] clk: starfive: jh7100: Use clk_hw for external input clocks To: Samuel Holland Cc: linux-clk@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Emil Renner Berthing , Hal Feng , Michael Turquette , Stephen Boyd , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Krzysztof Kozlowski , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Samuel, On Wed, Mar 20, 2024 at 2:31=E2=80=AFPM Samuel Holland wrote: > On 2024-03-20 6:24 AM, Geert Uytterhoeven wrote: > > The Starfive JH7100 clock driver does not use the DT "clocks" property > > to find the external main input clock, but instead relies on the name o= f > > the actual clock provider ("osc_sys"). This is fragile, and caused > > breakage when sanitizing clock node names in DTS. > > > > Fix this by obtaining the external main input clock using > > devm_clk_get(), and passing the returned clk_hw object to > > devm_clk_hw_register_fixed_factor_parent_hw(). > > > > While name-based look-up of the other external input clocks works as-is= , > > convert them to a similar clk_hw-based scheme to increase uniformity, > > and to decrease the number of name-based look-ups. > > > > Fixes: f03606470886 ("riscv: dts: starfive: replace underscores in node= names") > > Fixes: 4210be668a09ee20 ("clk: starfive: Add JH7100 clock generator dri= ver") > > Signed-off-by: Geert Uytterhoeven > > --- a/drivers/clk/starfive/clk-starfive-jh7100.c > > +++ b/drivers/clk/starfive/clk-starfive-jh7100.c > > @@ -284,8 +293,11 @@ static struct clk_hw *jh7100_clk_get(struct of_pha= ndle_args *clkspec, void *data > > > > static int __init clk_starfive_jh7100_probe(struct platform_device *pd= ev) > > { > > + static const char *jh7100_ext_clk[EXT_NUM_CLKS] =3D > > + { "osc_sys", "osc_aud", "gmac_rmii_ref", "gmac_gr_mii_rxc= lk" }; > > This should be __initconst. Otherwise: With - static const char *jh7100_ext_clk[EXT_NUM_CLKS] =3D + static const char *jh7100_ext_clk[EXT_NUM_CLKS] __initconst =3D I get: drivers/clk/starfive/clk-starfive-jh7100.c: In function =E2=80=98clk_starfive_jh7100_probe=E2=80=99: drivers/clk/starfive/clk-starfive-jh7100.c:35:37: error: =E2=80=98jh7100_clk_data=E2=80=99 causes a section type conflict with =E2= =80=98jh7100_ext_clk=E2=80=99 35 | static const struct jh71x0_clk_data jh7100_clk_data[] __initconst =3D { | ^~~~~~~~~~~~~~~ drivers/clk/starfive/clk-starfive-jh7100.c:296:28: note: =E2=80=98jh7100_ext_clk=E2=80=99 was declared here 296 | static const char *jh7100_ext_clk[EXT_NUM_CLKS] __initconst =3D | ^~~~~~~~~~~~~~ which is a bit strange... What am I missing? > Reviewed-by: Samuel Holland Thanks! Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds