From patchwork Wed Apr 23 19:52:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 28937 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8EB41203AC for ; Wed, 23 Apr 2014 19:52:33 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id hw13sf4430531qab.7 for ; Wed, 23 Apr 2014 12:52:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=hnAR7p8f28lUH3167bg0mKK9RhjPlMPEIYQPWRREE5c=; b=O7bfDrN5YxmTs20Mv+ulorGg1KGTDhDw6ky/qFMBALQV1i1BAS58Qe4pLjdoIZlOl+ ER01O/SRqTlqj5/1/QLRBrqQVN97XCfoeJ/iStnnyJWy65XgZ55zn5g3qdyCkK1e5crg 56DCF7vUw+M95bEPSlY6wfBNyGw/YitHwvGSbOgSzgnuQReSLpoCdszRvC1j3J4z8koi hDLYulafbT/DX0Ikwzed6DECHQ3kc44Rz4FnqfF74PASGiuY35IS2Plsw8wiR4supYGa h/YXPmSQsjWatQfHoDA2zQ5jBBSEaDpFvsmkjKMorV7SbPxJLDcgqvlyT1hkxFd0OJiI lBqw== X-Gm-Message-State: ALoCoQmPH0V+aRQBlALjjNBcQKYCpEjI8NLNnTIjxnRezU0gllfx/fALB0O2ER6axgsRFWTx2WZH X-Received: by 10.236.137.50 with SMTP id x38mr26420069yhi.9.1398282752861; Wed, 23 Apr 2014 12:52:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.115 with SMTP id 106ls773378qgg.75.gmail; Wed, 23 Apr 2014 12:52:32 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr43689640vcb.0.1398282752768; Wed, 23 Apr 2014 12:52:32 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id wg4si387584vcb.38.2014.04.23.12.52.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 12:52:32 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so1729085veb.8 for ; Wed, 23 Apr 2014 12:52:32 -0700 (PDT) X-Received: by 10.220.106.7 with SMTP id v7mr1112434vco.46.1398282752662; Wed, 23 Apr 2014 12:52:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp129016vcb; Wed, 23 Apr 2014 12:52:32 -0700 (PDT) X-Received: by 10.112.35.202 with SMTP id k10mr866770lbj.14.1398282751681; Wed, 23 Apr 2014 12:52:31 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id g7si1413841lag.144.2014.04.23.12.52.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 12:52:31 -0700 (PDT) Received-SPF: none (google.com: ulf.hansson@linaro.org does not designate permitted sender hosts) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z11so1176530lbi.8 for ; Wed, 23 Apr 2014 12:52:31 -0700 (PDT) X-Received: by 10.112.13.72 with SMTP id f8mr3144177lbc.40.1398282751180; Wed, 23 Apr 2014 12:52:31 -0700 (PDT) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id zx3sm2038678lbc.2.2014.04.23.12.52.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 12:52:30 -0700 (PDT) From: Ulf Hansson To: Vinod Koul , Dan Williams , Linus Walleij , linux-arm-kernel@lists.infradead.org Cc: dmaengine@vger.kernel.org, Ulf Hansson Subject: [PATCH 4/4] dma: ste_dma40: Fixup system suspend/resume Date: Wed, 23 Apr 2014 21:52:04 +0200 Message-Id: <1398282724-2607-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398282724-2607-1-git-send-email-ulf.hansson@linaro.org> References: <1398282724-2607-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Make sure to handle register context save/restore when needed from system PM callbacks. Previously we solely trusted the device to reside in in-active state while the system suspend callback were invoked, which is just too optimistic. Signed-off-by: Ulf Hansson Acked-by: Linus Walleij --- drivers/dma/ste_dma40.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 0b29af3..b539fc9 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2945,7 +2945,11 @@ static int dma40_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct d40_base *base = platform_get_drvdata(pdev); - int ret = 0; + int ret; + + ret = pm_runtime_force_suspend(dev); + if (ret) + return ret; if (base->lcpa_regulator) ret = regulator_disable(base->lcpa_regulator); @@ -2958,10 +2962,13 @@ static int dma40_resume(struct device *dev) struct d40_base *base = platform_get_drvdata(pdev); int ret = 0; - if (base->lcpa_regulator) + if (base->lcpa_regulator) { ret = regulator_enable(base->lcpa_regulator); + if (ret) + return ret; + } - return ret; + return pm_runtime_force_resume(dev); } #endif