Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933591AbcK2Ldm (ORCPT ); Tue, 29 Nov 2016 06:33:42 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:16834 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933367AbcK2LdP (ORCPT ); Tue, 29 Nov 2016 06:33:15 -0500 X-AuditID: cbfec7f5-f79ce6d000004c54-05-583d677136a4 Subject: Re: [RFC PATCH 0/3] PM / Domains: Add support for devices that require multiple domains To: Stephen Boyd , Jon Hunter Cc: Kevin Hilman , "Rafael J. Wysocki" , Ulf Hansson , "Rafael J. Wysocki" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-tegra@vger.kernel.org" , Rajendra Nayak From: Marek Szyprowski Message-id: <52af1977-8ca3-40d1-43bb-920c5b933f94@samsung.com> Date: Tue, 29 Nov 2016 12:33:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-version: 1.0 In-reply-to: <20161124023014.GK6095@codeaurora.org> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFKsWRmVeSWpSXmKPExsWy7djPc7qF6bYRBofmcFu0zFrEYvGzfQuT xeVdc9gsPvceYbTo/DKLzWLul6nMFmdOX2K1WHZlM6vFjzPdLBbH14Y7cHm8v9HK7nG5r5fJ Y9OqTjaPO9f2sHn0Nr9j89hytZ3F4/MmuQD2KC6blNSczLLUIn27BK6MLc0/WQveK1W0PTrL 3MA4X6aLkZNDQsBE4syeU4wQtpjEhXvr2boYuTiEBJYySpx6eJARwvnMKPHt2wFmmI7Fe64z QSSWMUq8mPUaynnOKPG+5Qk7SJWwQJLEu11bWEBsEQEviSMH7rKAFDELtDBLvO5aygaSYBMw lOh62wVm8wrYSdx6sJEVxGYRUJWY/PYFWLOoQ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qPALCQts5CU zUJStoCReRWjSGppcW56brGhXnFibnFpXrpecn7uJkZgPG479nPzDsZLG4MPMQpwMCrx8ArY 2kQIsSaWFVfmHmKU4GBWEuEtSLGNEOJNSaysSi3Kjy8qzUktPsRoCvTERGYp0eR8YKrIK4k3 NDE0tzQ0MrawMDcyUhLnLflwJVxIID2xJDU7NbUgtQimj4mDU6qB0fRj8ueCL9PztqtaBE4y tzvFyr9X674cwy+uJV0Ky/4tq342by3z4roQrto5ynUnWB8n7nyyZ9s10yf74sPSWw+ek7SU /X/mA8s+8XPXCr58al6/96d8qvLyzMsOquejJi43702Zxt6l5vJ/j/e5p5PlXkcf15ij6MDJ fmZR9xK7ap2W6TPcU5RYijMSDbWYi4oTAQHifxDdAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161129113304eucas1p1cae35d631924fe4e02459dc2621610de X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161124023037epcas4p2891cf07f4bc49115f210c1298b0f9b82 X-RootMTR: 20161124023037epcas4p2891cf07f4bc49115f210c1298b0f9b82 References: <90faea7d-65b6-590a-83f1-24fcdffa0569@nvidia.com> <63670abf-1d58-a7e3-6927-0c815d44d8a1@nvidia.com> <20161124023014.GK6095@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4368 Lines: 93 Hi Stephen, Thanks for pointing to my patches, but I would like to clarify a few things. On 2016-11-24 03:30, Stephen Boyd wrote: > On 11/22, Jon Hunter wrote: >> On 22/11/16 18:26, Kevin Hilman wrote: >>> Jon Hunter writes: >>>> However, I would rather the client of >>>> the power-domains specify which power-domains they require and >>>> dynamically nested the power-domains at runtime. This is slightly >>>> different to what I proposed in this RFC, but it is not really beyond >>>> the bounds of what we support today IMO. What is missing is a means to >>>> do this dynamically and not statically. >>>> >>>> By the way, I am not sure if you are suggesting that for devices that >>>> may need multiple power-domains we should architect the driver >>>> differently and split it up in some way such that we have a power-domain >>>> per device. But for the case of the Tegra XHCI it is quite complex >>>> because the driver loads firmware which runs on a micro-controller and >>>> we need to manage the various power-domains that are used. >>> IMO, constructing a network of new struct devices just to workaround >>> limitations in the framework doesn't sound quite right either. >> I agree. >> > Marek is attempting to do this for the samsung clock > controller[1] (patch #5 is informative). You probably meant patch #3 / #4, which is a patch for Exynos 4412 ( https://marc.info/?l=linux-arm-kernel&m=147731142926053&w=2 ). Patch #5 is for Exynos 5433, which already has separate nodes for each clock sub-controller, so there is no problem to add generic power domains there (see multiple CMU nodes): https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/exynos/exynos5433.dtsi#n261 > From what I can tell > they have one DT node for their clock controller because it's one > register address space to control clocks. But, certain clocks > exposed by that driver only work when certain power domains are > enabled. For example, they have a clock controller that exposes > clock signals for multimedia hardware blocks like video > accelerators, gpus, and cameras. The clocks seem to have been > placed inside different power domains for the multimedia hardware > they're associated with, so there may be 10 or so power domains > that need to be enabled at different times for different clocks > to work. If the GPU power domain isn't enabled when the GPU > clocks are touched by the driver, things break, etc. > > In the proposed patchset, we have the top-level clock controller > node with subnodes for each power domain that needs to be > associated with clocks inside these different multimedia blocks. This is valid only for the Exynos4412 case (and not-yet-posted Exynos5422), which has a single clock controller node and patch #4 added a sub-node for ISP clocks part (the only one which in fact is in the other power domain). > So we end up with one parent device and attached driver for the > clock driver, and then that driver populates child nodes as > devices and matches up clocks with child nodes while registering > clks with clk_register(). Because we pass a dev pointer to > clk_register, we associate different devices with different > clocks all from the same top-level clock controller device > driver. Then clk framework calls runtime_pm APIs with devices > used during clk registration. Right, this is how I did it for Exynos4412 case. > Some of those devices don't have > any driver bound to them, which feels odd. Well, I don't get this. In the proposed patches each sub-node has a separate driver, none is left without a driver. > This seems like a case where we really want a better way to > explicitly control power domains without making up subnodes and > registering struct devices just to work around the one device to > one genpd construct we have today. Maybe power domains just don't > map to genpd though and that's the disconnect. Having an API for full control over multiple power domain assigned to a single device node might indeed solve somehow this problem, but as long as runtime pm is tied to struct device, this will again end in creating virtual sub-devices per each power domain to fit runtime pm principles. However we might be able to avoid creating sub-nodes in the device tree. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland