From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753876AbcAGXt0 (ORCPT ); Thu, 7 Jan 2016 18:49:26 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:46343 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753291AbcAGXtY (ORCPT ); Thu, 7 Jan 2016 18:49:24 -0500 From: "Rafael J. Wysocki" To: Tomeu Vizoso Cc: Daniel Kurtz , Ulf Hansson , Russell King , "linux-pm@vger.kernel.org" , Tony Lindgren , Greg Kroah-Hartman , Kevin Hilman , "linux-kernel@vger.kernel.org" , dri-devel , ACPI Devel Maling List , Alan Stern , Pavel Machek , Tomas Winkler , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Len Brown Subject: Re: [PATCH v11 2/4] PM / Domains: add setter for dev.pm_domain Date: Fri, 08 Jan 2016 01:20:08 +0100 Message-ID: <1638223.v1Ed2MLOOC@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1445956731-6304-1-git-send-email-tomeu.vizoso@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, January 07, 2016 03:47:01 PM Tomeu Vizoso wrote: > On 10 November 2015 at 10:33, Daniel Kurtz wrote: > [snip] > > > > The problem appears to be that: > > * On boot, platform_drv_probe() calls dev_pm_domain_attach() before > > drv->probe(); thus, it calls dev_pm_domain_attach() while the device > > is unbound. > > > > * However, for a platform_device, the reboot path calls > > device_shutdown(), but not __device_release_driver(): > > device_shutdown() > > dev->driver->shutdown => platform_drv_shutdown() > > dev_pm_domain_detach() > > dev->pm_domain->detach() => genpd_dev_pm_detach() > > pm_genpd_remove_device() > > dev_pm_domain_set(dev, NULL); > > > > So, for a platform_device in a genpd power domain with .shutdown > > installed, platform_drv_shutdown() calls dev_pm_domain_detach() while > > the device is still bound, which triggers the WARN(). > > Hi Rafael, Alan and Ulf, > > do you have any suggestion about this? I don't really understand why > the device is detached from the domain on shutdown. Well, this looks like a bug to me. Thanks, Rafael