Skip to contentSkip to conversation

rtc: tps6586x: device wakeup flags correction

PATCH Superseded Dmitry Osipenko 2 participants 4 messages May 12, 2013 – May 22, 2013 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: tps6586x: device wakeup flags correction

Use device_init_wakeup() instead of device_set_wakeup_capable() and move it before rtc dev registering. This fixes issue with alarmtimer that checks wakeup capability with device_may_wakeup() on device add.

---
 drivers/rtc/rtc-tps6586x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rtc/rtc-tps6586x.c +2 -1
index 459c2ff..426901c 100644
@@ -273,6 +273,8 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	device_init_wakeup(&pdev->dev, 1);
+
 	platform_set_drvdata(pdev, rtc);
 	rtc->rtc = devm_rtc_device_register(&pdev->dev, dev_name(&pdev->dev),
 				       &tps6586x_rtc_ops, THIS_MODULE);
@@ -292,7 +294,6 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
 		goto fail_rtc_register;
 	}
 	disable_irq(rtc->irq);
-	device_set_wakeup_capable(&pdev->dev, 1);
 	return 0;
 
 fail_rtc_register:
Signature · 1 line
1.8.2.1
#1 lore raw
Quoted 3 lines · On Sun, 12 May 2013 18:25:06 +0400 Dmitry Osipenko <[email protected]> wrote:

Use device_init_wakeup() instead of device_set_wakeup_capable() and move it before rtc dev registering. This fixes issue with alarmtimer that checks wakeup capability with device_may_wakeup() on device add.

Well OK, but what is this "issue"?

(form letter: When writing a changelog, please describe the end-user-visible effects of the bug, so that others can more easily decide which kernel version(s) should be fixed, and so that downstream kernel maintainers can more easily work out whether this patch will fix a problem which they or their customers are observing.)

#2 lore raw

PATCH v2 1/1 rtc: tps6586x: device wakeup flags correction

Use device_init_wakeup() instead of device_set_wakeup_capable() and move it before rtc dev registering. This fixes alarmtimer not registered when tps6586x rtc is the only wakeup compatible rtc in the system.

---
V2: changed description

 drivers/rtc/rtc-tps6586x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rtc/rtc-tps6586x.c +2 -1
index 459c2ff..426901c 100644
@@ -273,6 +273,8 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	device_init_wakeup(&pdev->dev, 1);
+
 	platform_set_drvdata(pdev, rtc);
 	rtc->rtc = devm_rtc_device_register(&pdev->dev, dev_name(&pdev->dev),
 				       &tps6586x_rtc_ops, THIS_MODULE);
@@ -292,7 +294,6 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
 		goto fail_rtc_register;
 	}
 	disable_irq(rtc->irq);
-	device_set_wakeup_capable(&pdev->dev, 1);
 	return 0;
 
 fail_rtc_register:
Signature · 1 line
1.8.2.1
#3 lore raw
In reply to Andrew Morton

23.05.2013 02:22, Andrew Morton пишет:

Quoted 6 lines · On Sun, 12 May 2013 18:25:06 +0400 Dmitry Osipenko <[email protected]> wrote:
Quoted 4 lines

Use device_init_wakeup() instead of device_set_wakeup_capable() and move it before rtc dev registering. This fixes issue with alarmtimer that checks wakeup capability with device_may_wakeup() on device add.

Quoted 8 lines

Well OK, but what is this "issue"?

(form letter: When writing a changelog, please describe the end-user-visible effects of the bug, so that others can more easily decide which kernel version(s) should be fixed, and so that downstream kernel maintainers can more easily work out whether this patch will fix a problem which they or their customers are observing.)

Hi, Andrew. Thanks for comment. "Issue" is that alarmtimer won't be registered if tps6586x is the only wakeup compatible rtc in the system.

from kernel/time/alarmtimer.c:

static int alarmtimer_rtc_add_device(struct device *dev,
struct class_interface *class_intf)
{
...

	if (!device_may_wakeup(rtc->dev.parent)) // dev.parent = tps6586x rtc
		return -1;

I've sent V2 with changed description.