[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bc268247-b081-463b-93eb-ea8eca7de75b@oss.nxp.com>
Date: Fri, 1 Aug 2025 10:36:21 +0300
From: Ghennadi Procopciuc <ghennadi.procopciuc@....nxp.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>, tglx@...utronix.de
Cc: S32@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 20/20] clocksource/drivers/nxp-pit: Add NXP Automotive
s32g2 / s32g3 support
On 7/30/2025 11:27 AM, Daniel Lezcano wrote:
[...]
> -static int __init pit_timer_init(struct device_node *np)
> +static int pit_timer_init(struct device_node *np)
> {
> struct pit_timer *pit;
> struct clk *pit_clk;
> @@ -262,16 +297,31 @@ static int __init pit_timer_init(struct device_node *np)
>
> clk_rate = clk_get_rate(pit_clk);
>
> - /* enable the pit module */
> - pit_module_enable(timer_base);
> + pit_module_disable(timer_base);
>
> ret = pit_clocksource_init(pit, name, timer_base, clk_rate);
> - if (ret)
> + if (ret) {
> + pr_err("Failed to initialize clocksource '%pOF'\n", np);
> goto out_pit_module_disable;
> + }
>
> - ret = pit_clockevent_init(pit, name, timer_base, clk_rate, irq, 0);
> - if (ret)
> + ret = pit_clockevent_per_cpu_init(pit, name, timer_base, clk_rate, irq, pit_instances);
> + if (ret) {
> + pr_err("Failed to initialize clockevent '%pOF'\n", np);
> goto out_pit_clocksource_unregister;
> + }
> +
> + /* enable the pit module */
> + pit_module_enable(timer_base);
> +
> + pit_instances++;
> +
> + if (pit_instances == max_pit_instances) {
> + ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "PIT timer:starting",
> + pit_clockevent_starting_cpu, NULL);
> + if (ret < 0)
> + goto out_pit_clocksource_unregister;
The function 'pit_clockevent_per_cpu_init' invokes 'request_irq', but
the corresponding 'free_irq' call is missing in the cleanup path.
> + }
>
> return 0;
>
> @@ -289,4 +339,33 @@ static int __init pit_timer_init(struct device_node *np)
>
> return ret;
> }
--
Regards,
Ghennadi
Powered by blists - more mailing lists