From patchwork Mon Sep 21 15:46:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 520352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-qg0-x237.google.com (mail-qg0-x237.google.com [IPv6:2607:f8b0:400d:c04::237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C131B1401AF for ; Tue, 22 Sep 2015 01:48:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=U5bVJzpP; dkim-atps=neutral Received: by qgez77 with SMTP id z77sf18646344qge.0 for ; Mon, 21 Sep 2015 08:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:content-type:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe; bh=SlLi1cf+8Ip/MdxHuSKgiSWP3s77cIW/7J3Le5BqABg=; b=U5bVJzpP7xSTDnWzHpobPjL9PKBej3G288LQYNkchXQtuspbGD0xSuJAewvqrSqnGr v/oVLaiHp5/aC06NSIntDDacxTEnt6Syzy0h1hVKZs0VCEOZHStcbbLyZ4zaXtJdn1cM pjIzY3X5mDVoNacxrVoF8FYwZMI1tVmDrBkkG+FeesECXsPvwhtYy4c7FlQ0oxJERCx/ NegoDMW6x2pDJhlo7m0LrexQRAj2eDqn4qtbbX/O205J9aSPjzT+nd/hgi1riFb6jP3U HmJy6vpB9mVFS3oKmuMJxTl6B8Vl9bsLJAoPZiEQITuRGyfukgE2ZBVZrarBILigzWMm Jy2A== X-Received: by 10.182.221.133 with SMTP id qe5mr85693obc.6.1442850485374; Mon, 21 Sep 2015 08:48:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.182.28.165 with SMTP id c5ls923402obh.96.gmail; Mon, 21 Sep 2015 08:48:05 -0700 (PDT) X-Received: by 10.182.126.228 with SMTP id nb4mr17379189obb.19.1442850484999; Mon, 21 Sep 2015 08:48:04 -0700 (PDT) Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by gmr-mx.google.com with ESMTP id fk4si3112869pbc.2.2015.09.21.08.48.04 for ; Mon, 21 Sep 2015 08:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of sudeep.holla@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7FB3D49; Mon, 21 Sep 2015 08:48:08 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.207.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8893D3F2E5; Mon, 21 Sep 2015 08:48:02 -0700 (PDT) From: Sudeep Holla To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Thomas Gleixner , "Rafael J. Wysocki" , Linus Walleij , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com Subject: [rtc-linux] [PATCH 01/17] rtc: pl031: remove misuse of IRQF_NO_SUSPEND flag Date: Mon, 21 Sep 2015 16:46:57 +0100 Message-Id: <1442850433-5903-2-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442850433-5903-1-git-send-email-sudeep.holla@arm.com> References: <1442850433-5903-1-git-send-email-sudeep.holla@arm.com> X-Original-Sender: sudeep.holla@arm.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of sudeep.holla@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=sudeep.holla@arm.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-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , The IRQF_NO_SUSPEND flag is used to identify the interrupts that should be left enabled so as to allow them to work as expected during the suspend-resume cycle, but doesn't guarantee that it will wake the system from a suspended state, enable_irq_wake is recommended to be used for the wakeup. This patch removes the use of IRQF_NO_SUSPEND flags and uses newly introduce PM wakeup APIs dev_pm_{set,clear}_wake_irq. Cc: Linus Walleij Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: rtc-linux@googlegroups.com Signed-off-by: Sudeep Holla Acked-by: Linus Walleij --- drivers/rtc/rtc-pl031.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 41dcb7ddb906..e1687e19c59f 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -23,6 +23,7 @@ #include #include #include +#include #include /* @@ -305,6 +306,8 @@ static int pl031_remove(struct amba_device *adev) { struct pl031_local *ldata = dev_get_drvdata(&adev->dev); + dev_pm_clear_wake_irq(&adev->dev); + device_init_wakeup(&adev->dev, false); free_irq(adev->irq[0], ldata); rtc_device_unregister(ldata->rtc); iounmap(ldata->base); @@ -370,7 +373,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) } } - device_init_wakeup(&adev->dev, 1); + device_init_wakeup(&adev->dev, true); ldata->rtc = rtc_device_register("pl031", &adev->dev, ops, THIS_MODULE); if (IS_ERR(ldata->rtc)) { @@ -383,7 +386,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) ret = -EIO; goto out_no_irq; } - + dev_pm_set_wake_irq(&adev->dev, adev->irq[0]); return 0; out_no_irq: @@ -408,7 +411,6 @@ static struct pl031_vendor_data arm_pl031 = { .set_alarm = pl031_set_alarm, .alarm_irq_enable = pl031_alarm_irq_enable, }, - .irqflags = IRQF_NO_SUSPEND, }; /* The First ST derivative */ @@ -422,7 +424,6 @@ static struct pl031_vendor_data stv1_pl031 = { }, .clockwatch = true, .st_weekday = true, - .irqflags = IRQF_NO_SUSPEND, }; /* And the second ST derivative */ @@ -439,8 +440,10 @@ static struct pl031_vendor_data stv2_pl031 = { /* * This variant shares the IRQ with another block and must not * suspend that IRQ line. + * TODO check if it shares with IRQF_NO_SUSPEND user, else we can + * remove IRQF_COND_SUSPEND */ - .irqflags = IRQF_SHARED | IRQF_NO_SUSPEND, + .irqflags = IRQF_SHARED | IRQF_COND_SUSPEND, }; static struct amba_id pl031_ids[] = {