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:	Sat, 23 Apr 2016 01:48:54 +0200
From:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To:	Mylène Josserand 
	<mylene.josserand@...e-electrons.com>
Cc:	rtc-linux@...glegroups.com,
	Alessandro Zummo <a.zummo@...ertech.it>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] rtc: rv3029: add alarm IRQ

On 21/04/2016 at 20:24:19 +0200, Mylène Josserand wrote :
> @@ -731,11 +786,9 @@ static void rv3029_hwmon_register(struct device *dev, const char *name)
>  
>  #endif /* CONFIG_RTC_DRV_RV3029_HWMON */
>  
> -static const struct rtc_class_ops rv3029_rtc_ops = {
> +static struct rtc_class_ops rv3029_rtc_ops = {
>  	.read_time	= rv3029_read_time,
>  	.set_time	= rv3029_set_time,
> -	.read_alarm	= rv3029_read_alarm,
> -	.set_alarm	= rv3029_set_alarm,
>  };
>  
>  static struct i2c_device_id rv3029_id[] = {
> @@ -772,8 +825,27 @@ static int rv3029_probe(struct device *dev, struct regmap *regmap, int irq,
>  
>  	rv3029->rtc = devm_rtc_device_register(dev, name, &rv3029_rtc_ops,
>  					       THIS_MODULE);
> +	if (IS_ERR(rv3029->rtc)) {
> +		dev_err(dev, "unable to register the class device\n");
> +		return PTR_ERR(rv3029->rtc);
> +	}
>  
> -	return PTR_ERR_OR_ZERO(rv3029->rtc);
> +	if (rv3029->irq > 0) {
> +		rc = devm_request_threaded_irq(dev, rv3029->irq,
> +					       NULL, rv3029_handle_irq,
> +					       IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> +					       "rv3029", dev);
> +		if (rc) {
> +			dev_warn(dev, "unable to request IRQ, alarms disabled\n");
> +			rv3029->irq = 0;
> +		} else {
> +			rv3029_rtc_ops.read_alarm = rv3029_read_alarm;
> +			rv3029_rtc_ops.set_alarm = rv3029_set_alarm;
> +			rv3029_rtc_ops.alarm_irq_enable = rv3029_alarm_irq_enable;
> +		}
> +	}
> +

While this work, devm_rtc_device_register() needs to know whether the
alarms are enabled and will try to call .read_alarm(). That is not
completely an issue right now and as we discussed, I'm planning to send
a rework of the rtc core to overcome that issue.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ