PXA: Fix wakealarm capability for pxa-rtc

Started by Robert Jarzmik on Aug 1, 2010 · 6 messages from 3 authors · Last reply Aug 6, 2010

STALE5936d

open the first message on its own page

  1. [PATCH] PXA: Fix wakealarm capability for pxa-rtc
    Related patches
  2. [PATCH] PXA: Fix wakealarm capability for pxa-rtc
    Related patches
  3. [PATCH] PXA: Fix wakealarm capability for pxa-rtc
    Related patches
  4. [PATCH] PXA: Fix wakealarm capability for pxa-rtc
    Related patches
  5. [PATCH] PXA: Fix wakealarm capability for pxa-rtc
    Related patches
Message details and related content
Marek Vasut [off-list ref] writes:
Dne Ne 1. srpna 2010 02:48:38 Robert Jarzmik napsal(a):
quoted
Marek Vasut [off-list ref] writes:
quoted
Dne So 31. ?ervence 2010 23:07:06 Robert Jarzmik napsal(a):
quoted
Marek Vasut [off-list ref] writes:
quoted
Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
quoted
Marek Vasut [off-list ref] writes:
quoted
The wakealarm capability was incorrectly set after the RTC was
registered, which resulted into the sysfs node not being created.
On my platform, without this patch:
quoted
cat /sys/devices/platform/pxa-rtc/power/wakeup
enabled
The sysfs node is created. What's the issue you're having ?
It's not created for me without this patch (and if you read the code,
it is impossible to be created without this patch).
Are we talking about the same /sys/devices/platform/pxa-rtc/power/wakeup ?
Aren't you looking for /sys/class/rtc/rtc0/power/wakeup ?
I'm looking for /sys/class/rtc/rtc0/wakealarm
Okay, I understand better, you're looking for the class driver wakup sysfs
entry, and not the driver sysfs wakeup entry.

So when you said "It's not created for me without this patch", you meant the
class driver's sysfs entry, not the one I mentioned I presume ?

Anyway, to straighten things up :
 - for an rtc driver, device_init_wakeup() has to be called before
 rtc_driver_register()
 - if that's not the case, /sys/class/rtc/rtc0/wakealarm won't be created
 - if that's the case, if the driver called device_init_wakeup(x, 1), the rtc
 registering will override the value with device_init_wakeup(x, 0)

I don't think changing the current behaviour, ie. having by default the rtc
driver *not* wake up from suspend is a good thing. As I see now your real
problem, I would request you leave the existing "device_init_wakeup(x, 1)" *and*
you add yours to make the class driver happy.

Cheers.

--
Robert
Message details and related content
Dne Ne 1. srpna 2010 13:15:13 Robert Jarzmik napsal(a):
Marek Vasut [off-list ref] writes:
quoted
Dne Ne 1. srpna 2010 02:48:38 Robert Jarzmik napsal(a):
quoted
Marek Vasut [off-list ref] writes:
quoted
Dne So 31. ?ervence 2010 23:07:06 Robert Jarzmik napsal(a):
quoted
Marek Vasut [off-list ref] writes:
quoted
Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
quoted
Marek Vasut [off-list ref] writes:
quoted
The wakealarm capability was incorrectly set after the RTC was
registered, which resulted into the sysfs node not being
created.
On my platform, without this patch:
quoted
cat /sys/devices/platform/pxa-rtc/power/wakeup
enabled
The sysfs node is created. What's the issue you're having ?
It's not created for me without this patch (and if you read the
code, it is impossible to be created without this patch).
Are we talking about the same /sys/devices/platform/pxa-rtc/power/wakeup
? Aren't you looking for /sys/class/rtc/rtc0/power/wakeup ?
I'm looking for /sys/class/rtc/rtc0/wakealarm
Okay, I understand better, you're looking for the class driver wakup sysfs
entry, and not the driver sysfs wakeup entry.

So when you said "It's not created for me without this patch", you meant
the class driver's sysfs entry, not the one I mentioned I presume ?
You're still talking about some "wakeup", I'm talking about 
/sys/devices/platform/pxa-rtc/power/wakealarm .
Anyway, to straighten things up :
 - for an rtc driver, device_init_wakeup() has to be called before
 rtc_driver_register()
 - if that's not the case, /sys/class/rtc/rtc0/wakealarm won't be created
 - if that's the case, if the driver called device_init_wakeup(x, 1), the
rtc registering will override the value with device_init_wakeup(x, 0)
Are we talking about the same kernel? I just can't find this 
"device_init_wakeup(x, 0);" which would override anything anywhere.
I don't think changing the current behaviour, ie. having by default the rtc
driver *not* wake up from suspend is a good thing.
Huh?
As I see now your real
problem, I would request you leave the existing "device_init_wakeup(x, 1)"
*and* you add yours to make the class driver happy.
Why wouldn't the driver wake up from suspend?
Cheers.

--
Robert
Message details and related content
On Sun, 1 Aug 2010 17:38:16 +0200
Marek Vasut [off-list ref] wrote:
quoted
As I see now your real
problem, I would request you leave the existing "device_init_wakeup(x, 1)"
*and* you add yours to make the class driver happy.  
Why wouldn't the driver wake up from suspend?
quoted
 may I see the latest version of your patch, Marek?

 ty

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it
Message details and related content
Dne ?t 3. srpna 2010 02:03:28 Alessandro Zummo napsal(a):
On Sun, 1 Aug 2010 17:38:16 +0200

Marek Vasut [off-list ref] wrote:
quoted
quoted
As I see now your real
problem, I would request you leave the existing "device_init_wakeup(x,
1)" *and* you add yours to make the class driver happy.
Why wouldn't the driver wake up from suspend?
 may I see the latest version of your patch, Marek?

 ty
---
 drivers/rtc/rtc-pxa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-pxa.c b/drivers/rtc/rtc-pxa.c
index e9c6fa0..d76f187 100644
--- a/drivers/rtc/rtc-pxa.c
+++ b/drivers/rtc/rtc-pxa.c
@@ -403,6 +403,8 @@ static int __init pxa_rtc_probe(struct platform_device 
*pdev)
 
        rtsr_clear_bits(pxa_rtc, RTSR_PIALE | RTSR_RDALE1 | RTSR_HZE);
 
+       device_init_wakeup(dev, 1);
+
        pxa_rtc->rtc = rtc_device_register("pxa-rtc", &pdev->dev, &pxa_rtc_ops,
                                           THIS_MODULE);
        ret = PTR_ERR(pxa_rtc->rtc);
@@ -411,8 +413,6 @@ static int __init pxa_rtc_probe(struct platform_device 
*pdev)
                goto err_rtc_reg;
        }
 
-       device_init_wakeup(dev, 1);
-
        return 0;
 
 err_rtc_reg:
-- 
1.7.1
Message details and related content
On Tue, 3 Aug 2010 05:10:03 +0200
Marek Vasut [off-list ref] wrote:
quoted hunk
quoted
 may I see the latest version of your patch, Marek?

 ty  
---
 drivers/rtc/rtc-pxa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
 well, if it's ok for Robert...

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it
Message details and related content
Dne P? 6. srpna 2010 21:59:55 Alessandro Zummo napsal(a):
On Tue, 3 Aug 2010 05:10:03 +0200

Marek Vasut [off-list ref] wrote:
quoted
quoted
 may I see the latest version of your patch, Marek?
 
 ty

---

 drivers/rtc/rtc-pxa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
 well, if it's ok for Robert...
Then? It apparently is not OK for Robert for some unknown reason.
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help