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: 5322421 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 057079F1E1 for ; Mon, 17 Nov 2014 15:19:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 318662012B for ; Mon, 17 Nov 2014 15:19:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 510192010F for ; Mon, 17 Nov 2014 15:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752419AbaKQPTY (ORCPT ); Mon, 17 Nov 2014 10:19:24 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:33524 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166AbaKQPTX (ORCPT ); Mon, 17 Nov 2014 10:19:23 -0500 Received: by mail-wg0-f49.google.com with SMTP id x13so24972329wgg.22 for ; Mon, 17 Nov 2014 07:19:22 -0800 (PST) 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; bh=GNDpDqgu84cuwsV0ct82Qe2Y4MJsM9FBWLXbRE5O1Bw=; b=EG2k9qCr/Y9nY5lcCZwEqkoeTUwJ5+SS112iS5k99rQ27KUHyDPOsjdFFlAFnMHarq Cc8hofod518tSDh+uiJA7vW0i70UPyUpKPoCKCJCf7doKA1jjSNRI6OlOGkY1QirmGxt mNrRacAUeIB99G9AKtVbD/9cyU1C70KOjnl4OWB8U1umBMVMYpXJu+gAOtJDuE+Pdl09 0/W0XAI2kZhr+z4kLhMdW3fkQ2i+Gr96LCpZL7L8E4xSuaejNUNnmlh7ZFv3PPBX2AgW 1K54o5Hz4YAfpeav8RRS1BlITB0ixeuTA7vci5w90M0OSroVXh+QIhxhhACpI/2orPnp U6wQ== X-Gm-Message-State: ALoCoQno+FcEUWodnLl3hhd0D0mw6u9hK1E5CJExnR2sR9hPoHQfb0FmirIDWaVCl6jKHyD7cUTK 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 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=ham 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 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; }