Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp607006imm; Wed, 23 May 2018 02:30:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrEJLL96k3JXZn53QPj+Z2J02iqlRnTFK/cPRoZ7s7AJ36PLabA426fdKvvqez18/ncvrKR X-Received: by 2002:a62:a044:: with SMTP id r65-v6mr2060324pfe.235.1527067818931; Wed, 23 May 2018 02:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527067818; cv=none; d=google.com; s=arc-20160816; b=MiBs6D5PLUJMBHvhUWz9aF/mp3naGUnF69KdA6Ba7KiQ81xCaAKBWBsRnpdrOUZmtF jcreDfa/QhvXw4E1Hac+1MObSjB4d0yeYt4Eo7c0mSf4Yd5/bh8wMTScc+MwY/KIpgZE vbP3qsQS20s91caCTE+lARlif22C58ApJnyxGf69vB268FYWVhya9Px+ZHV3XCP76fPu dopA2q1DaO6hLMAapzJ+x+5ohGVeUhW+vwJIWwCI/Z8JWX+Ptumv/TzIQYnTQfP7D98J nD3G8aNyn9WPNCpRI+LWzsdvEyWLbjrLzWQmeEOMuf4ajPYuY45jKB8ci3aIgolcH+vk DxLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=NWKhnyZNyMfcrpBg8kxT2RbH66XI63xLS9eHmzb0x90=; b=NZWFScwSt+hgIXOuunyJ/DnVBI+z4K24KAaJdQg0OqnIPa7l+kb9bElpF6QvBA+93+ DgdKpeShEl+KUHtYiaZVVRfMAkqRkhlU6jG0VJpMIeMGLjXUnz7ZPMxo7QOftsR+I/DT kRCn8epPmhEnCQuAj6hLFotmcptcsOVuUA2dexR43mhiXhL9mdmuaDv04oVHbJnPZQTd vlkzBwsU0/5KK+As99krz9Ui5MudWrIiLS2gFMzE/yysMsQ/qJsUHFs1jvU4DrJu1DgQ u6H9GIiDFxSRa9FsO+7M4wMl8CUBnUzHbTbVhjVCENJo7EtzCfXxodOB6cMpT6K1NBmO KDvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=TlInGt1a; dkim=pass header.i=@codeaurora.org header.s=default header.b=FOhX/w5j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 132-v6si14831012pgb.674.2018.05.23.02.30.03; Wed, 23 May 2018 02:30:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=TlInGt1a; dkim=pass header.i=@codeaurora.org header.s=default header.b=FOhX/w5j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932197AbeEWJ1s (ORCPT + 99 others); Wed, 23 May 2018 05:27:48 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39856 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932180AbeEWJ1n (ORCPT ); Wed, 23 May 2018 05:27:43 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C9FC560213; Wed, 23 May 2018 09:27:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527067662; bh=ufy+J16PpUs405ys9WHyhbxic7znjbNHr0HlsORR050=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=TlInGt1aufPXGVgzr+mxarGU/bsUwszG9jJH/APQA1OtIKe/HwAyMLGt2X2KyjbN2 1+3erElPwDZVZysrylZ97OGz4gX+4kHn3bhQHXsoToDpoxT1FO65M3yHZlf6CmPyaS N9nKOAJGXGodiuWzsEBju57e/HPRybNuwRZyhoiE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.79.40.88] (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9A1F260213; Wed, 23 May 2018 09:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527067661; bh=ufy+J16PpUs405ys9WHyhbxic7znjbNHr0HlsORR050=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=FOhX/w5jfQX3ZzdDkbgIUQJdy0VKIjbNdl/g1fJ9GyIyJaj/4e19YuOr+LRVYL6wa n6hxdASpPWHELMQSh6eauvzXnLjBBcYximnJgs/Z8NbR7go6YvZ7JtUXDSTHUEhgiW K5+Xqi61Bah/JCXJY/dZAIMYX06ZRtfhaUkCpjhY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9A1F260213 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rnayak@codeaurora.org Subject: Re: [PATCH 8/9] PM / Domains: Add support for multi PM domains per device to genpd To: Jon Hunter , Ulf Hansson Cc: Geert Uytterhoeven , Linux PM , Greg Kroah-Hartman , Kevin Hilman , "Rafael J . Wysocki" , Linux Kernel Mailing List , Todor Tomov , Viresh Kumar , linux-tegra@vger.kernel.org, Vincent Guittot , Linux ARM References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> <1526639490-12167-9-git-send-email-ulf.hansson@linaro.org> <5a79d3a2-d090-645b-da69-524b7e7a4d90@nvidia.com> <51f7de26-579a-8b9e-4e79-f4eee923ab38@codeaurora.org> <3838f17a-2ac8-bf3f-f0b1-f69bbe17629c@nvidia.com> From: Rajendra Nayak Message-ID: <00ba829d-faf4-168c-db00-531621b9280f@codeaurora.org> Date: Wed, 23 May 2018 14:57:33 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <3838f17a-2ac8-bf3f-f0b1-f69bbe17629c@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/23/2018 02:37 PM, Jon Hunter wrote: > > On 23/05/18 07:12, Ulf Hansson wrote: > > ... > >>>>>> Thanks for sending this. Believe it or not this has still been on my to-do list >>>>>> and so we definitely need a solution for Tegra. >>>>>> >>>>>> Looking at the above it appears that additional power-domains exposed as devices >>>>>> to the client device. So I assume that this means that the drivers for devices >>>>>> with multiple power-domains will need to call RPM APIs for each of these >>>>>> additional power-domains. Is that correct? >>>>> >>>>> They can, but should not! >>>>> >>>>> Instead, the driver shall use device_link_add() and device_link_del(), >>>>> dynamically, depending on what PM domain that their original device >>>>> needs for the current running use case. >>>>> >>>>> In that way, they keep existing runtime PM deployment, operating on >>>>> its original device. >>>> >>>> OK, sounds good. Any reason why the linking cannot be handled by the above API? Is there a use-case where you would not want it linked? >>> >>> I am guessing the linking is what would give the driver the ability to decide which subset of powerdomains it actually wants to control >>> at any point using runtime PM. If we have cases wherein the driver would want to turn on/off _all_ its associated powerdomains _always_ >>> then a default linking of all would help. >> >> First, I think we need to decide on *where* the linking should be >> done, not at both places, as that would just mess up synchronization >> of who is responsible for calling the device_link_del() at detach. >> >> Second, It would in principle be fine to call device_link_add() and >> device_link_del() as a part of the attach/detach APIs. However, there >> is a downside to such solution, which would be that the driver then >> needs call the detach API, just to do device_link_del(). Of course >> then it would also needs to call the attach API later if/when needed. >> Doing this adds unnecessary overhead - comparing to just let the >> driver call device_link_add|del() when needed. On the upside, yes, it >> would put less burden on the drivers as it then only needs to care >> about using one set of functions. >> >> Which solution do you prefer? > > Any reason why we could not add a 'boolean' argument to the API to indicate whether the new device should be linked? I think that I prefer the API handles it, but I can see there could be instances where drivers may wish to handle it themselves. > > Rajendra, do you have a use-case right now where the driver would want to handle the linking? So if I understand this right, any driver which does want to control individual powerdomain state would need to do the linking itself right? What I am saying is, if I have device A, with powerdomains X and Y, and if I want to turn on only X, then I would want only X to be linked with A, and at a later point if I want both X and Y to be turned on, I would then go ahead and link both X and Y to A? Is that correct or did I get it all wrong? I know atleast Camera on msm8996 would need to do this since it has 2 vfe powerdoamins, which can be turned on one at a time (depending on what resolution needs to be supported) or both together if we really need very high resolution using both vfe modules. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation