Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754287AbbDTHLP (ORCPT ); Mon, 20 Apr 2015 03:11:15 -0400 Received: from mail-qc0-f180.google.com ([209.85.216.180]:33720 "EHLO mail-qc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751520AbbDTHLM (ORCPT ); Mon, 20 Apr 2015 03:11:12 -0400 MIME-Version: 1.0 In-Reply-To: References: <1471135.f2mh84nZFq@avalon> From: Tomeu Vizoso Date: Mon, 20 Apr 2015 09:10:50 +0200 X-Google-Sender-Auth: qZ0oLtxTaqcqTBBMn3Q1MGWtdVk Message-ID: Subject: Re: [PATCH v3 1/2] PM / sleep: Let devices force direct_complete To: Alan Stern Cc: Laurent Pinchart , "linux-pm@vger.kernel.org" , Dmitry Torokhov , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" 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: 2611 Lines: 61 On 17 April 2015 at 19:30, Alan Stern wrote: > On Fri, 17 Apr 2015, Laurent Pinchart wrote: > >> Hi Tomeu, >> >> Thank you for the patch. >> >> On Friday 17 April 2015 17:24:49 Tomeu Vizoso wrote: >> > Introduce a new per-device flag power.force_direct_complete that will >> > instruct the PM core to ignore the runtime PM status of its descendants >> > when deciding whether to let this device remain in runtime suspend when >> > the system goes into a sleep power state. >> > >> > This is needed because otherwise it would be needed to get dozens of >> > drivers to implement the prepare() callback and be runtime PM active >> > even if they don't have a 1-to-1 relationship with a piece of HW. >> >> I'll let PM experts comment on the approach, but I believe the new flag would >> benefit from being documented (likely in Documentation/power/devices.txt) :-) > > Documentation/power/runtime_pm.txt is the right place. > > However, I'm not sure that this is the sort of thing Rafael meant when > he suggested adding a new flag. I thought he meant the PM core would > look at the new flag only if there was no ->prepare method at all. > Then if the new flag was set, the PM core would act as though ->prepare > had returned 1. That way there would be no need to add silly little > one-line *_prepare() routines all over the place. > > Maybe he had something else in mind, though... Yeah, I also interpreted it like that, but when I started looking at how it would work, I found that it would be awkward if the uvcvideo driver had to track all the devices that get attached below its devices in order to set that flag to them. When thinking about it, it occurred to me that it may make more sense if we model this as a property of the device bound to the uvcvideo driver, as what's happening here is that the uvcvideo driver knows that it's safe to remain in runtime suspend when the system goes to sleep, and that all its descendant devices can be ignored in that regard. Was meaning to explain this in the cover letter, but I forgot to, sorry. Thanks, Tomeu > Alan Stern > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/