Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp241009ybi; Tue, 16 Jul 2019 19:53:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBPb5vEcaD6pbksuiO7Jf2nJpWt8ZFjI+ZzRaDeus7jQlHKJgv4hoeHz8T1bCMhLAixNRx X-Received: by 2002:a17:902:8a94:: with SMTP id p20mr39658681plo.312.1563331980417; Tue, 16 Jul 2019 19:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563331980; cv=none; d=google.com; s=arc-20160816; b=XdwS3C8qnSUfJ4LVich1OHubTLc2vabG7EMA3VQqlu2M4siyD+r02kH92ZeQ01SP2W Efl17G2BsoxePOc09uxKlgNjcldNycDAjBgS6jkcEoT27L30rsrcfc0Wv7K1hg9VqKKu eOTDWELIaY7aQnPlTMgl27OLxe7soM2/JW+gtwmkdkQBjt9BgKRFZCiBE0Okzn0MD9Vo 0H5FOpBAUhULjx3g72JNsLo1jCSIap35jWwG8IbRENLlF8TlncOuXXKUu4xCDIHruyRS SP3xfHudy3GgDShGINLYTMDOdKwM+uL+ZcGCQyJ0F56VjrKx9tuimYwfFfzx7TdnmwhX x0oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wuLqDfULAB39YnZgj7k2QkDp3/RJGX96MN015DTBiZc=; b=ICyW8avbJO95qyeEqEPuMlFn4zLHJGOI3YV6Z5fnZ3S5wcgWw7rNHzioAlcLesbuZl V45Wyp3diZADFir+5xX7uGLNq9ILAS3pZszQEXJwyqEjR0MSlg376oumKG6sXPDcRU7a pYyYOZ3n421c9auiiyKZsPYPKwt/UWDG5p0DY4HNu0aaYEoXoQqmEqy9bS/FrpEfLs3B WBxGsdMX36ggaQB72IKORfS5yQve96E6zdn+NZgMjrIJfS9nY8kvXXYO8WzTaikZGcmu 7d9HorJJ9MZSqj3bhvTbJmP3JfYnTAODf0Zp5IZ/NaNWeopK2kyVm1l1V+au0xmMu828 Zc/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mbX7R/Y+"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u15si21238347pgn.178.2019.07.16.19.52.44; Tue, 16 Jul 2019 19:53:00 -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=@linaro.org header.s=google header.b="mbX7R/Y+"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728294AbfGQCwW (ORCPT + 99 others); Tue, 16 Jul 2019 22:52:22 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34476 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728047AbfGQCwV (ORCPT ); Tue, 16 Jul 2019 22:52:21 -0400 Received: by mail-pl1-f193.google.com with SMTP id i2so11154102plt.1 for ; Tue, 16 Jul 2019 19:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wuLqDfULAB39YnZgj7k2QkDp3/RJGX96MN015DTBiZc=; b=mbX7R/Y+HcSnVUJoumXkghmrx0t/XVHfKQJQxJC6eEUDONiWV6YG/TyT4FMw1JvsRo Xh7hVU/BQr52QZMk6EGRO6OLHW8/JNG9TXBBsJuXZvwk6DoXuU/+yKfVlGuKc8X8wHQu CdauH0erBit85KKhWgSkcXvRN3ATEwHK2pGQ6N9NMkl+HMmBzg16MXIjzYbg3io5YE7O JbuqhaXObx0BSp5zT4XGURP9BQdRO7NMg95Su55vtYHvhuzErBPeP6hwKaVk66onEBGS H/c2bL3X3NK8m3M8SPBIzUTKfk71dFzc9cbIK/iuk3fpeOforZs1Ln+sKntlwiGzbKow Ndjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wuLqDfULAB39YnZgj7k2QkDp3/RJGX96MN015DTBiZc=; b=kngaeM6uQebRgYGo5yg1w6Aqzd5koQ8z54eUgc2WZ8ofQoa6gQdo8Vct2CeWODJKj3 P0/6nZrusjgoiqZq4yHjeuihXUnSaBFcEA0no1FUoC9Hr/BNbItZgF18hqnUcpVYNW6L cgptWIQvsPCXofCPtdSkF9Ideod03NOkDIGKQOdY65IIVq9kG4mruLHBATjKQWuhwe94 VOZEcCLtrlkah9dLNw+nKCf9RIK3wwec+WYFX229xB5mnV50pZw1R0i049mhNF+Vak2B +/geXC03T/FU2JyT4+DuZy4DunjtMhToDeYyUHKyL4bl7Fh5lZsEBfqj6wQT/9tYb547 aZeg== X-Gm-Message-State: APjAAAVbXTBLYJjwBsHfjEbhAOUamNNVZc1YgTWyUQQBghiKldBZdTQv BhcGE5zNYc3ZiCRUuq8Sez45TA== X-Received: by 2002:a17:902:b48c:: with SMTP id y12mr5778512plr.202.1563331940824; Tue, 16 Jul 2019 19:52:20 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id b190sm8122147pga.37.2019.07.16.19.52.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 19:52:19 -0700 (PDT) Date: Wed, 17 Jul 2019 08:22:17 +0530 From: Viresh Kumar To: Niklas Cassel Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Vincent Guittot , Rajendra Nayak , linux-kernel@vger.kernel.org Subject: Re: [PATCH] opp: Return genpd virtual devices from dev_pm_opp_attach_genpd() Message-ID: <20190717025217.ne5tf2le2lj7oxbf@vireshk-i7> References: <027985ce35873cd218298302a1408da06d48458b.1562565567.git.viresh.kumar@linaro.org> <20190716104354.GA13780@centauri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190716104354.GA13780@centauri> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16-07-19, 12:43, Niklas Cassel wrote: > On Mon, Jul 08, 2019 at 11:30:11AM +0530, Viresh Kumar wrote: > > The cpufreq drivers don't need to do runtime PM operations on the > > virtual devices returned by dev_pm_domain_attach_by_name() and so the > > virtual devices weren't shared with the callers of > > dev_pm_opp_attach_genpd() earlier. > > > > But the IO device drivers would want to do that. This patch updates the > > prototype of dev_pm_opp_attach_genpd() to accept another argument to > > return the pointer to the array of genpd virtual devices. > > > > Reported-by: Rajendra Nayak > > Signed-off-by: Viresh Kumar > > --- > > @Rajendra: Can you please test this one ? I have only compile tested it. > > > > drivers/opp/core.c | 5 ++++- > > include/linux/pm_opp.h | 4 ++-- > > 2 files changed, 6 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/opp/core.c b/drivers/opp/core.c > > index 2958cc7bbb58..07b6f1187b3b 100644 > > --- a/drivers/opp/core.c > > +++ b/drivers/opp/core.c > > @@ -1775,6 +1775,7 @@ static void _opp_detach_genpd(struct opp_table *opp_table) > > * dev_pm_opp_attach_genpd - Attach genpd(s) for the device and save virtual device pointer > > * @dev: Consumer device for which the genpd is getting attached. > > * @names: Null terminated array of pointers containing names of genpd to attach. > > + * @virt_devs: Pointer to return the array of virtual devices. > > * > > * Multiple generic power domains for a device are supported with the help of > > * virtual genpd devices, which are created for each consumer device - genpd > > @@ -1789,7 +1790,8 @@ static void _opp_detach_genpd(struct opp_table *opp_table) > > * This helper needs to be called once with a list of all genpd to attach. > > * Otherwise the original device structure will be used instead by the OPP core. > > */ > > -struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names) > > +struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, > > + const char **names, struct device ***virt_devs) > > { > > struct opp_table *opp_table; > > struct device *virt_dev; > > @@ -1850,6 +1852,7 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names > > name++; > > } > > > > + *virt_devs = opp_table->genpd_virt_devs; > > Could we perhaps only do this if (virt_devs), that way callers can send in > NULL if they don't care about the genpd virtual devices. That was the idea and I failed to add it :( -- viresh