From patchwork Wed Oct 17 12:27:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12312 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A21461D5170 for ; Wed, 17 Oct 2012 12:27:37 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 538C5A183CE for ; Wed, 17 Oct 2012 12:27:37 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so5244673iag.11 for ; Wed, 17 Oct 2012 05:27:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=19h+ff4YObFWir6eaC0IWpW8Xv79C14i1NNmLKcWVbA=; b=YCc5xntSL+Qspaqod4XVvoX1+wWZF9XQBdxqsy0DHqqYcG3VYCc1Clr5yExXsumyyT KDUoIcbU/teWb0bOkkxG8kru+8aLAdGRRQS1QBlY+RNVywTHSDxDcOptlY7Beg+fgnsd p/P+rqPR2ItHq82wRDZRJ7qmoB/aB+i5ioyDcRdCbU3rvUEGWiD9BInKUjknvAcofvdc OhDzgt3fqNUaoPGwZ9ikQ4ZMrEQHH0ee5abR+IAaT6vAjALJrX4yNu79hKJXSieJ5ZO6 I516subPRqZsHCIntILPLWrwT89ylsSuhMZ7kS/WT+ekNf4sCubUNs0OtMaU2Jn5zfmv vl8w== Received: by 10.43.7.132 with SMTP id oo4mr14298656icb.6.1350476856704; Wed, 17 Oct 2012 05:27:36 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp886813igt; Wed, 17 Oct 2012 05:27:35 -0700 (PDT) Received: by 10.14.212.72 with SMTP id x48mr26438264eeo.40.1350476854969; Wed, 17 Oct 2012 05:27:34 -0700 (PDT) Received: from eu1sys200aog105.obsmtp.com (eu1sys200aog105.obsmtp.com [207.126.144.119]) by mx.google.com with SMTP id f43si16477086eem.18.2012.10.17.05.27.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 05:27:34 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.119; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob105.postini.com ([207.126.147.11]) with SMTP ID DSNKUH6kKy4kQU19tPRse8a4ifdMjiYOWirG@postini.com; Wed, 17 Oct 2012 12:27:34 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 6B6BC94; Wed, 17 Oct 2012 12:19:05 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 19A6EE9E; Wed, 17 Oct 2012 12:27:19 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id A526A24C07D; Wed, 17 Oct 2012 14:27:11 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 17 Oct 2012 14:27:18 +0200 From: Linus Walleij To: Grant Likely , Mark Brown , Cc: Anmar Oueja , Ulf Hansson , Linus Walleij Subject: [PATCH 3/4] spi/pl022: Activate resourses before deactivate them in suspend Date: Wed, 17 Oct 2012 14:27:16 +0200 Message-ID: <1350476836-13128-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkLAKSWDh2SGothyUtggRiqWZsjXsyHBgRG5i5xnkfBG0HsHs+z+ygsI/3LxUmQL7uFZPnR From: Ulf Hansson To be able to deactivate resourses in suspend, the resourses must first be surely active. This is done with a pm_runtime_get_sync. Once the resourses are restored to active state again in resume, the runtime pm usage count can be decreased with a pm_runtime_put. Signed-off-by: Ulf Hansson Signed-off-by: Linus Walleij --- drivers/spi/spi-pl022.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 51b7a95..51329b2 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2346,6 +2346,8 @@ static int pl022_suspend(struct device *dev) dev_warn(dev, "cannot suspend master\n"); return ret; } + + pm_runtime_get_sync(dev); pl022_suspend_resources(pl022); dev_dbg(dev, "suspended\n"); @@ -2358,6 +2360,7 @@ static int pl022_resume(struct device *dev) int ret; pl022_resume_resources(pl022); + pm_runtime_put(dev); /* Start the queue running */ ret = spi_master_resume(pl022->master);