From patchwork Thu Sep 17 08:28:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inha Song X-Patchwork-Id: 7203311 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A1418BEEC1 for ; Thu, 17 Sep 2015 08:29:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3F67207EF for ; Thu, 17 Sep 2015 08:29:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6CF64207E8 for ; Thu, 17 Sep 2015 08:29:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C1CED2652AC; Thu, 17 Sep 2015 10:29:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 066CC265196; Thu, 17 Sep 2015 10:29:00 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7ABA42651A8; Thu, 17 Sep 2015 10:28:58 +0200 (CEST) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id 1EB57265161 for ; Thu, 17 Sep 2015 10:28:51 +0200 (CEST) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NUT028P5BJZ4B70@mailout1.samsung.com> for alsa-devel@alsa-project.org; Thu, 17 Sep 2015 17:28:47 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.115]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 9E.8D.17770.FB97AF55; Thu, 17 Sep 2015 17:28:47 +0900 (KST) X-AuditID: cbfee691-f79ca6d00000456a-fb-55fa79bf1b0c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id CE.44.18629.FB97AF55; Thu, 17 Sep 2015 17:28:47 +0900 (KST) Received: from songinha-Samsung-DeskTop-System.10.32.193.11 ([10.252.81.136]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NUT00EP3BJYZH70@mmp1.samsung.com>; Thu, 17 Sep 2015 17:28:47 +0900 (KST) From: Inha Song To: lee.jones@linaro.org, broonie@kernel.org Date: Thu, 17 Sep 2015 17:28:47 +0900 Message-id: <1442478527-29304-1-git-send-email-ideal.song@samsung.com> X-Mailer: git-send-email 2.0.0.390.gcb682f8 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsWyRsSkWHd/5a9Qg8MXjC2uXDzEZDH14RM2 i11/7zNa3P96lNHi8q45bBbL3/5nszjdzerA7rHhcxObx6ZVnWwed67tYfOYdzLQ4+XE32we fVtWMXp83iQXwB7FZZOSmpNZllqkb5fAlfFj0SvGgtl8FSd/vWVuYLzN3cXIySEhYCLRv2sl E4QtJnHh3nq2LkYuDiGBFYwSbSe+scEUNb89DJVYyiixf9JZZghnIpPEit5T7CBVbAIaEt8/ bwZKcHCICOhIXL+RDlLDLLCQUeLsw02MIDXCAlkSfyY2gK1jEVCV6H7VygpSzyvgJvG4KQFi mbbEvoaZYMskBPrZJW7v2McCUS8g8W3yIRaQegkBWYlNB5gh6iUlDq64wTK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iQysS4xutb3+WmLdeb8IkUN70Vrbnzcc987V7cu diX/t7v6kRM1t+wOChbTcbB0OS616qlRofUm6+12Gm8mXf5dmKGi/XxGfVfawvtpL2b798qJ HBQWeCMieOPxX9bTm3danlhWfzJEarfV/IA1SizFGYmGWsxFxYkA0lVNQasCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, Inha Song , linux-kernel@vger.kernel.org, sameo@linux.intel.com Subject: [alsa-devel] [PATCH] mfd: arizona: Call the runtime PM function if the state is runtime resumed X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch call runtiem PM function manually if the state is runtime resumed before enter suspend. This case has occurred when wake-up by the resume after entering to suspend during the playback. $ aplay -> runtime_resume() -> suspend() -> resume() In this case, Can occurred an error when enter suspend. --- [ 82.559234] PM: suspend of devices complete after 57.252 msecs [ 82.567978] arizona spi1.0: Failed to read IRQ status: -108 [ 82.567989] arizona spi1.0: Failed to read main IRQ status: -108 [ 82.568027] arizona spi1.0: Failed to read IRQ status: -108 [ 82.568036] arizona spi1.0: Failed to read main IRQ status: -108 .... So, we should call runtime_suspend() manually when enter suspend if the state is runtime resume. Also should call runtime_resume() when wake-up by resume if the state was runtime resume before entering suspend. Signed-off-by: Inha Song --- drivers/mfd/arizona-core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 908c69b..de55706 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -683,6 +683,10 @@ static int arizona_suspend(struct device *dev) struct arizona *arizona = dev_get_drvdata(dev); dev_dbg(arizona->dev, "Suspend, disabling IRQ\n"); + + if (!pm_runtime_status_suspended(dev)) + arizona_runtime_suspend(dev); + disable_irq(arizona->irq); return 0; @@ -713,6 +717,10 @@ static int arizona_resume(struct device *dev) struct arizona *arizona = dev_get_drvdata(dev); dev_dbg(arizona->dev, "Late resume, reenabling IRQ\n"); + + if (!pm_runtime_status_suspended(dev)) + arizona_runtime_resume(dev); + enable_irq(arizona->irq); return 0;