[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250522145725.4014136-1-stephen.eta.zhou@gmail.com>
Date: Thu, 22 May 2025 22:57:25 +0800
From: stephen.eta.zhou@...il.com
To: daniel.lezcano@...aro.org
Cc: linux-kernel@...r.kernel.org,
stephen.eta.zhou@...il.com,
tglx@...utronix.de
Subject: Re: [PATCH v3] clocksource: timer-sp804: Fix read_current_timer() issue when clock source is not registered
Hi Daniel,
On Wed, May 7, 2025 at 10:11:29AM +0200, Daniel Lezcano:
> #ifdef CONFIG_ARM
> static struct delay_timer delay;
> static unsigned long sp804_read_delay_timer_read(void)
> {
> return sp804_read();
> }
>
> static void sp804_register_delay_timer(int freq)
> {
> delay.freq = freq;
> delay.read_current_timer = sp804_read_delay_timer_read;
> register_current_timer_delay(&delay);
> }
> #else
> static inline void sp804_register_delay_timer(int freq) {}
> #endif
Thank you for taking the time to help me improve this patch.
>> static int __init sp804_clocksource_and_sched_clock_init(void __iomem *base,
>> const char *name,
>> struct clk *clk,
>> @@ -114,6 +127,10 @@ static int __init sp804_clocksource_and_sched_clock_init(void __iomem *base,
>> if (rate < 0)
>> return -EINVAL;
>>
>> +#ifdef CONFIG_ARM
>> + delay.freq = rate;
>> +#endif
>
> drop the above
>
> sp804_register_delay_timer(rate);
>> clkevt = sp804_clkevt_get(base);
>>
>> writel(0, clkevt->ctrl);
>> @@ -318,6 +335,12 @@ static int __init sp804_of_init(struct device_node *np, struct sp804_timer *time
>> if (ret)
>> goto err;
>> }
>> +
>> +#ifdef CONFIG_ARM
>> + delay.read_current_timer = sp804_read_delay_timer_read;
>> + register_current_timer_delay(&delay);
>> +#endif
>> +
>
> drop the above
Thanks for your feedback.
I'll make the changes accordingly and send out v4 soon.
Best regards,
Stephen
Powered by blists - more mailing lists