From patchwork Tue Sep 17 18:29:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 20376 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4F7D0202DB for ; Tue, 17 Sep 2013 18:29:27 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id db12sf6159984veb.10 for ; Tue, 17 Sep 2013 11:29:26 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=TclvfLblOgoWj6ai2/5l9Mh8zZ8yVwge0kEjFz3A/sI=; b=OfTkw7mEfbk7V9dYF5iicVbK0Q3mNVdUvR4agMo4pr9C/cGEzg0ObjbaiEzhZfQ5GH Ha3IaZs6aR/KlDtW57BQr9BYNN6qDYJwsDzY4C+PcKJGxSZABznJJjuQToaKWOTwI4Uw 7SWcv4977NDhJVA9PTfVjnt/qoAUM+vhycsdo+vesPm0MtltsGa6S3gDFMRAgj6Fr+x4 xGv9YkP0Bgw2SwKnt79TjBkBMoTG24GNSHcd4H3uySKz9BkLY5OmrH4MHSCNhcn1PVC2 xO61APMQsIIdjVgbXaCY2UwcNKpsPbmh9zP9OdtXScr30uxi9/lB0ygMovvYAO0HkWhC wf8A== X-Gm-Message-State: ALoCoQnIAQwYNwfY1wVESlDizAV0/JhAs205do5WhjT017dq9S4q+9Z1wmeHME4CGRK4P4HaDqCK X-Received: by 10.236.17.161 with SMTP id j21mr641662yhj.55.1379442566526; Tue, 17 Sep 2013 11:29:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.117.129 with SMTP id ke1ls2885148qeb.88.gmail; Tue, 17 Sep 2013 11:29:26 -0700 (PDT) X-Received: by 10.220.74.69 with SMTP id t5mr13072992vcj.18.1379442566411; Tue, 17 Sep 2013 11:29:26 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id sc5si9042445vdc.48.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Sep 2013 11:29:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so4494808veb.41 for ; Tue, 17 Sep 2013 11:29:26 -0700 (PDT) X-Received: by 10.220.199.5 with SMTP id eq5mr33511302vcb.16.1379442566164; Tue, 17 Sep 2013 11:29:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp173838vcz; Tue, 17 Sep 2013 11:29:25 -0700 (PDT) X-Received: by 10.66.227.194 with SMTP id sc2mr38810017pac.41.1379442564701; Tue, 17 Sep 2013 11:29:24 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id qe4si20891558pbc.118.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Sep 2013 11:29:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.50; Received: by mail-pb0-f50.google.com with SMTP id uo5so5862640pbc.23 for ; Tue, 17 Sep 2013 11:29:24 -0700 (PDT) X-Received: by 10.66.175.133 with SMTP id ca5mr38841206pac.40.1379442564119; Tue, 17 Sep 2013 11:29:24 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id uw6sm39857975pbc.8.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Sep 2013 11:29:23 -0700 (PDT) From: John Stultz To: LKML Cc: John Stultz , Linus Walleij , Alessandro Zummo , "Jon Medhurst (Tixy)" , linux-arm-kernel@lists.infradead.org Subject: [RFC][PATCH] rtc: rtc-pl031: Set wakeup flag prior to registering rtcdev Date: Tue, 17 Sep 2013 11:29:10 -0700 Message-Id: <1379442550-24860-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In some recent testing, I noticed the CLOCK_REALTIME_ALARM clockid wasn't functioning on my vexpress qemu environment. Looking into it I noticed the pl031 rtc driver doesn't set the wakeup flag on the device until after registering the device with the RTC subsystem. This causes the alarmtimer subsystem to not see the pl031 driver as a valid backing device, and that resuls in alarm clockids getting ENOTSUPP errors. Thus be sure to set the wakeup flag on the device prior to registering the rtcdev so the pl031 rtc driver can be used as the backing alarmtimer device. Let me know if you have any feedback or objections to this. If it looks ok, I'll queue it for 3.13. I suspect there may be other RTC drivers with the same problem. Cc: Linus Walleij Cc: Alessandro Zummo Cc: "Jon Medhurst (Tixy)" Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: John Stultz --- drivers/rtc/rtc-pl031.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 0f0609b..e3b2571 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -371,6 +371,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) } } + device_init_wakeup(&adev->dev, 1); ldata->rtc = rtc_device_register("pl031", &adev->dev, ops, THIS_MODULE); if (IS_ERR(ldata->rtc)) { @@ -384,8 +385,6 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) goto out_no_irq; } - device_init_wakeup(&adev->dev, 1); - return 0; out_no_irq: