Re: [PATCH v3 08/12] rtc: rzn1: Dynamically calculate synchronization delay based on clock rate

From: Lad, Prabhakar

Date: Tue Aug 18 2026 - 10:44:42 EST


Hi Wolfram,

Thank you for the review.

On Tue, Aug 18, 2026 at 11:49 AM Wolfram Sang
<wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>
> > - /* Wait for the counter to stop: two 32k clock cycles */
> > - usleep_range(61, 100);
> > + /* Wait for the counter to stop: two RTC_PCLK clock cycles */
> > + usleep_range(rtc->sync_time, rtc->sync_time + 100);
>
> Hmm, 100 seems more arbitrary here than in the original code? Maybe 2 *
> sync_time like below?
>
Ok, and I will also update the comment.

/* Wait 2-4 RTC_PCLK clock cycles for the counter to stop */
usleep_range(rtc->sync_time, rtc->sync_time * 2);

> > @@ -444,12 +445,20 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
> > scmp_val = RZN1_RTC_CTL0_SLSB_SCMP;
> > }
> >
> > + /*
> > + * The internal clock counter operates in synchronization with the
> > + * RTC_PCLK clock. Calculate the duration of two RTC_PCLK clock
> > + * cycles in microseconds required for operations to complete.
> > + */
>
> Too wordy, this is enough IMHO:
>
> /* Calculate the duration of two RTC_PCLK clock cycles */
>
Ok.

Cheers,
Prabhakar