From patchwork Fri Mar 13 15:43:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 45791 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 36D28214BF for ; Fri, 13 Mar 2015 15:44:14 +0000 (UTC) Received: by lams18 with SMTP id s18sf17375985lam.2 for ; Fri, 13 Mar 2015 08:44:13 -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=LtJj5L1x7OYrw24VFYfX2aYJLOfTneQoQff9IACUe2g=; b=YkFY84+W6/r2OrJTUMpavLnpAERKVRwX8Azw711hYhkuz+DjA3QNAcLizngLs0+nRc 8zCw7PBsTGAL8Y84oB0bPxqZglWAmjwmhPeIM8A2agQgawaf9QdTtRv0mLa11zU4uIAx htZPYP/ayLi5ayAqoq4LyQzMQCg9Dj6OIVNxLJaT3/YzL5SNJRCM2v/dRLKtbPnU7qBa 0//5AAdA0kMMiM2G7lswt3IjrKkGVeJP9OC2ByNIUadXMs6fhoNUsZcp8NCa4N8SGrDr 9e4VwQOplDzhbiXtmsoaiNagcbtuhUsxpPrCiRxZwV3GP7XWF0YIQ7sj+UfnLa1iFQGy MSsQ== X-Gm-Message-State: ALoCoQldpq+S5ENtwspeEth6T4vLGuo4K5q8eUJbiDCW9MXOiCKCi7z99/OgyZYFAOgVumWCjvLC X-Received: by 10.112.125.67 with SMTP id mo3mr5665561lbb.6.1426261453144; Fri, 13 Mar 2015 08:44:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.140 with SMTP id ay12ls474111lab.2.gmail; Fri, 13 Mar 2015 08:44:13 -0700 (PDT) X-Received: by 10.152.206.70 with SMTP id lm6mr44681406lac.35.1426261453007; Fri, 13 Mar 2015 08:44:13 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id n6si1628042laf.170.2015.03.13.08.44.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 08:44:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbjf15 with SMTP id f15so23624137lbj.2 for ; Fri, 13 Mar 2015 08:44:12 -0700 (PDT) X-Received: by 10.112.130.39 with SMTP id ob7mr45233304lbb.32.1426261452937; Fri, 13 Mar 2015 08:44:12 -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.112.35.133 with SMTP id h5csp999989lbj; Fri, 13 Mar 2015 08:44:12 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr43018516laf.117.1426261452575; Fri, 13 Mar 2015 08:44:12 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id mp6si1650372lbb.4.2015.03.13.08.44.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 08:44:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labgm9 with SMTP id gm9so23445771lab.13 for ; Fri, 13 Mar 2015 08:44:12 -0700 (PDT) X-Received: by 10.112.239.1 with SMTP id vo1mr43969635lbc.110.1426261451789; Fri, 13 Mar 2015 08:44:11 -0700 (PDT) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id i9sm471248lbs.26.2015.03.13.08.44.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Mar 2015 08:44:11 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Kevin Hilman , linux-pm@vger.kernel.org Cc: Geert Uytterhoeven , Dmitry Torokhov , Russell King , Greg Kroah-Hartman , Mark Brown , Wolfram Sang , linux-arm-kernel@lists.infradead.org, Ulf Hansson Subject: [PATCH 3/9] amba: Keep PM domain powered during ->probe() Date: Fri, 13 Mar 2015 16:43:43 +0100 Message-Id: <1426261429-31883-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426261429-31883-1-git-send-email-ulf.hansson@linaro.org> References: <1426261429-31883-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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) 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: , To sucessfully probe some devices their corresponding PM domains may need to be powered. Use the dev_pm_domain_get|put() APIs, to control the behavior of the PM domain. Signed-off-by: Ulf Hansson --- drivers/amba/bus.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index f009936..19182b0 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -241,8 +241,15 @@ static int amba_probe(struct device *dev) if (ret == -EPROBE_DEFER) break; + ret = dev_pm_domain_get(dev->pm_domain); + if (ret) { + dev_pm_domain_detach(dev, true); + break; + } + ret = amba_get_enable_pclk(pcdev); if (ret) { + dev_pm_domain_put(dev->pm_domain); dev_pm_domain_detach(dev, true); break; } @@ -252,6 +259,7 @@ static int amba_probe(struct device *dev) pm_runtime_enable(dev); ret = pcdrv->probe(pcdev, id); + dev_pm_domain_put(dev->pm_domain); if (ret == 0) break;