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: 5322441 Return-Path: X-Original-To: patchwork-linux-arm@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 8F9B89F1E1 for ; Mon, 17 Nov 2014 15:22:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EBFC20125 for ; Mon, 17 Nov 2014 15:22:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A493200FF for ; Mon, 17 Nov 2014 15:22:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqO5l-0002l6-6u; Mon, 17 Nov 2014 15:19:49 +0000 Received: from mail-wi0-f182.google.com ([209.85.212.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqO5i-00027S-9q for linux-arm-kernel@lists.infradead.org; Mon, 17 Nov 2014 15:19:46 +0000 Received: by mail-wi0-f182.google.com with SMTP id h11so9421501wiw.9 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=jtu2ZldKgVwN2PYV6OARStzTkw/ypKiZcCLPEbGIbkwhU3NR4X+I4x+QsQx7CUr/+C unZ2HnddkZJ9kXZKeBiAuTgKym5MlefSPUVUHylgmp+iywNtfTZ828q+MAVpBMWpuymL WukLX5zfvJM4pzzmqd6lTLZUMx38A/G8m1nndPp6ImrIcYl28T1T657qmnaFPRprHlI6 lsPOPu5N9ltEC13014L6Sh66S15ELjvczFq/q8r1qOUU41zSUcfXZdxBNHTZy20EfcAn v/sCMJeR5CyCCuBDCxY78NGUxqeuihVePQOdnWtJq0cv2qrb3hbnZBZGzFPhQt/RDxpc A+/w== X-Gm-Message-State: ALoCoQlzTRYBxoKXiIUsIU1sz8DN/aqezPC5BSGqe3X0BTZfmevbamSDh9ehXBSSLhAEaGyWUdlH 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141117_071946_495260_6FAA9954 X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -0.7 (/) Cc: Ulf Hansson , linux-samsung-soc@vger.kernel.org, Geert Uytterhoeven , Dmitry Torokhov , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 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; }