Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6835000rdb; Tue, 2 Jan 2024 15:42:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmCvW3kiHXsqb1lEgUe5Yv/fS5NwSFyzEfmGcsUXxzLidwVrEYd0xRnYkxG+Rhm4C0kRtu X-Received: by 2002:a50:c2d1:0:b0:553:7078:3970 with SMTP id u17-20020a50c2d1000000b0055370783970mr144880edf.42.1704238977659; Tue, 02 Jan 2024 15:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704238977; cv=none; d=google.com; s=arc-20160816; b=oLCkHo81pSpzVqsR3+vDE8Xh8yq4SP8MXInBFm2w/gFSvk/jkBQEyw+oX5q9KF8JbT 1JX8OGLRO2XnUh+NcuW45NBSsUksVpVf8OqqFlMMMfYLpK1pA5NhyHlFsQSlHU8XIEjE tkBxwsu2NVhMYoKsDQysQwfOfr5sl4qMUQMobbmHhVDd+06VDMfjRf2xkmP7Cv6Lr7ya b8uzmd0DfBnh57vHO2lsVfGcgyTzNB7932v4+TeGBjlF83UwRgAbaslNP0bKkGuVHm7V QpMeUKoSvBzl4NIupWaMl+92KRpzCKCZ55dcnG2lz/1RQZQ3TRggpcNnH+i3D93wDiyh +p+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:dkim-signature; bh=iWlfmmtjyVtjYp9ruDZWdsMgrD0jOAXEQ9n51pXb2hQ=; fh=fytWEyHcFpsjprnM8Kjlfeq6GLtTbzEt4kg/h2Mnjv4=; b=t2nKqK9TIu2SfYCIyT6lXSGYGOTbOYKFJId505Hy4gY9YFcigSmcL8dGWkyAvp58Nu Oih5PBMsiVlWUv5TYrtem5m/uDJggZI3KDYWDjJIMlQv4cZswCunZzjiRbOBsjtaCZOy 63Iw5jQBtDJ9q1t/Fg3sSB4CVTvoaXSBSh4V7f3YEmUYzeoPC/EydvmBMXKD9ZOHMz94 6+Ld9pd0hDwXXRthPqkkdlZMpNJdBD36BbsQDui3FD9ZEmuMeH1g8BnyAOgr8HuZl09Q Jgeu8J4k35TlZqauYxaoGx1cGgychL3ayvwzTpT9no/RRw8TgFyUpx/JH/SvjXOpHqyN 9d6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="t19M/dx2"; spf=pass (google.com: domain of linux-kernel+bounces-14981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h19-20020a056402281300b00554120558efsi11191148ede.382.2024.01.02.15.42.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 15:42:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="t19M/dx2"; spf=pass (google.com: domain of linux-kernel+bounces-14981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 694C21F22E38 for ; Tue, 2 Jan 2024 23:42:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 336BE1798F; Tue, 2 Jan 2024 23:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t19M/dx2" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56A1C17981; Tue, 2 Jan 2024 23:42:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB434C433C8; Tue, 2 Jan 2024 23:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704238967; bh=YfSWBKVajWDhWg1Sr7vlQP066tr0a5p80GHvnjAdI9s=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=t19M/dx2bZFP0Gz1V9oTm8f434RnWH6i4JxgQvHlZ6snSX06ZfxN1LrLgr6xTZFn2 IM4REYp/g7Rs8qmTRshvRLkkcklTVBNjjahvR44eIireFqUSvx5+i1UjNXu6Gm0h3M 9qBgMC1Pv981+/tA45ssTJCypQj/B1HgLSgGNnT9AAAfPRRtgHAUHRpfiMIYqjSfd1 OvgnzLvYqeWUUVWGANka1d0uxst0xBJ4A427xy8fEbvwMWTtQlwzRMuDZsrev7CoOn AA/r1MWTTEDRINB+kHDIHc3ZhNqNC3RRswROAHMQKm8VlwbpENf4N2RI2+do/rTexM Ik3/BuCnKuXLw== Message-ID: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20231218-mbly-clk-v1-0-44ce54108f06@bootlin.com> <20231218-mbly-clk-v1-3-44ce54108f06@bootlin.com> Subject: Re: [PATCH 3/5] clk: eyeq5: add controller From: Stephen Boyd Cc: Vladimir Kondratiev , linux-mips@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk To: Conor Dooley , Gregory CLEMENT , Krzysztof Kozlowski , Michael Turquette , Rob Herring , Thomas Bogendoerfer , =?utf-8?q?Th=C3=A9o?= Lebrun Date: Tue, 02 Jan 2024 15:42:45 -0800 User-Agent: alot/0.10 Quoting Th=C3=A9o Lebrun (2023-12-22 03:25:12) > On Wed Dec 20, 2023 at 12:09 AM CET, Stephen Boyd wrote: > > Quoting Th=C3=A9o Lebrun (2023-12-18 09:14:18) >=20 > > > + of_clk_add_hw_provider(np, of_clk_hw_onecell_get, data); > > > +} > > > + > > > +CLK_OF_DECLARE_DRIVER(eq5c, "mobileye,eyeq5-clk", eq5c_init); > > > > Please use a platform driver. >=20 > I've been trying to do that but I had a stall at boot. I initially > associated it with the UART driver acquiring a clock too early but > instead it is the CPU timer clocksource driver that consumes one of our > clock way earlier than any platform driver initialisation. >=20 > The clocksource driver we are talking about is this one for reference: > https://elixir.bootlin.com/linux/v6.6.8/source/drivers/clocksource/mips-g= ic-timer.c >=20 > Its usage of TIMER_OF_DECLARE means it gets probed by timer_probe -> > plat_time_init -> time_init -> start_kernel. This is way before any > initcalls. Our prior use of CLK_OF_DECLARE_DRIVER meant that we got > probed by of_clk_init -> plat_time_init. >=20 > I'm guessing we are not the first one in this situation; any advice on > how to deal with it? >=20 You guessed correctly. In that case, use CLK_OF_DECLARE_DRIVER() and register the clk(s) needed for the timer in that function. Other clks shall be registered with a platform driver.