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: 53968 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id E60D922B04 for ; Mon, 21 Sep 2015 15:48:25 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf32797823wic.2 for ; Mon, 21 Sep 2015 08:48:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=nZqi8MiosOJLC+cFlTJBwa7rivX01v6YlP4w71RI2fM=; b=Hnz+RUsxdnDQDWYdfsWJfzZ3MUUd9f5h1de5AlyNe2kqAgMa2FVNZ0VUGrpUlZlLiy zHqNyCuoBE+QLk3iOEmYpANHKvv+hCTAL7xyb1tGasTmhESyYztwI43jMRFQ0wKz/jup hD63CC4ww74ilMbi7QbHRq1pPGDaur9fA4gcZ08ICzC/L18Yv6debxWzrwuyX6hLZH5C fwFVdsx0oRMbbNkQVFWpFCII/sO4IduUgWHjG+pNOvJgihg+h7gBF1criNwysBQc8vja isNK7eQt2Ow7fbV2HnPb/5RmL0F1vkEfWEfC7ysqJZqSN6xHLc8Js++l2zUbGcXrSHH6 WyZg== X-Gm-Message-State: ALoCoQkEgW/w23SwAYGVu7R2VSP9oFuhtgLvFlWVlmTY30kk4c+XqBCh5qyKuog5TYMtjAEopg69 X-Received: by 10.152.29.10 with SMTP id f10mr3395014lah.1.1442850505212; Mon, 21 Sep 2015 08:48:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.28.200 with SMTP id c191ls23805lfc.71.gmail; Mon, 21 Sep 2015 08:48:24 -0700 (PDT) X-Received: by 10.112.157.68 with SMTP id wk4mr7717787lbb.119.1442850504888; Mon, 21 Sep 2015 08:48:24 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id xf5si14911810lbb.93.2015.09.21.08.48.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Sep 2015 08:48:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lagj9 with SMTP id j9so71234649lag.2 for ; Mon, 21 Sep 2015 08:48:24 -0700 (PDT) X-Received: by 10.25.19.21 with SMTP id j21mr1556798lfi.106.1442850504754; Mon, 21 Sep 2015 08:48:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1784172lbq; Mon, 21 Sep 2015 08:48:23 -0700 (PDT) X-Received: by 10.66.144.199 with SMTP id so7mr25705467pab.42.1442850503640; Mon, 21 Sep 2015 08:48:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd6si38668670pad.84.2015.09.21.08.48.23; Mon, 21 Sep 2015 08:48:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932570AbbIUPsH (ORCPT + 30 others); Mon, 21 Sep 2015 11:48:07 -0400 Received: from foss.arm.com ([217.140.101.70]:53973 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932482AbbIUPsE (ORCPT ); Mon, 21 Sep 2015 11:48:04 -0400 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: [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> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sudeep.holla@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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[] = {