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

"Lad, Prabhakar" <[email protected]>
Newsgroups org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-rtc
Message-ID <CA+V-a8uCt2_Vc7A4iFuiCKmkcrbFCi+0_uoWe_Xx=aT9=Fz79g@mail.gmail.com>
Hi Wolfram,

Thank you for the review.

On Tue, Aug 18, 2026 at 11:49 AM Wolfram Sang
<[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.