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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87efd8ogm6.fsf@bootlin.com>
Date:   Tue, 02 Oct 2018 11:14:09 +0200
From:   Gregory CLEMENT <gregory.clement@...tlin.com>
To:     Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc:     linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtc: mv: let the core handle invalid alarms

Hi Alexandre,
 
 On mar., oct. 02 2018, Alexandre Belloni <alexandre.belloni@...tlin.com> wrote:

> Instead of lying to the core when the alarm is invalid, let it handle that
> by returning the error.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>

Tested-by: Gregory CLEMENT <gregory.clement@...tlin.com>  (on Armada 375 DB)

Gregory

> ---
>  drivers/rtc/rtc-mv.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index 4b198b3778d3..e7f14bd12fe3 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -125,13 +125,9 @@ static int mv_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
>  	/* hw counts from year 2000, but tm_year is relative to 1900 */
>  	alm->time.tm_year = bcd2bin(year) + 100;
>  
> -	if (rtc_valid_tm(&alm->time) < 0) {
> -		dev_err(dev, "retrieved alarm date/time is not valid.\n");
> -		rtc_time_to_tm(0, &alm->time);
> -	}
> -
>  	alm->enabled = !!readl(ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
> -	return 0;
> +
> +	return rtc_valid_tm(&alm->time);
>  }
>  
>  static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
> -- 
> 2.19.0
>

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ