public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: tps6586x: device wakeup flags correction
@ 2013-05-12 14:25 Dmitry Osipenko
  2013-05-22 22:22 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Osipenko @ 2013-05-12 14:25 UTC (permalink / raw)
  To: a.zummo, akpm, ldewangan; +Cc: rtc-linux, linux-kernel, Dmitry Osipenko

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.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/rtc/rtc-tps6586x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c
index 459c2ff..426901c 100644
--- a/drivers/rtc/rtc-tps6586x.c
+++ b/drivers/rtc/rtc-tps6586x.c
@@ -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:
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rtc: tps6586x: device wakeup flags correction
  2013-05-12 14:25 [PATCH] rtc: tps6586x: device wakeup flags correction Dmitry Osipenko
@ 2013-05-22 22:22 ` Andrew Morton
  2013-05-22 23:29   ` [PATCH V2] " Dmitry Osipenko
  2013-05-22 23:30   ` [PATCH] " Dmitry Osipenko
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2013-05-22 22:22 UTC (permalink / raw)
  To: Dmitry Osipenko; +Cc: a.zummo, akpm, ldewangan, rtc-linux, linux-kernel

On Sun, 12 May 2013 18:25:06 +0400 Dmitry Osipenko <digetx@gmail.com> 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.)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH V2] rtc: tps6586x: device wakeup flags correction
  2013-05-22 22:22 ` Andrew Morton
@ 2013-05-22 23:29   ` Dmitry Osipenko
  2013-05-22 23:30   ` [PATCH] " Dmitry Osipenko
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Osipenko @ 2013-05-22 23:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: a.zummo, akpm, ldewangan, rtc-linux, linux-kernel

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.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 V2: changed description

 drivers/rtc/rtc-tps6586x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c
index 459c2ff..426901c 100644
--- a/drivers/rtc/rtc-tps6586x.c
+++ b/drivers/rtc/rtc-tps6586x.c
@@ -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:
-- 
1.8.2.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rtc: tps6586x: device wakeup flags correction
  2013-05-22 22:22 ` Andrew Morton
  2013-05-22 23:29   ` [PATCH V2] " Dmitry Osipenko
@ 2013-05-22 23:30   ` Dmitry Osipenko
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Osipenko @ 2013-05-22 23:30 UTC (permalink / raw)
  To: Andrew Morton; +Cc: a.zummo, akpm, ldewangan, rtc-linux, linux-kernel

23.05.2013 02:22, Andrew Morton пишет:
> On Sun, 12 May 2013 18:25:06 +0400 Dmitry Osipenko <digetx@gmail.com> 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.)
> 

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-22 23:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-12 14:25 [PATCH] rtc: tps6586x: device wakeup flags correction Dmitry Osipenko
2013-05-22 22:22 ` Andrew Morton
2013-05-22 23:29   ` [PATCH V2] " Dmitry Osipenko
2013-05-22 23:30   ` [PATCH] " Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox