Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbcJJLY2 (ORCPT ); Mon, 10 Oct 2016 07:24:28 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:7416 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110AbcJJLY0 (ORCPT ); Mon, 10 Oct 2016 07:24:26 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Mon, 10 Oct 2016 04:17:47 -0700 Subject: Re: [RFC PATCH 2/3] PM / Domains: Add support for devices with multiple domains To: Kevin Hilman References: <1474367287-10402-1-git-send-email-jonathanh@nvidia.com> <1474367287-10402-3-git-send-email-jonathanh@nvidia.com> <7hlgy0frlb.fsf@baylibre.com> CC: "Rafael J. Wysocki" , Ulf Hansson , , , From: Jon Hunter Message-ID: <6fce02ca-281a-08bd-304a-77829d35c7e1@nvidia.com> Date: Mon, 10 Oct 2016 12:24:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <7hlgy0frlb.fsf@baylibre.com> X-Originating-IP: [10.21.132.110] X-ClientProxiedBy: DRUKMAIL101.nvidia.com (10.25.59.19) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2249 Lines: 54 On 07/10/16 10:14, Kevin Hilman wrote: > Jon Hunter writes: > >> Some devices may require more than one PM domain to operate and this is >> not currently by the PM domain framework. Furthermore, the current Linux >> 'device' structure only allows devices to be associated with a single PM >> domain and so cannot easily be associated with more than one. To allow >> devices to be associated with more than one PM domain, if multiple >> domains are defined for a given device (eg. via device-tree), then: >> 1. Create a new PM domain for this device. The name of the new PM domain >> created matches the device name for which it was created for. >> 2. Register the new PM domain as a sub-domain for all PM domains >> required by the device. >> 3. Attach the device to the new PM domain. > > Did you look at what might be involved to extend struct device to hace a > list of pm_domains? Like Ulf, I'm a bit unsettled by this > implementation that has to work around the basic limitation in the > driver model. I had but it was going to be a much bigger and intrusive change. So I went with this as a initial idea to see if others also had a need for it. I am happy to start looking at extended the device struct if this is the preferred path and I would agree that would make most sense. > Having devices in multitple domains is needed for SoCs I'm familiar with > also, so is a needed feature. Ok great. > I think removing the struct device limitation and corresponding > assumptions in the driver and PM core is a prerequisite for this > feature. > > Doing that will lead to several questions about how to handle runtime PM > operations (e.g. which of the multiple PM domains should the one to call > the drivers runtime PM hooks when a device changes runtime PM state?) Right. My initial thought would be that at least for device-tree based configuration, that the order in which the pm-domains are defined in DT would determine the order in which the pm-domains are power-on/off. > Anyways, even with the potential complexities, I think attempting this > is the right way forward. Ok. I will start having a think about this but will probably not get back to this for a few weeks. Cheers Jon -- nvpublic