From patchwork Thu Jun 2 13:53:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 69165 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp129919qgf; Thu, 2 Jun 2016 06:53:15 -0700 (PDT) X-Received: by 10.98.103.220 with SMTP id t89mr4705867pfj.125.1464875595273; Thu, 02 Jun 2016 06:53:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 132si724678pfx.22.2016.06.02.06.53.15; Thu, 02 Jun 2016 06:53:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932705AbcFBNxO (ORCPT + 3 others); Thu, 2 Jun 2016 09:53:14 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:34961 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932167AbcFBNxM (ORCPT ); Thu, 2 Jun 2016 09:53:12 -0400 Received: by mail-lf0-f45.google.com with SMTP id w16so34448251lfd.2 for ; Thu, 02 Jun 2016 06:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=sqyidYGv3ShAHU5TSQpwreb6ptPDEYGnQ8QrAzcuAH8=; b=ZK8moxzge4QvJYIq7Wo/rAku92HekoeKaNyrojKXk5r5BmGvTGU0IsADfmwR/eZo5i n6tR1FMUspk4bWZV4JDjjDHEjQDj4wtN6RAYz0blPR3MhRhQfAgsbwDd3M81o0elD0ik FFkFhRDqWSPec5+1jVyQw8KTt45llFghDMAq8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sqyidYGv3ShAHU5TSQpwreb6ptPDEYGnQ8QrAzcuAH8=; b=eAqaSR6/mdFnqcIDzTVuLdkH21MqylcDdyEODzsCZ8buFS4EpZ+xYa8foFIFdYAjXK sdSOXCHIoN8lZMiqewW1Rhgszz1iEHwpwKv1043cC8lQw/xbz6SJNF6OFlCo4Krss1If +RhPj6Gv8z8sKX6f3CYa8SteDM7N3NXVC8igw4UJ81HmjSBoAzhAWkBTVDykA65AZ6BS EgG7mnXv5f+amcPKK4e7Qp63Wej4pgBmjxZ8C8o9VP2eQgdhAsAQiWIrS7CO3yfFkagI a3LE7NnzHyu2hendF4MpGqEfTQpCVycCBVKulWstlTAXalNwRNaWpNaekH7WbVZqRtn3 gIHw== X-Gm-Message-State: ALyK8tIkC6/rEW8A0y5vtMoGWypKqGzIPXxoUWdtCqDF4Me/wwC+ncJLpNHUACIuREg/xNHY X-Received: by 10.25.135.5 with SMTP id j5mr4215808lfd.105.1464875591095; Thu, 02 Jun 2016 06:53:11 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id g82sm3334225ljg.45.2016.06.02.06.53.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jun 2016 06:53:10 -0700 (PDT) From: Linus Walleij To: Alessandro Zummo , Alexandre Belloni Cc: rtc-linux@googlegroups.com, Linus Walleij , stable@vger.kernel.org, Sudeep Holla , Ulf Hansson Subject: [PATCH] rtc: ab8500: move device_init_wakeup() call Date: Thu, 2 Jun 2016 15:53:04 +0200 Message-Id: <1464875584-31505-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.11 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org commit 93a6f9168f2f ("rtc: ab8500: remove misuse of IRQF_NO_SUSPEND flag") introduced the dev_pm_set_wake_irq() call to register a wake IRQ for the AB8500 driver. However this causes a regression since device_init_wakeup() must be called *after* dev_pm_set_wake_irq() not *before* it. Before this patch we get an error message like this during system resume from sleep: [ 217.585571] PM: noirq resume of devices complete after 0.762 msecs [ 217.585815] ------------[ cut here ]------------ [ 217.585845] WARNING: CPU: 0 PID: 200 at ../kernel/irq/manage.c:603 irq_set_irq_wake+0xc4/0xf8 [ 217.585845] Unbalanced IRQ 396 wake disable [ 217.585845] Modules linked in: [ 217.585876] CPU: 0 PID: 200 Comm: sh Tainted: G W 4.6.0-rc1-00010-gc6ade5a1da15-dirty #123 [ 217.585876] Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support) [ 217.585906] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 217.585937] [] (show_stack) from [] (dump_stack+0x8c/0xa0) [ 217.585937] [] (dump_stack) from [] (__warn+0xe8/0x100) [ 217.585937] [] (__warn) from [] (warn_slowpath_fmt+0x38/0x48) [ 217.585967] [] (warn_slowpath_fmt) from [] (irq_set_irq_wake+0xc4/0xf8) [ 217.585967] [] (irq_set_irq_wake) from [] (device_wakeup_disarm_wake_irqs+0x30/0x48) [ 217.585998] [] (device_wakeup_disarm_wake_irqs) from [] (dpm_resume_noirq+0x208/0x21c) [ 217.585998] [] (dpm_resume_noirq) from [] (suspend_devices_and_enter+0x1dc/0x444) [ 217.585998] [] (suspend_devices_and_enter) from [] (pm_suspend+0x1fc/0x25c) [ 217.585998] [] (pm_suspend) from [] (state_store+0x68/0xb8) [ 217.586029] [] (state_store) from [] (kernfs_fop_write+0xb8/0x1b4) [ 217.586029] [] (kernfs_fop_write) from [] (__vfs_write+0x1c/0xd8) [ 217.586059] [] (__vfs_write) from [] (vfs_write+0x90/0x19c) [ 217.586059] [] (vfs_write) from [] (SyS_write+0x44/0x9c) [ 217.586059] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x3c) [ 217.586090] ---[ end trace 78c75240315212f4 ]--- This patch fixes it. Cc: stable@vger.kernel.org Fixes: 93a6f9168f2f ("rtc: ab8500: remove misuse of IRQF_NO_SUSPEND flag") Cc: Sudeep Holla Cc: Ulf Hansson Signed-off-by: Linus Walleij --- drivers/rtc/rtc-ab8500.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.4.11 -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c index 24a0af650a1b..5e9cb4132eb1 100644 --- a/drivers/rtc/rtc-ab8500.c +++ b/drivers/rtc/rtc-ab8500.c @@ -482,8 +482,6 @@ static int ab8500_rtc_probe(struct platform_device *pdev) return -ENODEV; } - device_init_wakeup(&pdev->dev, true); - rtc = devm_rtc_device_register(&pdev->dev, "ab8500-rtc", (struct rtc_class_ops *)platid->driver_data, THIS_MODULE); @@ -500,6 +498,8 @@ static int ab8500_rtc_probe(struct platform_device *pdev) return err; dev_pm_set_wake_irq(&pdev->dev, irq); + device_init_wakeup(&pdev->dev, true); + platform_set_drvdata(pdev, rtc); err = ab8500_sysfs_rtc_register(&pdev->dev);