From patchwork Sun Jul 15 21:08:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 171103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-fa0-f56.google.com (mail-fa0-f56.google.com [209.85.161.56]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 746342C00DA for ; Mon, 16 Jul 2012 07:09:03 +1000 (EST) Received: by faic20 with SMTP id c20sf2684397fai.11 for ; Sun, 15 Jul 2012 14:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:message-id :date:x-cloudmark-analysis:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=gu9sk4p9kDP92f7tAk48YRubT2v5r840fNmAtk0Um10=; b=2r3oIbSp2qULXIoZ/sbkehgTOjUSa88ND2XAVwigZaG9uBf2WTGzninfYWMuS0beyt cRB59z4Vg5+fgDHz7wZQjeiKQ3kLbMfccBh2D4/R+xTar5uriXo1gkLkp25B/mtDJ3FH BRZW0Q3DoeQxw1QGVZA8nnOG1vcesv3rmKmtw= Received: by 10.180.14.134 with SMTP id p6mr459198wic.1.1342386539774; Sun, 15 Jul 2012 14:08:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.216.151.146 with SMTP id b18ls5257156wek.6.gmail; Sun, 15 Jul 2012 14:08:58 -0700 (PDT) Received: by 10.180.98.234 with SMTP id el10mr898294wib.3.1342386538271; Sun, 15 Jul 2012 14:08:58 -0700 (PDT) Received: by 10.180.98.234 with SMTP id el10mr898293wib.3.1342386538259; Sun, 15 Jul 2012 14:08:58 -0700 (PDT) Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com. [81.103.221.48]) by gmr-mx.google.com with ESMTP id cx9si1971674wib.0.2012.07.15.14.08.57; Sun, 15 Jul 2012 14:08:58 -0700 (PDT) Received-SPF: neutral (google.com: 81.103.221.48 is neither permitted nor denied by best guess record for domain of dsd@laptop.org) client-ip=81.103.221.48; Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20120715210857.KMNE14795.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Sun, 15 Jul 2012 22:08:57 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20120715210857.OMZG23973.aamtaout03-winn.ispmail.ntl.com@zog.reactivated.net>; Sun, 15 Jul 2012 22:08:57 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id E2DDC9D401E; Sun, 15 Jul 2012 22:08:54 +0100 (BST) From: Daniel Drake To: a.zummo@towertech.it, rjw@sisk.pl Cc: linux-pm@vger.kernel.org, rtc-linux@googlegroups.com, pgf@laptop.org Subject: [rtc-linux] [PATCH] rtc-cmos: report wakeups from interrupt handler Message-Id: <20120715210854.E2DDC9D401E@zog.reactivated.net> Date: Sun, 15 Jul 2012 22:08:54 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=AUhbpHVS+xhHrj9wLCYAQoYnFLYUZdbP8UM0GmH2jwk= c=1 sm=0 a=8Iwvez7dn4cA:10 a=vJ1w_8FsMGIA:10 a=Op-mwl0xAAAA:8 a=RB1fOy1bV0XGdTjI26gA:9 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Original-Sender: dsd@laptop.org X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 81.103.221.48 is neither permitted nor denied by best guess record for domain of dsd@laptop.org) smtp.mail=dsd@laptop.org Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , From: Paul Fox 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 Signed-off-by: Daniel Drake --- drivers/rtc/rtc-cmos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 4267789..635fd4c 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/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); CMOS_READ(RTC_INTR_FLAGS); + pm_wakeup_event(cmos_rtc.dev, 0); } spin_unlock(&rtc_lock);