From patchwork Mon Apr 11 07:54:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 65444 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp1321594lbl; Mon, 11 Apr 2016 00:54:43 -0700 (PDT) X-Received: by 10.107.132.88 with SMTP id g85mr24171547iod.47.1460361282964; Mon, 11 Apr 2016 00:54:42 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g66si15913164iof.124.2016.04.11.00.54.42; Mon, 11 Apr 2016 00:54:42 -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 S1752374AbcDKHyl (ORCPT + 3 others); Mon, 11 Apr 2016 03:54:41 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:33190 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbcDKHyk (ORCPT ); Mon, 11 Apr 2016 03:54:40 -0400 Received: by mail-lf0-f42.google.com with SMTP id e190so143330782lfe.0 for ; Mon, 11 Apr 2016 00:54:39 -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=+ENbDytSGvzWW47grOziXscrQjHyInDT1tfFxv/UCS0=; b=KQ5z9q+pAQ/EQC1gniEU4VGLXNu19P0l39gKqj0bH0EdHDEw7HQmt4lz5Pxos3Fc7/ XKPsajB0kU6cBkIRsDv+vVIR0jrqlZ5bA0cAmdygQYWG0OvoLTipI7rCBTvpKV7nepae qlhDj9uFYdeYI00imzSbOcTHnUxO/iwOBRnnQ= 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=+ENbDytSGvzWW47grOziXscrQjHyInDT1tfFxv/UCS0=; b=kwZytNZKKqhv9WHVPLzLSoAc8pYUXLWIf5qkujo1tpGK6CiTMMWW+2QkEUhVO5274g BR8L1QDaPg0Wt7Dq64tPQGCmD2jakdJvuklVg0l37R/A6/YVRv/y6oMwbKeJ4X+Yf8H/ mEqKjzyTPHRhtK+8iMl7fkD4P9PXZwfrCltpqariiAPDErSKTBXFuXVzrLdL13VMsBpH kHrOmiLkgYaHfI3Sl+Wd+uZi+jhweejeoGyMFBoeVWcs+mPEo5FYTRi1jl90g9xHlRw0 KgxFU4KOISisIlkyNkeoeiDFnXsxQGub4gnXEaQJTGZPaZ/OSa+Ambq4Wv9PLPIKFbL5 /JWA== X-Gm-Message-State: AD7BkJKyAOnxamS3tE1j2CBzDpb0KNm+0pWkdokRJxwcUkBH2AdQjhhZctGA/1O2yw9tLrhW X-Received: by 10.25.155.85 with SMTP id d82mr8470468lfe.74.1460361278746; Mon, 11 Apr 2016 00:54:38 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id h196sm4358065lfg.35.2016.04.11.00.54.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 00:54:37 -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: Mon, 11 Apr 2016 09:54:26 +0200 Message-Id: <1460361266-20664-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 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.3 -- 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);