Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752732AbdLEPXk (ORCPT ); Tue, 5 Dec 2017 10:23:40 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:38250 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752373AbdLEPXh (ORCPT ); Tue, 5 Dec 2017 10:23:37 -0500 X-Google-Smtp-Source: AGs4zMbSRNMg7fiGP8fTmKlmibmYGVouosH+gOyKMBAuG1y3JiqcqPCpSEtFw/h7YVdqmiHGkuZ7SMujkBSSjOKBUgQ= MIME-Version: 1.0 In-Reply-To: References: From: "Rafael J. Wysocki" Date: Tue, 5 Dec 2017 16:23:35 +0100 X-Google-Sender-Auth: qwOR1wXJEeQZqHrz8D-xdMb3NYM Message-ID: Subject: Re: [PATCH] PM / runtime: Drop children check from __pm_runtime_set_status() To: Alan Stern Cc: Yoshihiro Shimoda , Ulf Hansson , Geert Uytterhoeven , "Rafael J. Wysocki" , Linux PM , LKML , Greg Kroah-Hartman , USB list , Linux-Renesas , Kishon Vijay Abraham I Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2066 Lines: 63 On Tue, Dec 5, 2017 at 4:03 PM, Alan Stern wrote: > On Tue, 5 Dec 2017, Yoshihiro Shimoda wrote: > >> Hi, >> >> > From: Ulf Hansson, Sent: Monday, December 4, 2017 7:41 PM >> > >> > On 1 December 2017 at 12:03, Yoshihiro Shimoda >> > wrote: >> >> > > Sure! I tested your patch, and then the following message disappeared! >> > > >> > > Enabling runtime PM for inactive device (ee080200.usb-phy) with active children >> > >> > Great, that confirms my theory. >> > >> > I will re-work the patch and re-post it to see what people thinks about it. >> >> Thank you! >> >> > > >> > > However, the following message still exists. >> > > >> > > Enabling runtime PM for inactive device (ee080000.usb) with active children >> > > >> > > So, I guess ohci-platform.c also has similar issue. >> > >> > Yes, very likely! >> > >> > However, I need some more time to look into this to be able to suggest >> > a solution. >> >> I found a solution and sent a report as below: >> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1551146.html >> >> What do you think about using pm_runtime_forbid()? > > In general, drivers should not use pm_runtime_forbid(). I'd rather say that it's not very useful to them. :-) > It is meant for use by userspace, through the /sys/.../power/control file. Or when the driver wants to change the default setting. > Drivers cannot rely on the result of calling pm_runtime_forbid() > or pm_runtime_allow(), because the user can change it at any time. Right. > If you really want to prevent the OHCI controller from going into > runtime suspend, the proper approach is to call pm_runtime_get() in the > probe routine and pm_runtime_put() in the release routine. However, > this will waste energy because it will force the controller to remain > at full power even when no active devices are attached. > > In this case, there probably is a better to solution to your problem > (such as fixing the runtime PM support in the phy driver). Agreed. Thanks, Rafael