From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Tudor Ambarus <tudor.ambarus@microchip.com>,
<mturquette@baylibre.com>, <sboyd@kernel.org>,
<alexandre.belloni@bootlin.com>,
<ludovic.desroches@microchip.com>, <gregkh@linuxfoundation.org>,
<saravanak@google.com>, <geert@linux-m68k.org>
Cc: <mirq-linux@rere.qmqm.pl>, <claudiu.beznea@microchip.com>,
<a.fatoum@pengutronix.de>, <krzk@kernel.org>,
<codrin.ciubotariu@microchip.com>, <linux-clk@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] clk: at91: Fix the declaration of the clocks
Date: Thu, 4 Feb 2021 14:54:04 +0100 [thread overview]
Message-ID: <a220097d-c3eb-4496-488b-0142baef2be7@microchip.com> (raw)
In-Reply-To: <20210203154332.470587-1-tudor.ambarus@microchip.com>
On 03/02/2021 at 16:43, Tudor Ambarus wrote:
> These are all "early clocks" that require initialization just at
> of_clk_init() time. Use CLK_OF_DECLARE() to declare them.
>
> This also fixes a problem that was spotted when fw_devlink was
> set to 'on' by default: the boards failed to boot. The reason is
> that CLK_OF_DECLARE_DRIVER() clears the OF_POPULATED and causes
> the consumers of the clock to be postponed by fw_devlink until
> the second initialization routine of the clock has been completed.
> One of the consumers of the clock is the timer, which is used as a
> clocksource, and needs the clock initialized early. Postponing the
> timers caused the fail at boot.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Looks good to me:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Thanks for the fix Tudor! Best regards,
Nicolas
> ---
> Tested on sama5d2_xplained.
>
> drivers/clk/at91/at91rm9200.c | 3 +--
> drivers/clk/at91/at91sam9260.c | 16 ++++++++--------
> drivers/clk/at91/at91sam9g45.c | 3 +--
> drivers/clk/at91/at91sam9n12.c | 3 +--
> drivers/clk/at91/at91sam9rl.c | 3 ++-
> drivers/clk/at91/at91sam9x5.c | 20 ++++++++++----------
> drivers/clk/at91/sama5d2.c | 3 ++-
> drivers/clk/at91/sama5d3.c | 2 +-
> drivers/clk/at91/sama5d4.c | 3 ++-
> 9 files changed, 28 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c
> index 0fad1009f315..428a6f4b9ebc 100644
> --- a/drivers/clk/at91/at91rm9200.c
> +++ b/drivers/clk/at91/at91rm9200.c
> @@ -215,5 +215,4 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
> * deferring properly. Once this is fixed, this can be switched to a platform
> * driver.
> */
> -CLK_OF_DECLARE_DRIVER(at91rm9200_pmc, "atmel,at91rm9200-pmc",
> - at91rm9200_pmc_setup);
> +CLK_OF_DECLARE(at91rm9200_pmc, "atmel,at91rm9200-pmc", at91rm9200_pmc_setup);
> diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c
> index ceb5495f723a..b29843bea278 100644
> --- a/drivers/clk/at91/at91sam9260.c
> +++ b/drivers/clk/at91/at91sam9260.c
> @@ -491,26 +491,26 @@ static void __init at91sam9260_pmc_setup(struct device_node *np)
> {
> at91sam926x_pmc_setup(np, &at91sam9260_data);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9260_pmc, "atmel,at91sam9260-pmc",
> - at91sam9260_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9260_pmc, "atmel,at91sam9260-pmc", at91sam9260_pmc_setup);
>
> static void __init at91sam9261_pmc_setup(struct device_node *np)
> {
> at91sam926x_pmc_setup(np, &at91sam9261_data);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9261_pmc, "atmel,at91sam9261-pmc",
> - at91sam9261_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9261_pmc, "atmel,at91sam9261-pmc", at91sam9261_pmc_setup);
>
> static void __init at91sam9263_pmc_setup(struct device_node *np)
> {
> at91sam926x_pmc_setup(np, &at91sam9263_data);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9263_pmc, "atmel,at91sam9263-pmc",
> - at91sam9263_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9263_pmc, "atmel,at91sam9263-pmc", at91sam9263_pmc_setup);
>
> static void __init at91sam9g20_pmc_setup(struct device_node *np)
> {
> at91sam926x_pmc_setup(np, &at91sam9g20_data);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9g20_pmc, "atmel,at91sam9g20-pmc",
> - at91sam9g20_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9g20_pmc, "atmel,at91sam9g20-pmc", at91sam9g20_pmc_setup);
> diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c
> index 0214333dedd3..15da0dfe3ef2 100644
> --- a/drivers/clk/at91/at91sam9g45.c
> +++ b/drivers/clk/at91/at91sam9g45.c
> @@ -228,5 +228,4 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
> * The TCB is used as the clocksource so its clock is needed early. This means
> * this can't be a platform driver.
> */
> -CLK_OF_DECLARE_DRIVER(at91sam9g45_pmc, "atmel,at91sam9g45-pmc",
> - at91sam9g45_pmc_setup);
> +CLK_OF_DECLARE(at91sam9g45_pmc, "atmel,at91sam9g45-pmc", at91sam9g45_pmc_setup);
> diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c
> index f9db5316a7f1..7fe435f4b46b 100644
> --- a/drivers/clk/at91/at91sam9n12.c
> +++ b/drivers/clk/at91/at91sam9n12.c
> @@ -255,5 +255,4 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
> * The TCB is used as the clocksource so its clock is needed early. This means
> * this can't be a platform driver.
> */
> -CLK_OF_DECLARE_DRIVER(at91sam9n12_pmc, "atmel,at91sam9n12-pmc",
> - at91sam9n12_pmc_setup);
> +CLK_OF_DECLARE(at91sam9n12_pmc, "atmel,at91sam9n12-pmc", at91sam9n12_pmc_setup);
> diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c
> index 66736e03cfef..ecbabf5162bd 100644
> --- a/drivers/clk/at91/at91sam9rl.c
> +++ b/drivers/clk/at91/at91sam9rl.c
> @@ -186,4 +186,5 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
> err_free:
> kfree(at91sam9rl_pmc);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9rl_pmc, "atmel,at91sam9rl-pmc", at91sam9rl_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9rl_pmc, "atmel,at91sam9rl-pmc", at91sam9rl_pmc_setup);
> diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c
> index 79b9d3667228..5cce48c64ea2 100644
> --- a/drivers/clk/at91/at91sam9x5.c
> +++ b/drivers/clk/at91/at91sam9x5.c
> @@ -302,33 +302,33 @@ static void __init at91sam9g15_pmc_setup(struct device_node *np)
> {
> at91sam9x5_pmc_setup(np, at91sam9g15_periphck, true);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9g15_pmc, "atmel,at91sam9g15-pmc",
> - at91sam9g15_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9g15_pmc, "atmel,at91sam9g15-pmc", at91sam9g15_pmc_setup);
>
> static void __init at91sam9g25_pmc_setup(struct device_node *np)
> {
> at91sam9x5_pmc_setup(np, at91sam9g25_periphck, false);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9g25_pmc, "atmel,at91sam9g25-pmc",
> - at91sam9g25_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9g25_pmc, "atmel,at91sam9g25-pmc", at91sam9g25_pmc_setup);
>
> static void __init at91sam9g35_pmc_setup(struct device_node *np)
> {
> at91sam9x5_pmc_setup(np, at91sam9g35_periphck, true);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9g35_pmc, "atmel,at91sam9g35-pmc",
> - at91sam9g35_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9g35_pmc, "atmel,at91sam9g35-pmc", at91sam9g35_pmc_setup);
>
> static void __init at91sam9x25_pmc_setup(struct device_node *np)
> {
> at91sam9x5_pmc_setup(np, at91sam9x25_periphck, false);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9x25_pmc, "atmel,at91sam9x25-pmc",
> - at91sam9x25_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9x25_pmc, "atmel,at91sam9x25-pmc", at91sam9x25_pmc_setup);
>
> static void __init at91sam9x35_pmc_setup(struct device_node *np)
> {
> at91sam9x5_pmc_setup(np, at91sam9x35_periphck, true);
> }
> -CLK_OF_DECLARE_DRIVER(at91sam9x35_pmc, "atmel,at91sam9x35-pmc",
> - at91sam9x35_pmc_setup);
> +
> +CLK_OF_DECLARE(at91sam9x35_pmc, "atmel,at91sam9x35-pmc", at91sam9x35_pmc_setup);
> diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c
> index 9a5cbc7cd55a..3d1f78176c3e 100644
> --- a/drivers/clk/at91/sama5d2.c
> +++ b/drivers/clk/at91/sama5d2.c
> @@ -372,4 +372,5 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
> err_free:
> kfree(sama5d2_pmc);
> }
> -CLK_OF_DECLARE_DRIVER(sama5d2_pmc, "atmel,sama5d2-pmc", sama5d2_pmc_setup);
> +
> +CLK_OF_DECLARE(sama5d2_pmc, "atmel,sama5d2-pmc", sama5d2_pmc_setup);
> diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c
> index 87009ee8effc..d376257807d2 100644
> --- a/drivers/clk/at91/sama5d3.c
> +++ b/drivers/clk/at91/sama5d3.c
> @@ -255,4 +255,4 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
> * The TCB is used as the clocksource so its clock is needed early. This means
> * this can't be a platform driver.
> */
> -CLK_OF_DECLARE_DRIVER(sama5d3_pmc, "atmel,sama5d3-pmc", sama5d3_pmc_setup);
> +CLK_OF_DECLARE(sama5d3_pmc, "atmel,sama5d3-pmc", sama5d3_pmc_setup);
> diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c
> index 57fff790188b..5cbaac68da44 100644
> --- a/drivers/clk/at91/sama5d4.c
> +++ b/drivers/clk/at91/sama5d4.c
> @@ -286,4 +286,5 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
> err_free:
> kfree(sama5d4_pmc);
> }
> -CLK_OF_DECLARE_DRIVER(sama5d4_pmc, "atmel,sama5d4-pmc", sama5d4_pmc_setup);
> +
> +CLK_OF_DECLARE(sama5d4_pmc, "atmel,sama5d4-pmc", sama5d4_pmc_setup);
>
--
Nicolas Ferre
next prev parent reply other threads:[~2021-02-04 13:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 15:43 [PATCH] clk: at91: Fix the declaration of the clocks Tudor Ambarus
2021-02-03 18:15 ` Saravana Kannan
2021-02-04 12:46 ` Eugen.Hristev
2021-02-04 13:54 ` Nicolas Ferre [this message]
2021-02-08 9:49 ` Tudor.Ambarus
2021-02-10 0:54 ` Stephen Boyd
2021-02-10 0:56 ` Saravana Kannan
2021-02-10 8:51 ` Geert Uytterhoeven
2021-02-10 8:57 ` Saravana Kannan
2021-02-10 9:10 ` Geert Uytterhoeven
2021-02-10 9:00 ` Greg Kroah-Hartman
2021-02-10 16:22 ` Rob Herring
2021-02-10 0:56 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a220097d-c3eb-4496-488b-0142baef2be7@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=a.fatoum@pengutronix.de \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@microchip.com \
--cc=codrin.ciubotariu@microchip.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=mturquette@baylibre.com \
--cc=saravanak@google.com \
--cc=sboyd@kernel.org \
--cc=tudor.ambarus@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).