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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Nov 2019 18:19:15 +0100
From:   Alexandre Belloni <alexandre.belloni@...tlin.com>
To:     Andrey Skvortsov <andrej.skvortzov@...il.com>
Cc:     Alessandro Zummo <a.zummo@...ertech.it>, linux-rtc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtc: tps65910: allow using RTC without alarm interrupt

Hi,

This needs a proper commit message.

On 09/11/2019 18:46:52+0300, Andrey Skvortsov wrote:
> Signed-off-by: Andrey Skvortsov <andrej.skvortzov@...il.com>
> ---
>  drivers/rtc/rtc-tps65910.c | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
> index 2c0467a9e717..aa3a001ef413 100644
> --- a/drivers/rtc/rtc-tps65910.c
> +++ b/drivers/rtc/rtc-tps65910.c
> @@ -361,6 +361,13 @@ static const struct rtc_class_ops tps65910_rtc_ops = {
>  	.set_offset	= tps65910_set_offset,
>  };
>  
> +static const struct rtc_class_ops tps65910_rtc_ops_noirq = {
> +	.read_time	= tps65910_rtc_read_time,
> +	.set_time	= tps65910_rtc_set_time,
> +	.read_offset	= tps65910_read_offset,
> +	.set_offset	= tps65910_set_offset,
> +};
> +
>  static int tps65910_rtc_probe(struct platform_device *pdev)
>  {
>  	struct tps65910 *tps65910 = NULL;
> @@ -415,13 +422,17 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
>  		tps65910_rtc_interrupt, IRQF_TRIGGER_LOW,
>  		dev_name(&pdev->dev), &pdev->dev);
>  	if (ret < 0) {
> -		dev_err(&pdev->dev, "IRQ is not free.\n");
> -		return ret;
> +		dev_err(&pdev->dev, "request IRQ:%d failed, err = %d\n",
> +			 irq, ret);

Do we actually need an error message here?

> +		irq = -1;
>  	}
>  	tps_rtc->irq = irq;
> -	device_set_wakeup_capable(&pdev->dev, 1);
> +	if (irq != -1) {
> +		device_set_wakeup_capable(&pdev->dev, 1);
> +		tps_rtc->rtc->ops = &tps65910_rtc_ops;
> +	} else
> +		tps_rtc->rtc->ops = &tps65910_rtc_ops_noirq;
>  
> -	tps_rtc->rtc->ops = &tps65910_rtc_ops;
>  	tps_rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
>  	tps_rtc->rtc->range_max = RTC_TIMESTAMP_END_2099;
>  
> -- 
> 2.20.1
> 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ