From patchwork Fri Oct 5 07:43:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11998 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 855BE23F5F for ; Fri, 5 Oct 2012 07:44:42 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1C9BFA18ED9 for ; Fri, 5 Oct 2012 07:44:42 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3019307iej.11 for ; Fri, 05 Oct 2012 00:44:41 -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=19flfFR9iu7i5oO0hnnuPpzuyPlJ/2agya21khC0iIk=; b=iFctVFFPExKtJdnewXcLHvfgLeP6Brw2hQMIMsJyULeNZh10MdzMEfmFBcrp9eAv9y jA4/YEHzXgHv2tqTX0p5pSmjcdyr/hgspz5wThNaSH5gE67f7Fmwa5aBtzev0RB8Md+i Jhryt8M4TJYLTHCKvDiacpeqGIHxZ22BGXTaBSUSHDQ0qh2b0Em5/FcTwW0lOgc+Rlbc UjxXhVTvKvbqMfWJ92nO8yA1hEEE0Dtk1JmgUaAskPxKT/igZZ/WTY4CzT1Q+EySCm65 PtWtoOI84Fv6OniaH8wN+X3gNkGDjYoCqLUp5kWyerCJhq11yX4Nfvz8AzTEaSEveo8A Se5Q== Received: by 10.50.0.193 with SMTP id 1mr469750igg.0.1349423081462; Fri, 05 Oct 2012 00:44:41 -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.184.232 with SMTP id ex8csp111964igc; Fri, 5 Oct 2012 00:44:40 -0700 (PDT) Received: by 10.14.209.5 with SMTP id r5mr11742756eeo.28.1349423079686; Fri, 05 Oct 2012 00:44:39 -0700 (PDT) Received: from eu1sys200aog101.obsmtp.com (eu1sys200aog101.obsmtp.com [207.126.144.111]) by mx.google.com with SMTP id g9si1246470eep.96.2012.10.05.00.44.27 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Oct 2012 00:44:39 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.111 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.111; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.111 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob101.postini.com ([207.126.147.11]) with SMTP ID DSNKUG6P2IAYS39lhCFPiB/EMqtovzO9q5cq@postini.com; Fri, 05 Oct 2012 07:44:39 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 662BA40; Fri, 5 Oct 2012 07:43:07 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id F3EA758; Fri, 5 Oct 2012 03:26:29 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 2C45DA8074; Fri, 5 Oct 2012 09:43:35 +0200 (CEST) Received: from steludxu1397.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 5 Oct 2012 09:43:37 +0200 From: Ulf Hansson To: Mark Brown , Grant Likely , Cc: , Linus Walleij , Vipul Kumar Samar , Viresh Kumar , Russell King , Ulf Hansson Subject: [PATCH] spi/pl022: Activate resourses before deactivate them in suspend Date: Fri, 5 Oct 2012 09:43:32 +0200 Message-ID: <1349423012-18048-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnX5R9EcE/i0xOLjmeHlt7gWFKsUHNosLJR8/S4muO3rl0SHvbQH9U6Kokd2x8edokosANU 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 --- 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 9194641..c3590e0 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2350,6 +2350,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"); @@ -2362,6 +2364,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);