linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Vignesh Raghavendra <vigneshr@ti.com>
Cc: Nishanth Menon <nm@ti.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] rtc: Introduce ti-k3-rtc
Date: Fri, 15 Apr 2022 10:14:27 +0200	[thread overview]
Message-ID: <YlkpY4jzQVa8GokG@mail.local> (raw)
In-Reply-To: <b0ae635f-461f-be80-ebff-a548c9dd66af@ti.com>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2022-04-15  8:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  7:31 [PATCH 0/2] rtc: Introduce rtc-ti-k3 Nishanth Menon
2022-04-12  7:31 ` [PATCH 1/2] dt-bindings: rtc: Add TI K3 RTC devicetree bindings documentation Nishanth Menon
2022-04-12 12:06   ` Krzysztof Kozlowski
2022-04-12 22:17     ` Nishanth Menon
2022-04-13  6:42       ` Krzysztof Kozlowski
2022-04-13 15:45         ` Nishanth Menon
2022-04-14 15:53   ` Rob Herring
2022-04-12  7:31 ` [PATCH 2/2] rtc: Introduce ti-k3-rtc Nishanth Menon
2022-04-14  0:45   ` Andrew Davis
2022-04-15  8:03   ` Vignesh Raghavendra
2022-04-15  8:14     ` Alexandre Belloni [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=YlkpY4jzQVa8GokG@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=vigneshr@ti.com \
    /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;
as well as URLs for NNTP newsgroup(s).