All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
@ 2010-07-31  4:22 Marek Vasut
  2010-07-31 15:38 ` Robert Jarzmik
  2010-08-01  8:42 ` Igor Grinberg
  0 siblings, 2 replies; 19+ messages in thread
From: Marek Vasut @ 2010-07-31  4:22 UTC (permalink / raw)
  To: linux-arm-kernel

The wakealarm capability was incorrectly set after the RTC was registered, which
resulted into the sysfs node not being created.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 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

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-07-31  4:22 [PATCH] PXA: Fix wakealarm capability for pxa-rtc Marek Vasut
@ 2010-07-31 15:38 ` Robert Jarzmik
  2010-07-31 20:15   ` Marek Vasut
  2010-08-01  8:42 ` Igor Grinberg
  1 sibling, 1 reply; 19+ messages in thread
From: Robert Jarzmik @ 2010-07-31 15:38 UTC (permalink / raw)
  To: linux-arm-kernel

Marek Vasut <marek.vasut@gmail.com> writes:

> 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:
> cat /sys/devices/platform/pxa-rtc/power/wakeup
> enabled

The sysfs node is created. What's the issue you're having ?

Cheers.

--
Robert

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-07-31 15:38 ` Robert Jarzmik
@ 2010-07-31 20:15   ` Marek Vasut
  2010-07-31 21:07     ` Robert Jarzmik
  0 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2010-07-31 20:15 UTC (permalink / raw)
  To: linux-arm-kernel

Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
> Marek Vasut <marek.vasut@gmail.com> writes:
> > 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:
> > 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).

Cheers
> 
> Cheers.
> 
> --
> Robert

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-07-31 20:15   ` Marek Vasut
@ 2010-07-31 21:07     ` Robert Jarzmik
  2010-08-01  0:13       ` Marek Vasut
  0 siblings, 1 reply; 19+ messages in thread
From: Robert Jarzmik @ 2010-07-31 21:07 UTC (permalink / raw)
  To: linux-arm-kernel

Marek Vasut <marek.vasut@gmail.com> writes:

> Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
>> Marek Vasut <marek.vasut@gmail.com> writes:
>> > 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:
>> > 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).

I read the code, and I see:
rtc_device_register()
  -> device_register()
    -> device_initialize()
      -> device_init_wakeup(dev, 0)

So with or without your patch, device_init_wakeup() is called. The difference is
that with your patch, we end up with a disabled wakeup capability.
I showed the code sequence, your turn to show your "if you read the code".

Moreover, my platform without your patch prooves that the sysfs entry is created.

So unless you prove me wrong, I will reject the patch.

Cheers.

-- 
Robert

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-07-31 21:07     ` Robert Jarzmik
@ 2010-08-01  0:13       ` Marek Vasut
  2010-08-01  0:48         ` Robert Jarzmik
  0 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2010-08-01  0:13 UTC (permalink / raw)
  To: linux-arm-kernel

Dne So 31. ?ervence 2010 23:07:06 Robert Jarzmik napsal(a):
> Marek Vasut <marek.vasut@gmail.com> writes:
> > Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
> >> Marek Vasut <marek.vasut@gmail.com> writes:
> >> > 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:
> >> > 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).
> 
> I read the code, and I see:
> rtc_device_register()
>   -> device_register()
>     -> device_initialize()
>       -> device_init_wakeup(dev, 0)
> 
> So with or without your patch, device_init_wakeup() is called. The
> difference is that with your patch, we end up with a disabled wakeup
> capability. I showed the code sequence, your turn to show your "if you
> read the code".

drivers/rtc/rtc-sysfs.c

217 static inline int rtc_does_wakealarm(struct rtc_device *rtc)
218 {
219         if (!device_can_wakeup(rtc->dev.parent))
220                 return 0;
221         return rtc->ops->set_alarm != NULL;
222 }
223 
224 
225 void rtc_sysfs_add_device(struct rtc_device *rtc)
226 {
227         int err;
228 
229         /* not all RTCs support both alarms and wakeup */
230         if (!rtc_does_wakealarm(rtc))
231                 return;
232 
233         err = device_create_file(&rtc->dev, &dev_attr_wakealarm);
234         if (err)
235                 dev_err(rtc->dev.parent,
236                         "failed to create alarm attribute, %d\n", err);
237 }

For me, it leaves the function on rtc_does_wakealarm(); That's because 
device_can_wakeup on line 219 returns 0;

include/linux/pm_wakeup.h
45 static inline bool device_can_wakeup(struct device *dev)
46 {
47         return dev->power.can_wakeup;
48 }

This dev->power.can_wakeup is set by:

include/linux/pm_wakeup.h
35 static inline void device_init_wakeup(struct device *dev, bool val)
36 {
37         dev->power.can_wakeup = dev->power.should_wakeup = val;
38 }

But, the rtc_sysfs_add_device is called by:

drivers/rtc/class.c
114 struct rtc_device *rtc_device_register(const char *name, struct device *dev,
115                                         const struct rtc_class_ops *ops,
116                                         struct module *owner)
117 {

So the dev->power.can_wakeup must be set before registering the device.
> 
> Moreover, my platform without your patch prooves that the sysfs entry is
> created.

My platform (sharp akita) without this patch doesn't even show the wakealarm 
sysfs node. So something is certainly wrong in this driver, explain what it is 
please.
> 
> So unless you prove me wrong, I will reject the patch.

Ok, then I'd like to see you come up with better patch that actually fixes my 
platform.
> 
> Cheers.

Cheers

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-01  0:13       ` Marek Vasut
@ 2010-08-01  0:48         ` Robert Jarzmik
  2010-08-01  0:53           ` Marek Vasut
  0 siblings, 1 reply; 19+ messages in thread
From: Robert Jarzmik @ 2010-08-01  0:48 UTC (permalink / raw)
  To: linux-arm-kernel

Marek Vasut <marek.vasut@gmail.com> writes:

> Dne So 31. ?ervence 2010 23:07:06 Robert Jarzmik napsal(a):
>> Marek Vasut <marek.vasut@gmail.com> writes:
>> > Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
>> >> Marek Vasut <marek.vasut@gmail.com> writes:
>> >> > 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:
>> >> > 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 ?

Because the code you're showing seems to be related to the class sysfs entries,
not the driver's unless I'm mistaken.

I'll join Alessandro to the discussion, he might have some insight for [1].

Cheers.

--
Robert


>> 
>> I read the code, and I see:
>> rtc_device_register()
>>   -> device_register()
>>     -> device_initialize()
>>       -> device_init_wakeup(dev, 0)
>> 
>> So with or without your patch, device_init_wakeup() is called. The
>> difference is that with your patch, we end up with a disabled wakeup
>> capability. I showed the code sequence, your turn to show your "if you
>> read the code".
>
> drivers/rtc/rtc-sysfs.c
>
> 217 static inline int rtc_does_wakealarm(struct rtc_device *rtc)
> 218 {
> 219         if (!device_can_wakeup(rtc->dev.parent))
> 220                 return 0;
> 221         return rtc->ops->set_alarm != NULL;
> 222 }
> 223 
> 224 
> 225 void rtc_sysfs_add_device(struct rtc_device *rtc)
> 226 {
> 227         int err;
> 228 
> 229         /* not all RTCs support both alarms and wakeup */
> 230         if (!rtc_does_wakealarm(rtc))
> 231                 return;
> 232 
> 233         err = device_create_file(&rtc->dev, &dev_attr_wakealarm);
> 234         if (err)
> 235                 dev_err(rtc->dev.parent,
> 236                         "failed to create alarm attribute, %d\n", err);
> 237 }
>
> For me, it leaves the function on rtc_does_wakealarm(); That's because 
> device_can_wakeup on line 219 returns 0;
>
> include/linux/pm_wakeup.h
> 45 static inline bool device_can_wakeup(struct device *dev)
> 46 {
> 47         return dev->power.can_wakeup;
> 48 }
>
> This dev->power.can_wakeup is set by:
>
> include/linux/pm_wakeup.h
> 35 static inline void device_init_wakeup(struct device *dev, bool val)
> 36 {
> 37         dev->power.can_wakeup = dev->power.should_wakeup = val;
> 38 }
>
> But, the rtc_sysfs_add_device is called by:
>
> drivers/rtc/class.c
> 114 struct rtc_device *rtc_device_register(const char *name, struct device *dev,
> 115                                         const struct rtc_class_ops *ops,
> 116                                         struct module *owner)
> 117 {
>
> So the dev->power.can_wakeup must be set before registering the device.
>> 
>> Moreover, my platform without your patch prooves that the sysfs entry is
>> created.
>
> My platform (sharp akita) without this patch doesn't even show the wakealarm 
> sysfs node. So something is certainly wrong in this driver, explain what it is 
> please.
>> 
>> So unless you prove me wrong, I will reject the patch.
>
> Ok, then I'd like to see you come up with better patch that actually fixes my 
> platform.
>> 
>> Cheers.
>
> Cheers

-- 
Robert

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-01  0:48         ` Robert Jarzmik
@ 2010-08-01  0:53           ` Marek Vasut
  2010-08-01 11:15             ` Robert Jarzmik
  0 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2010-08-01  0:53 UTC (permalink / raw)
  To: linux-arm-kernel

Dne Ne 1. srpna 2010 02:48:38 Robert Jarzmik napsal(a):
> Marek Vasut <marek.vasut@gmail.com> writes:
> > Dne So 31. ?ervence 2010 23:07:06 Robert Jarzmik napsal(a):
> >> Marek Vasut <marek.vasut@gmail.com> writes:
> >> > Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
> >> >> Marek Vasut <marek.vasut@gmail.com> writes:
> >> >> > 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:
> >> >> > 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

> 
> Because the code you're showing seems to be related to the class sysfs
> entries, not the driver's unless I'm mistaken.
> 
> I'll join Alessandro to the discussion, he might have some insight for [1].
> 
> Cheers.
> 
> --
> Robert
> 
> >> I read the code, and I see:
> >> rtc_device_register()
> >> 
> >>   -> device_register()
> >>   
> >>     -> device_initialize()
> >>     
> >>       -> device_init_wakeup(dev, 0)
> >> 
> >> So with or without your patch, device_init_wakeup() is called. The
> >> difference is that with your patch, we end up with a disabled wakeup
> >> capability. I showed the code sequence, your turn to show your "if you
> >> read the code".
> > 
> > drivers/rtc/rtc-sysfs.c
> > 
> > 217 static inline int rtc_does_wakealarm(struct rtc_device *rtc)
> > 218 {
> > 219         if (!device_can_wakeup(rtc->dev.parent))
> > 220                 return 0;
> > 221         return rtc->ops->set_alarm != NULL;
> > 222 }
> > 223
> > 224
> > 225 void rtc_sysfs_add_device(struct rtc_device *rtc)
> > 226 {
> > 227         int err;
> > 228
> > 229         /* not all RTCs support both alarms and wakeup */
> > 230         if (!rtc_does_wakealarm(rtc))
> > 231                 return;
> > 232
> > 233         err = device_create_file(&rtc->dev, &dev_attr_wakealarm);
> > 234         if (err)
> > 235                 dev_err(rtc->dev.parent,
> > 236                         "failed to create alarm attribute, %d\n",
> > err); 237 }
> > 
> > For me, it leaves the function on rtc_does_wakealarm(); That's because
> > device_can_wakeup on line 219 returns 0;
> > 
> > include/linux/pm_wakeup.h
> > 45 static inline bool device_can_wakeup(struct device *dev)
> > 46 {
> > 47         return dev->power.can_wakeup;
> > 48 }
> > 
> > This dev->power.can_wakeup is set by:
> > 
> > include/linux/pm_wakeup.h
> > 35 static inline void device_init_wakeup(struct device *dev, bool val)
> > 36 {
> > 37         dev->power.can_wakeup = dev->power.should_wakeup = val;
> > 38 }
> > 
> > But, the rtc_sysfs_add_device is called by:
> > 
> > drivers/rtc/class.c
> > 114 struct rtc_device *rtc_device_register(const char *name, struct
> > device *dev, 115                                         const struct
> > rtc_class_ops *ops, 116                                         struct
> > module *owner) 117 {
> > 
> > So the dev->power.can_wakeup must be set before registering the device.
> > 
> >> Moreover, my platform without your patch prooves that the sysfs entry is
> >> created.
> > 
> > My platform (sharp akita) without this patch doesn't even show the
> > wakealarm sysfs node. So something is certainly wrong in this driver,
> > explain what it is please.
> > 
> >> So unless you prove me wrong, I will reject the patch.
> > 
> > Ok, then I'd like to see you come up with better patch that actually
> > fixes my platform.
> > 
> >> Cheers.
> > 
> > Cheers

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-07-31  4:22 [PATCH] PXA: Fix wakealarm capability for pxa-rtc Marek Vasut
  2010-07-31 15:38 ` Robert Jarzmik
@ 2010-08-01  8:42 ` Igor Grinberg
  1 sibling, 0 replies; 19+ messages in thread
From: Igor Grinberg @ 2010-08-01  8:42 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/31/10 07:22, Marek Vasut wrote:
> The wakealarm capability was incorrectly set after the RTC was registered, which
> resulted into the sysfs node not being created.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>   

Same problem exists on on pxa3xx/cm-x300 and I suppose
on many other pxa based systems which use rtc-pxa and not
rtc-sa1100 (in which device_init_wakeup() indeed called before
the rtc_device_register()).

This patch makes /sys/class/rtc/rtc0/wakealarm visible and thus
solves the problem for cm-x300

Tested-by: Igor Grinberg <grinberg@compulab.co.il>

> ---
>  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:
>   

-- 
Regards,
Igor.

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-01  0:53           ` Marek Vasut
@ 2010-08-01 11:15             ` Robert Jarzmik
  2010-08-01 15:38               ` Marek Vasut
  0 siblings, 1 reply; 19+ messages in thread
From: Robert Jarzmik @ 2010-08-01 11:15 UTC (permalink / raw)
  To: linux-arm-kernel

Marek Vasut <marek.vasut@gmail.com> writes:

> Dne Ne 1. srpna 2010 02:48:38 Robert Jarzmik napsal(a):
>> Marek Vasut <marek.vasut@gmail.com> writes:
>> > Dne So 31. ?ervence 2010 23:07:06 Robert Jarzmik napsal(a):
>> >> Marek Vasut <marek.vasut@gmail.com> writes:
>> >> > Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
>> >> >> Marek Vasut <marek.vasut@gmail.com> writes:
>> >> >> > 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:
>> >> >> > 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

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-01 11:15             ` Robert Jarzmik
@ 2010-08-01 15:38               ` Marek Vasut
  2010-08-01 19:32                 ` Robert Jarzmik
  2010-08-03  0:03                 ` Alessandro Zummo
  0 siblings, 2 replies; 19+ messages in thread
From: Marek Vasut @ 2010-08-01 15:38 UTC (permalink / raw)
  To: linux-arm-kernel

Dne Ne 1. srpna 2010 13:15:13 Robert Jarzmik napsal(a):
> Marek Vasut <marek.vasut@gmail.com> writes:
> > Dne Ne 1. srpna 2010 02:48:38 Robert Jarzmik napsal(a):
> >> Marek Vasut <marek.vasut@gmail.com> writes:
> >> > Dne So 31. ?ervence 2010 23:07:06 Robert Jarzmik napsal(a):
> >> >> Marek Vasut <marek.vasut@gmail.com> writes:
> >> >> > Dne So 31. ?ervence 2010 17:38:06 Robert Jarzmik napsal(a):
> >> >> >> Marek Vasut <marek.vasut@gmail.com> writes:
> >> >> >> > 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:
> >> >> >> > 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

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-01 15:38               ` Marek Vasut
@ 2010-08-01 19:32                 ` Robert Jarzmik
  2010-08-03  0:03                 ` Alessandro Zummo
  1 sibling, 0 replies; 19+ messages in thread
From: Robert Jarzmik @ 2010-08-01 19:32 UTC (permalink / raw)
  To: linux-arm-kernel

Marek Vasut <marek.vasut@gmail.com> writes:

>> 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 already provided the call tree.

Anyway, I won't be available for the next days, and as I don't want to argue
anymore, and I expect you have tested your patch against a suspended device to
see it wake up, have my:

Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

--
Robert

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-01 15:38               ` Marek Vasut
  2010-08-01 19:32                 ` Robert Jarzmik
@ 2010-08-03  0:03                 ` Alessandro Zummo
  2010-08-03  3:10                   ` Marek Vasut
  1 sibling, 1 reply; 19+ messages in thread
From: Alessandro Zummo @ 2010-08-03  0:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 1 Aug 2010 17:38:16 +0200
Marek Vasut <marek.vasut@gmail.com> wrote:

> > 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

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-03  0:03                 ` Alessandro Zummo
@ 2010-08-03  3:10                   ` Marek Vasut
  2010-08-06 19:59                     ` Alessandro Zummo
  0 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2010-08-03  3:10 UTC (permalink / raw)
  To: linux-arm-kernel

Dne ?t 3. srpna 2010 02:03:28 Alessandro Zummo napsal(a):
> On Sun, 1 Aug 2010 17:38:16 +0200
> 
> Marek Vasut <marek.vasut@gmail.com> wrote:
> > > 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

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-03  3:10                   ` Marek Vasut
@ 2010-08-06 19:59                     ` Alessandro Zummo
  2010-08-06 21:39                       ` Marek Vasut
  2010-08-07  9:43                       ` Robert Jarzmik
  0 siblings, 2 replies; 19+ messages in thread
From: Alessandro Zummo @ 2010-08-06 19:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 3 Aug 2010 05:10:03 +0200
Marek Vasut <marek.vasut@gmail.com> wrote:

> >  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

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-06 19:59                     ` Alessandro Zummo
@ 2010-08-06 21:39                       ` Marek Vasut
  2010-08-07  9:43                       ` Robert Jarzmik
  1 sibling, 0 replies; 19+ messages in thread
From: Marek Vasut @ 2010-08-06 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

Dne P? 6. srpna 2010 21:59:55 Alessandro Zummo napsal(a):
> On Tue, 3 Aug 2010 05:10:03 +0200
> 
> Marek Vasut <marek.vasut@gmail.com> wrote:
> > >  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.

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-06 19:59                     ` Alessandro Zummo
  2010-08-06 21:39                       ` Marek Vasut
@ 2010-08-07  9:43                       ` Robert Jarzmik
  2010-08-18  4:08                         ` Eric Miao
  1 sibling, 1 reply; 19+ messages in thread
From: Robert Jarzmik @ 2010-08-07  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

Alessandro Zummo <a.zummo@towertech.it> writes:

> On Tue, 3 Aug 2010 05:10:03 +0200
> Marek Vasut <marek.vasut@gmail.com> wrote:
>
>> >  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...

Yes, I already gave my ack in [1].

As I'm still on holidays, I won't be available for a couple of days again, so
take it granted that IMO Marek's patch can go in your tree and that it has my
full aggreement. Thanks.

--
Robert

[1] http://www.spinics.net/lists/arm-kernel/msg94818.html

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-07  9:43                       ` Robert Jarzmik
@ 2010-08-18  4:08                         ` Eric Miao
  2010-08-18  5:04                           ` Marek Vasut
  0 siblings, 1 reply; 19+ messages in thread
From: Eric Miao @ 2010-08-18  4:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Aug 7, 2010 at 5:43 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Alessandro Zummo <a.zummo@towertech.it> writes:
>
>> On Tue, 3 Aug 2010 05:10:03 +0200
>> Marek Vasut <marek.vasut@gmail.com> wrote:
>>
>>> > ?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...
>
> Yes, I already gave my ack in [1].
>
> As I'm still on holidays, I won't be available for a couple of days again, so
> take it granted that IMO Marek's patch can go in your tree and that it has my
> full aggreement. Thanks.
>

Hi Alessandro,

Cann't find this in -next so far, the patch looks correct to me. We did
the same thing for rtc-sa1100.c before. So you also have my Ack on
this if it's not yet in your tree.

> --
> Robert
>
> [1] http://www.spinics.net/lists/arm-kernel/msg94818.html
>

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-18  4:08                         ` Eric Miao
@ 2010-08-18  5:04                           ` Marek Vasut
  2010-08-18  6:15                             ` Eric Miao
  0 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2010-08-18  5:04 UTC (permalink / raw)
  To: linux-arm-kernel

Dne St 18. srpna 2010 06:08:44 Eric Miao napsal(a):
> On Sat, Aug 7, 2010 at 5:43 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> > Alessandro Zummo <a.zummo@towertech.it> writes:
> >> On Tue, 3 Aug 2010 05:10:03 +0200
> >> 
> >> Marek Vasut <marek.vasut@gmail.com> wrote:
> >>> >  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...
> > 
> > Yes, I already gave my ack in [1].
> > 
> > As I'm still on holidays, I won't be available for a couple of days
> > again, so take it granted that IMO Marek's patch can go in your tree and
> > that it has my full aggreement. Thanks.
> 
> Hi Alessandro,
> 
> Cann't find this in -next so far, the patch looks correct to me. We did
> the same thing for rtc-sa1100.c before. So you also have my Ack on
> this if it's not yet in your tree.

If you want, I can put this patch it into next pull rq for pxa-linux-2.6 towards 
you, Eric ? Maybe it should go through fix though.

Btw. Eric, could you please sync devel with mainline? Also, did you push your -
fix?

Thanks, Cheers!
> 
> > --
> > Robert
> > 
> > [1] http://www.spinics.net/lists/arm-kernel/msg94818.html

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

* [PATCH] PXA: Fix wakealarm capability for pxa-rtc
  2010-08-18  5:04                           ` Marek Vasut
@ 2010-08-18  6:15                             ` Eric Miao
  0 siblings, 0 replies; 19+ messages in thread
From: Eric Miao @ 2010-08-18  6:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 18, 2010 at 1:04 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Dne St 18. srpna 2010 06:08:44 Eric Miao napsal(a):
>> On Sat, Aug 7, 2010 at 5:43 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>> > Alessandro Zummo <a.zummo@towertech.it> writes:
>> >> On Tue, 3 Aug 2010 05:10:03 +0200
>> >>
>> >> Marek Vasut <marek.vasut@gmail.com> wrote:
>> >>> > ?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...
>> >
>> > Yes, I already gave my ack in [1].
>> >
>> > As I'm still on holidays, I won't be available for a couple of days
>> > again, so take it granted that IMO Marek's patch can go in your tree and
>> > that it has my full aggreement. Thanks.
>>
>> Hi Alessandro,
>>
>> Cann't find this in -next so far, the patch looks correct to me. We did
>> the same thing for rtc-sa1100.c before. So you also have my Ack on
>> this if it's not yet in your tree.
>
> If you want, I can put this patch it into next pull rq for pxa-linux-2.6 towards
> you, Eric ? Maybe it should go through fix though.
>

I'd prefer Alessandro merge this.

> Btw. Eric, could you please sync devel with mainline? Also, did you push your -
> fix?

I'll do it soon.

>
> Thanks, Cheers!
>>
>> > --
>> > Robert
>> >
>> > [1] http://www.spinics.net/lists/arm-kernel/msg94818.html
>

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

end of thread, other threads:[~2010-08-18  6:15 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-31  4:22 [PATCH] PXA: Fix wakealarm capability for pxa-rtc Marek Vasut
2010-07-31 15:38 ` Robert Jarzmik
2010-07-31 20:15   ` Marek Vasut
2010-07-31 21:07     ` Robert Jarzmik
2010-08-01  0:13       ` Marek Vasut
2010-08-01  0:48         ` Robert Jarzmik
2010-08-01  0:53           ` Marek Vasut
2010-08-01 11:15             ` Robert Jarzmik
2010-08-01 15:38               ` Marek Vasut
2010-08-01 19:32                 ` Robert Jarzmik
2010-08-03  0:03                 ` Alessandro Zummo
2010-08-03  3:10                   ` Marek Vasut
2010-08-06 19:59                     ` Alessandro Zummo
2010-08-06 21:39                       ` Marek Vasut
2010-08-07  9:43                       ` Robert Jarzmik
2010-08-18  4:08                         ` Eric Miao
2010-08-18  5:04                           ` Marek Vasut
2010-08-18  6:15                             ` Eric Miao
2010-08-01  8:42 ` Igor Grinberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.