소스 검색

rtc-cmos: report wakeups from interrupt handler

When suspending the system with an important RTC wake alarm active,
it is possible that the RTC alarm will expire before the system has
gone to sleep (e.g. short alarm timer, or an unusually long suspend
routine).

If this happens, the RTC alarm should trigger a wakeup event, possibly
aborting system suspend. This condition can be detected in the form
of an RTC alarm interrupt.

Signed-off-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Paul Fox 13 년 전
부모
커밋
b45bae36b8
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      drivers/rtc/rtc-cmos.c

+ 1 - 0
drivers/rtc/rtc-cmos.c

@@ -568,6 +568,7 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
 		hpet_mask_rtc_irq_bit(RTC_AIE);
 		hpet_mask_rtc_irq_bit(RTC_AIE);
 
 
 		CMOS_READ(RTC_INTR_FLAGS);
 		CMOS_READ(RTC_INTR_FLAGS);
+		pm_wakeup_event(cmos_rtc.dev, 0);
 	}
 	}
 	spin_unlock(&rtc_lock);
 	spin_unlock(&rtc_lock);