lkml.org 
[lkml]   [2022]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] rtc: Introduce ti-k3-rtc
On 15/04/2022 13:33:14+0530, Vignesh Raghavendra wrote:
> Hi,
>
> On 12/04/22 1:01 pm, Nishanth Menon wrote:
> > +/**
> > + * k3rtc_fence - Ensure a register sync took place between the two domains
> > + * @priv: pointer to priv data
> > + *
> > + * Return: 0 if the sync took place, else returns -ETIMEDOUT
> > + */
> > +static int k3rtc_fence(struct ti_k3_rtc *priv)
> > +{
> > + u32 timeout = priv->sync_timeout_us;
> > + u32 mask = K3RTC_RD_PEND_BIT | K3RTC_WR_PEND_BIT;
> > + u32 val = 0;
> > +
> > + while (timeout--) {
> > + val = k3rtc_readl(priv, REG_K3RTC_SYNCPEND);
> > + if (!(val & mask))
> > + return 0;
> > + usleep_range(1, 2);
> > + }
>
> readl_poll_timeout() ?
>
> > +
> > + pr_err("RTC Fence timeout: 0x%08x\n", val);
>
> Can we use dev_err()? Provides better indication of the driver throwing
> error.
>

What would the user do with this information in the kernel logs? Please
do not add error strings that will never be used. Returning -ETIMEDOUT
is probably enough.

> > + return -ETIMEDOUT;
> > +}
> > +

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

\
 
 \ /
  Last update: 2022-04-15 10:15    [W:1.841 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site