From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755990AbdGKSxO (ORCPT ); Tue, 11 Jul 2017 14:53:14 -0400 Received: from mail-pg0-f44.google.com ([74.125.83.44]:35323 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755766AbdGKSxM (ORCPT ); Tue, 11 Jul 2017 14:53:12 -0400 From: Kevin Hilman To: "Rafael J. Wysocki" Cc: Sudeep Holla , Ulf Hansson , Linux PM , Linux Kernel Mailing List , "Rafael J. Wysocki" Subject: Re: [PATCH] PM / Domains: defer dev_pm_domain_set() until genpd->attach_dev succeeds if present Organization: BayLibre References: <1498759251-11709-1-git-send-email-sudeep.holla@arm.com> Date: Tue, 11 Jul 2017 11:53:05 -0700 In-Reply-To: (Rafael J. Wysocki's message of "Tue, 4 Jul 2017 22:39:17 +0200") Message-ID: <7hk23evm9a.fsf@baylibre.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Rafael J. Wysocki" writes: > On Thu, Jun 29, 2017 at 8:00 PM, Sudeep Holla wrote: >> If the genpd->attach_dev or genpd->power_on fails, genpd_dev_pm_attach >> may return -EPROBE_DEFER initially. However genpd_alloc_dev_data sets >> the PM domain for the device unconditionally. >> >> When subsequent attempts are made to call genpd_dev_pm_attach, it may >> return -EEXISTS checking dev->pm_domain without re-attempting to call >> attach_dev or power_on. >> >> platform_drv_probe then attempts to call drv->probe as the return value >> -EEXIST != -EPROBE_DEFER, which may end up in a situation where the >> device is accessed without it's power domain switched on. >> >> Cc: "Rafael J. Wysocki" >> Cc: Kevin Hilman >> Cc: Ulf Hansson >> Signed-off-by: Sudeep Holla > > Ulf, this looks like a genuine fix to me, any comments? > This looks like the right fix to me. Acked-by: Kevin Hilman