From patchwork Mon Oct 13 14:02: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: 5076681 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CBA5FC11AC for ; Mon, 13 Oct 2014 14:03:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0726A201C7 for ; Mon, 13 Oct 2014 14:03:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5939E201F5 for ; Mon, 13 Oct 2014 14:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754056AbaJMOCh (ORCPT ); Mon, 13 Oct 2014 10:02:37 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:38005 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754017AbaJMOCg (ORCPT ); Mon, 13 Oct 2014 10:02:36 -0400 Received: by mail-wg0-f45.google.com with SMTP id m15so8854292wgh.16 for ; Mon, 13 Oct 2014 07:02:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o3j24SLU6UiBqvzb/byVRSBygeTuzk9IL6WP/7Kn414=; b=OBLGx1xgp6tDWCBpWOlOEaA8VxUwF8PYd9R7dCjcmdyRAveUGqkRIe84cqsnJMCoye 4DVBHdfujrSsnTKPBDenIQjqiIuVZap/Svz20opbI7A0f9czCFN4Lj9MPZDr9igeOrbW MUahHOJibTJza6PwQz1q29NFHBEwRcTPTPkWXfM74kFC/4GhH4ASbx9oGm3+/X6b6+rm WWsXWI66xKCBFiA+6hyj07SURacL+5bffLKFqtBIn8QgbG9utevkzWDka/FHC9yuS4lc d6lrvA7xUTgB83AVeJ8SVLUsITc+CZqEMM7Y+hHAXPr9MZ/i2Fn4+rC9fEmv3A+IEalc U2Tg== X-Gm-Message-State: ALoCoQnxb2PpAEXNLeVMAiG3oSCvBGSHRfkna9qSiv0Z1rrQjqGcpv9CP6sNzmkPXYmkl3lutiO/ X-Received: by 10.180.188.102 with SMTP id fz6mr870332wic.61.1413208955420; Mon, 13 Oct 2014 07:02:35 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id fq1sm1533474wib.12.2014.10.13.07.02.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 07:02:34 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Geert Uytterhoeven , Kevin Hilman , Alan Stern , Greg Kroah-Hartman , Tomasz Figa , Simon Horman , Magnus Damm , Ben Dooks , Kukjin Kim , Philipp Zabel , Mark Brown , Wolfram Sang , Russell King , Dmitry Torokhov , Jack Dai , Jinkun Hong , Aaron Lu , Sylwester Nawrocki , Ulf Hansson Subject: [PATCH v3 3/9] amba: Keep PM domain powered during ->probe() Date: Mon, 13 Oct 2014 16:02:04 +0200 Message-Id: <1413208930-26019-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413208930-26019-1-git-send-email-ulf.hansson@linaro.org> References: <1413208930-26019-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 47bbdc1..a8a8e13 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -187,8 +187,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; } @@ -198,6 +205,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;