lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YlkpY4jzQVa8GokG@mail.local>
Date:   Fri, 15 Apr 2022 10:14:27 +0200
From:   Alexandre Belloni <alexandre.belloni@...tlin.com>
To:     Vignesh Raghavendra <vigneshr@...com>
Cc:     Nishanth Menon <nm@...com>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        Alessandro Zummo <a.zummo@...ertech.it>,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        linux-rtc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ