Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp512201rwb; Wed, 28 Sep 2022 05:54:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Cp0HFjyo9qDbkHhryxKcSk0mcYpE4P7FAPFwe5gnUKCMCbX+ci0HgO8Xg9vVGNY0opJei X-Received: by 2002:a17:90b:1f86:b0:205:d3d0:1931 with SMTP id so6-20020a17090b1f8600b00205d3d01931mr10509032pjb.211.1664369680112; Wed, 28 Sep 2022 05:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664369680; cv=none; d=google.com; s=arc-20160816; b=KaiN2RidwNtXX4S2XjR2TAjAZGGJiVi7TXQiAUpKmzd5zpd0LnDkq7hLbLt4H7p6Is JJdhnF11gXgyy8qL2vYshB9ecZ3TIbBZcILmUi8nMIDclvf/1HTd19UCVLIg4Vl9j0NJ yOL3R8olX0UDSigov+EUGG6zoianF1V1Dz6PUyjUhdLO6KBwnLoDB5Lj4si+wCLJpmUp 7/39FPu7gQBXdAIsKG1eBE8zPtrPZZUJ/Q3K46dQFEL/IeVcT2INH0fn18NLUMopiY6e yUJZ+eJgI/98l2PWQF3vGTY43K/7Pnbuhfhx06B7fYubJwZ3fXz4X6OWs9e8klez0pX3 11/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Zd06RtS/Nrr3P0Lw0WJBnLGx6z/NA6eV+iimAqCF4Pk=; b=jZMIr6kegvBb0GvXLuWQWxMVfrAKOjHqMmdLYvDA2jKZhvUNOV8gb4iO0xX+/LUe5b x7pDpfP4h5B7tJYMkhtYzT43ZWKmpULoAMWQo71+qYSwT6eZQ8FbWaBaQ7QYJ2Sd9zfR FNmO39aKePIFJaLae/Eu569qFwkdp4RRGocdM/7xCUHAPfqpdODA41sbQdooK587TxXw uoega9OVYoO7gTNDpttAv9z6E7+I9BN9kFttll3AbDN2lXa3RQNLpbdiuXwVhxJHb1As +vHKrbY7A5zaBbg/Dj1jfulDIqsyTAne4xrzDnNo0umS2Nf/2UsfoaU9rWnRuU7srZpE bpwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=L5pMtVVh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot17-20020a17090b3b5100b001f2a654d564si2512712pjb.16.2022.09.28.05.54.27; Wed, 28 Sep 2022 05:54:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=L5pMtVVh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233313AbiI1Mlr (ORCPT + 99 others); Wed, 28 Sep 2022 08:41:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234060AbiI1Ml2 (ORCPT ); Wed, 28 Sep 2022 08:41:28 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 971D682D1B for ; Wed, 28 Sep 2022 05:41:16 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id j16so20197824lfg.1 for ; Wed, 28 Sep 2022 05:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Zd06RtS/Nrr3P0Lw0WJBnLGx6z/NA6eV+iimAqCF4Pk=; b=L5pMtVVhH35O6FplZUIKnVB4to5VmyCNC5Cc0mTqmawGbjafKRBERWs0Hws3oxvd+8 oE9eNYYweSkxTsBzu2WVLV7DCXVzB4c5n0gXInXx8xQT1bQrEtRXCsLIqA6T4QJ6xQE2 8+0i6+7H+SAKY6jm1AVwgo57TvaNxrOJt+uKc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Zd06RtS/Nrr3P0Lw0WJBnLGx6z/NA6eV+iimAqCF4Pk=; b=i5+sAAE5q96PxULkL2V3nB/OVJrMvLRjkB6X1EoZJY8Nrf4aFCPyBtVReBNv8QVVHu 6To0y95h6XO3w/xRAmvREdT55xKJzlkuidtDNI4zOikZMzc7zzvfnloCqZfOB3rq0biu ds+1AS7nKLvDPr7+YA0opnXA27gdsFT3LJZ5HU0BPsr/C5z3pcPZlPDKpL6DJ5meNB4L pwIF67qEi972DjWdhuuJLz6JKTkvLSWWZvKWiKqZ2fbfcHA3IebwHgynIjQx/WDReW3c GHBrE9erMikSptsHCeHFSESV4k1pAia0q3Eq2oSGfZ53CrW4pYL/gjrz9jzyyqwJ6vOp s02w== X-Gm-Message-State: ACrzQf2pqVEr3qt9kNh0E6h3f3RNvRGE4eXHkTFi4SOTl0fni/taZ1Tm /MBC1iQ/PV3/Zp1PWGkzikMvRQ== X-Received: by 2002:a05:6512:b0d:b0:4a1:baad:8d7a with SMTP id w13-20020a0565120b0d00b004a1baad8d7amr8283472lfu.293.1664368874120; Wed, 28 Sep 2022 05:41:14 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id e2-20020ac25462000000b0049b8c0571e5sm467396lfn.113.2022.09.28.05.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 05:41:13 -0700 (PDT) From: Rasmus Villemoes To: Abel Vesa , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Rasmus Villemoes Subject: [PATCH] clk: imx8mp: register driver at arch_initcall time Date: Wed, 28 Sep 2022 14:41:08 +0200 Message-Id: <20220928124108.500369-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have an imx8mp-based board with an external gpio-triggered watchdog. Currently, we don't get to handle that in time before it resets the board. The probe of the watchdog device gets deferred because the SOC's GPIO controller is not yet ready, and the probe of that in turn gets deferred because its clock provider (namely, this driver) is not yet ready. Altogether, the watchdog does not get handled until the late initcall deferred_probe_initcall has made sure all leftover devices have been probed, and that's way too late. Aside from being necessary for our board, this also reduces total boot time because fewer device probes get deferred. Signed-off-by: Rasmus Villemoes --- It would probably be reasonable to do the same to the other imx8m* clk drivers, but I don't have any such hardware to test on. drivers/clk/imx/clk-imx8mp.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c index e89db568f5a8..9ddd39a664cc 100644 --- a/drivers/clk/imx/clk-imx8mp.c +++ b/drivers/clk/imx/clk-imx8mp.c @@ -734,7 +734,19 @@ static struct platform_driver imx8mp_clk_driver = { .of_match_table = imx8mp_clk_of_match, }, }; -module_platform_driver(imx8mp_clk_driver); + +static int __init imx8mp_clk_init(void) +{ + return platform_driver_register(&imx8mp_clk_driver); +} +arch_initcall(imx8mp_clk_init); + +static void __exit imx8mp_clk_exit(void) +{ + platform_driver_unregister(&imx8mp_clk_driver); +} +module_exit(imx8mp_clk_exit); + module_param(mcore_booted, bool, S_IRUGO); MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not"); -- 2.37.2