* [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm
@ 2012-05-09 23:18 Daniel Drake
2012-05-10 20:06 ` Rafael J. Wysocki
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Drake @ 2012-05-09 23:18 UTC (permalink / raw)
To: a.zummo; +Cc: rtc-linux, linux-acpi, linux-pm, pgf
When the ACPI-driven RTC alarm wakes the system, report it as a wakeup
event. This allows userspace to determine that the reason for system
wakeup was RTC alarm.
Signed-off-by: Daniel Drake <dsd@laptop.org>
---
drivers/rtc/rtc-cmos.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Resending after 3 weeks with no response.
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 7d5f56e..4267789 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -910,14 +910,17 @@ static inline int cmos_poweroff(struct device *dev)
static u32 rtc_handler(void *context)
{
+ struct device *dev = context;
+
+ pm_wakeup_event(dev, 0);
acpi_clear_event(ACPI_EVENT_RTC);
acpi_disable_event(ACPI_EVENT_RTC, 0);
return ACPI_INTERRUPT_HANDLED;
}
-static inline void rtc_wake_setup(void)
+static inline void rtc_wake_setup(struct device *dev)
{
- acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL);
+ acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, dev);
/*
* After the RTC handler is installed, the Fixed_RTC event should
* be disabled. Only when the RTC alarm is set will it be enabled.
@@ -950,7 +953,7 @@ cmos_wake_setup(struct device *dev)
if (acpi_disabled)
return;
- rtc_wake_setup();
+ rtc_wake_setup(dev);
acpi_rtc_info.wake_on = rtc_wake_on;
acpi_rtc_info.wake_off = rtc_wake_off;
--
1.7.10
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm
2012-05-09 23:18 [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm Daniel Drake
@ 2012-05-10 20:06 ` Rafael J. Wysocki
2012-05-22 0:38 ` John Stultz
0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-05-10 20:06 UTC (permalink / raw)
To: Daniel Drake, Len Brown
Cc: a.zummo, rtc-linux, linux-acpi, linux-pm, pgf, John Stultz
On Thursday, May 10, 2012, Daniel Drake wrote:
> When the ACPI-driven RTC alarm wakes the system, report it as a wakeup
> event. This allows userspace to determine that the reason for system
> wakeup was RTC alarm.
>
> Signed-off-by: Daniel Drake <dsd@laptop.org>
Len, John, any objections to this or may I take it for v3.5?
Rafael
> ---
> drivers/rtc/rtc-cmos.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> Resending after 3 weeks with no response.
>
> diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
> index 7d5f56e..4267789 100644
> --- a/drivers/rtc/rtc-cmos.c
> +++ b/drivers/rtc/rtc-cmos.c
> @@ -910,14 +910,17 @@ static inline int cmos_poweroff(struct device *dev)
>
> static u32 rtc_handler(void *context)
> {
> + struct device *dev = context;
> +
> + pm_wakeup_event(dev, 0);
> acpi_clear_event(ACPI_EVENT_RTC);
> acpi_disable_event(ACPI_EVENT_RTC, 0);
> return ACPI_INTERRUPT_HANDLED;
> }
>
> -static inline void rtc_wake_setup(void)
> +static inline void rtc_wake_setup(struct device *dev)
> {
> - acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL);
> + acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, dev);
> /*
> * After the RTC handler is installed, the Fixed_RTC event should
> * be disabled. Only when the RTC alarm is set will it be enabled.
> @@ -950,7 +953,7 @@ cmos_wake_setup(struct device *dev)
> if (acpi_disabled)
> return;
>
> - rtc_wake_setup();
> + rtc_wake_setup(dev);
> acpi_rtc_info.wake_on = rtc_wake_on;
> acpi_rtc_info.wake_off = rtc_wake_off;
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm
2012-05-10 20:06 ` Rafael J. Wysocki
@ 2012-05-22 0:38 ` John Stultz
2012-05-22 15:12 ` Rafael J. Wysocki
0 siblings, 1 reply; 5+ messages in thread
From: John Stultz @ 2012-05-22 0:38 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Daniel Drake, Len Brown, a.zummo, rtc-linux, linux-acpi, linux-pm,
pgf
On 05/10/2012 01:06 PM, Rafael J. Wysocki wrote:
> On Thursday, May 10, 2012, Daniel Drake wrote:
>> When the ACPI-driven RTC alarm wakes the system, report it as a wakeup
>> event. This allows userspace to determine that the reason for system
>> wakeup was RTC alarm.
>>
>> Signed-off-by: Daniel Drake<dsd@laptop.org>
> Len, John, any objections to this or may I take it for v3.5?
Seems reasonable. Although could this maybe be done more generically at
the rtc infrastructure level instead of in the rtc-cmos driver?
thanks
-john
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm
2012-05-22 0:38 ` John Stultz
@ 2012-05-22 15:12 ` Rafael J. Wysocki
2012-05-28 22:51 ` Daniel Drake
0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-05-22 15:12 UTC (permalink / raw)
To: John Stultz
Cc: Daniel Drake, Len Brown, a.zummo, rtc-linux, linux-acpi, linux-pm,
pgf
On Tuesday, May 22, 2012, John Stultz wrote:
> On 05/10/2012 01:06 PM, Rafael J. Wysocki wrote:
> > On Thursday, May 10, 2012, Daniel Drake wrote:
> >> When the ACPI-driven RTC alarm wakes the system, report it as a wakeup
> >> event. This allows userspace to determine that the reason for system
> >> wakeup was RTC alarm.
> >>
> >> Signed-off-by: Daniel Drake<dsd@laptop.org>
> > Len, John, any objections to this or may I take it for v3.5?
> Seems reasonable. Although could this maybe be done more generically at
> the rtc infrastructure level instead of in the rtc-cmos driver?
I think it could, but it can be moved to the RTC layer later too.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm
2012-05-22 15:12 ` Rafael J. Wysocki
@ 2012-05-28 22:51 ` Daniel Drake
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Drake @ 2012-05-28 22:51 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: John Stultz, Len Brown, a.zummo, rtc-linux, linux-acpi, linux-pm,
pgf
On Tue, May 22, 2012 at 9:12 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> Seems reasonable. Although could this maybe be done more generically at
>> the rtc infrastructure level instead of in the rtc-cmos driver?
>
> I think it could, but it can be moved to the RTC layer later too.
I don't think there is much you can win by making it generic - the
event has to be caught via the ACPI subsystem.
Instead of calling pm_wakeup_event() directly you could add a generic
RTC function to do the exact same thing, but I don't see the need to
hide wakeup event generation in a RTC-level API.
Rafael, is this OK for 3.5?
Thanks,
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-28 22:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09 23:18 [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm Daniel Drake
2012-05-10 20:06 ` Rafael J. Wysocki
2012-05-22 0:38 ` John Stultz
2012-05-22 15:12 ` Rafael J. Wysocki
2012-05-28 22:51 ` Daniel Drake
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox