From patchwork Mon Nov 17 15:19:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 40928 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5BF8F21F5F for ; Mon, 17 Nov 2014 15:19:26 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gq15sf939537lab.8 for ; Mon, 17 Nov 2014 07:19:25 -0800 (PST) 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=GNDpDqgu84cuwsV0ct82Qe2Y4MJsM9FBWLXbRE5O1Bw=; b=Pfg4F6dY2KN44rF1QFIOFBM2LXmoNSxru0nt4yOHWjJdNC3L8iP7Exu+p04CxjPO0Q U8QYq9+lpnnZ0hyM0L5iR4LaTa3+fu5bEjnZRkxWr9IqoNf+E14YpWimPF9j247pQ8YZ DuwBDWpkJo0/XFpQTkrNmbQ3Zp0znuodTQJrP/kfBAFY1aNn8GXr5Tyyoo+QPyW8Ye7F HviKa9SX3k6+D/yJnGB1bYkLM4CaKXI8O3LGgxouMph+c1R7CFOUVx3fmWu1RM5b4G5s TuvLpaUQiDemVoiEh8M7qEOEmcmX2I9B77Jyrb0KviMnXo9xQKB1LYJkwy1SksKwFvb6 7gQw== X-Gm-Message-State: ALoCoQlDs3cwn4JllXqkeM5dmIlB+/TYzQidOLBmeCp1elN8fhGZ0B62PD7oZgrB1mH8tDQw9cbB X-Received: by 10.194.109.131 with SMTP id hs3mr1989556wjb.0.1416237564707; Mon, 17 Nov 2014 07:19:24 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.138 with SMTP id q10ls1216501laj.83.gmail; Mon, 17 Nov 2014 07:19:24 -0800 (PST) X-Received: by 10.152.27.2 with SMTP id p2mr28209263lag.19.1416237563856; Mon, 17 Nov 2014 07:19:23 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id z3si52360418lad.17.2014.11.17.07.19.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 07:19:23 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id gf13so6595180lab.0 for ; Mon, 17 Nov 2014 07:19:23 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr27889492laz.27.1416237563515; Mon, 17 Nov 2014 07:19:23 -0800 (PST) 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.184.201 with SMTP id ew9csp1170467lbc; Mon, 17 Nov 2014 07:19:23 -0800 (PST) X-Received: by 10.194.79.199 with SMTP id l7mr4171179wjx.136.1416237562811; Mon, 17 Nov 2014 07:19:22 -0800 (PST) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com. [74.125.82.45]) by mx.google.com with ESMTPS id wl6si62068115wjc.119.2014.11.17.07.19.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 07:19:22 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 74.125.82.45 as permitted sender) client-ip=74.125.82.45; Received: by mail-wg0-f45.google.com with SMTP id x12so25148025wgg.32 for ; Mon, 17 Nov 2014 07:19:22 -0800 (PST) X-Received: by 10.180.20.201 with SMTP id p9mr32146763wie.67.1416237562445; Mon, 17 Nov 2014 07:19:22 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id td9sm15646397wic.15.2014.11.17.07.19.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Nov 2014 07:19:21 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Kevin Hilman , linux-pm@vger.kernel.org Cc: Geert Uytterhoeven , Dmitry Torokhov , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Ulf Hansson Subject: [PATCH] PM / Domains: Power on the PM domain right after attach completes Date: Mon, 17 Nov 2014 16:19:10 +0100 Message-Id: <1416237550-31092-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 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.215.41 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: , The amba bus, amba drivers and a vast amount of platform drivers which enables runtime PM, don't invoke a pm_runtime_get_sync() while probing their devices. Instead, once they have turned on their PM resourses during ->probe() and are ready to handle I/O, these invokes pm_runtime_set_active() to synchronize its state towards the runtime PM core. >From a runtime PM point of view this behavior is perfectly acceptable, but we encounter probe failures if their corresponding devices resides in the generic PM domain. The issues are observed for those devices, which requires its PM domain to stay powered during ->probe() since that's not being controlled. While using the generic OF-based PM domain look-up, a device's PM domain will be attached during the probe sequence. For this path, let's fix the probe failures, by simply power on the PM domain right after when it's been attached to the device. The generic PM domain stays powered until all of its devices becomes runtime PM enabled and runtime PM suspended. The old SOCs which makes use of the generic PM domain but don't use the generic OF-based PM domain look-up, will not be affected from this change. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 3989eb6..1bfb54c 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2235,6 +2235,7 @@ int genpd_dev_pm_attach(struct device *dev) } dev->pm_domain->detach = genpd_dev_pm_detach; + pm_genpd_poweron(pd); return 0; }