From patchwork Mon Dec 24 09:51:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 208045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-vb0-f63.google.com (mail-vb0-f63.google.com [209.85.212.63]) (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 2112E2C008F for ; Mon, 24 Dec 2012 20:52:17 +1100 (EST) Received: by mail-vb0-f63.google.com with SMTP id fc26sf3621723vbb.8 for ; Mon, 24 Dec 2012 01:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:x-beenthere:x-received:x-received:received-spf :x-pgp-universal:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:mime-version: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=2j1p/rAkq7FOkEKMFlKW/mcpBlyQ4rUVbUZ2EZmoCKw=; b=joBzv7VEb3EncXQq4ECDaBGXfDKNTd7dKiny1ia4vLJNlMK7KXKfV/cfnlGjxH1Rcn whFLrJVSAkHPQxf1lUlU6cLq5rWauA4O6DHgM+qaTHorU+SXFiGa71BlymIfz0y0ruE9 pNCsqi7pIGqTJMfwWBsbKnROhvWoEWrGuKDPZkQ1uZMPFEeqKnywVhYq68X9YKbfssgX 0s6GzZwLJjFYFFEN/s3BMF8HQgK5vHm1EK0PZlalOgu3VeN7pD9oZ0WEc/q6bUd2M9uj zLNiUWy5OugEiBWh1d0l+72CQ3mCLEK+8lZvrr5A3s7Ky3VoBlCPstc/t5ENsgEKtjcX 9viw== X-Received: by 10.50.135.33 with SMTP id pp1mr5590670igb.14.1356342734783; Mon, 24 Dec 2012 01:52:14 -0800 (PST) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.151.243 with SMTP id ut19ls4994738igb.20.gmail; Mon, 24 Dec 2012 01:52:13 -0800 (PST) X-Received: by 10.66.78.132 with SMTP id b4mr3395705pax.18.1356342733923; Mon, 24 Dec 2012 01:52:13 -0800 (PST) X-Received: by 10.66.78.132 with SMTP id b4mr3395704pax.18.1356342733913; Mon, 24 Dec 2012 01:52:13 -0800 (PST) Received: from hqemgate04.nvidia.com (hqemgate04.nvidia.com. [216.228.121.35]) by gmr-mx.google.com with ESMTPS id js4si4054592pbb.2.2012.12.24.01.52.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 01:52:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.35 as permitted sender) client-ip=216.228.121.35; Received: from hqnvupgp06.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Mon, 24 Dec 2012 01:51:29 -0800 Received: from hqemhub01.nvidia.com ([172.17.108.22]) by hqnvupgp06.nvidia.com (PGP Universal service); Mon, 24 Dec 2012 01:49:54 -0800 X-PGP-Universal: processed; by hqnvupgp06.nvidia.com on Mon, 24 Dec 2012 01:49:54 -0800 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server id 8.3.279.1; Mon, 24 Dec 2012 01:51:47 -0800 Received: from daphne.nvidia.com (Not Verified[172.16.212.96]) by hqnvemgw02.nvidia.com with MailMarshal (v6,7,2,8378) id ; Mon, 24 Dec 2012 01:51:47 -0800 Received: from ldewangan-ubuntu.nvidia.com ([10.19.65.30]) by daphne.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id qBO9pY8K007111; Mon, 24 Dec 2012 01:51:45 -0800 (PST) From: Laxman Dewangan To: CC: , , , , Laxman Dewangan Subject: [rtc-linux] [PATCH 4/4] rtc: tps65910: set irq flag to IRQF_EARLY_RESUME during irq request Date: Mon, 24 Dec 2012 15:21:27 +0530 Message-ID: <1356342687-3432-5-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: <1356342687-3432-1-git-send-email-ldewangan@nvidia.com> References: <1356342687-3432-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 X-Original-Sender: ldewangan@nvidia.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.35 as permitted sender) smtp.mail=ldewangan@nvidia.com 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: , All interrupt get disabled during system suspend and enabled during system resume. The enabling/disabling of interrupt happen in sequence of interrupt registration with framework. Therefore, in resume, the parent interrupt of this device enabled before the RTC irq interrupt enabled. If RTC is enabled for alarm wake and if system wake by alarm then there is interrupt pending for RTC. In resume, the parent interrupt get enabled before the rtc interrupt and hence ISR get served. In ISR, it founds that rtc interrupt is disabled and so it does not call the rtc isr handler and hence it misses the interrupt. Setting flag for early resume so that rtc interrupt get enabled before parent interrupt and so rtc interrupt get enabled when parent interrupt handler check for interrupt of device and call the rtc handler if it is there. This way it will not miss the interrupt. Signed-off-by: Laxman Dewangan --- drivers/rtc/rtc-tps65910.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c index ff98e18..d2e1c08 100644 --- a/drivers/rtc/rtc-tps65910.c +++ b/drivers/rtc/rtc-tps65910.c @@ -267,7 +267,7 @@ static int __devinit tps65910_rtc_probe(struct platform_device *pdev) } ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, - tps65910_rtc_interrupt, IRQF_TRIGGER_LOW, + tps65910_rtc_interrupt, IRQF_TRIGGER_LOW | IRQF_EARLY_RESUME, dev_name(&pdev->dev), &pdev->dev); if (ret < 0) { dev_err(&pdev->dev, "IRQ is not free.\n");