mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: stephen.eta.zhou@gmail.com
To: daniel.lezcano@linaro.org
Cc: linux-kernel@vger.kernel.org, stephen.eta.zhou@gmail.com,
	tglx@linutronix.de
Subject: Re: [PATCH v3] clocksource: timer-sp804: Fix read_current_timer() issue when clock source is not registered
Date: Thu, 22 May 2025 22:57:25 +0800	[thread overview]
Message-ID: <20250522145725.4014136-1-stephen.eta.zhou@gmail.com> (raw)
In-Reply-To: <aBsVsZu50MMJkI0q@mai.linaro.org>

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

      reply	other threads:[~2025-05-22 14:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14  2:55 Stephen Eta Zhou
2025-05-07  8:11 ` Daniel Lezcano
2025-05-22 14:57   ` stephen.eta.zhou [this message]

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=20250522145725.4014136-1-stephen.eta.zhou@gmail.com \
    --to=stephen.eta.zhou@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®