[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200120152804.GB164543@google.com>
Date: Mon, 20 Jan 2020 15:28:04 +0000
From: Quentin Perret <qperret@...gle.com>
To: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: lukasz.luba@....com, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
dri-devel@...ts.freedesktop.org, linux-omap@...r.kernel.org,
linux-mediatek@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
linux-imx@....com, Morten.Rasmussen@....com, Chris.Redpath@....com,
ionela.voinescu@....com, javi.merino@....com,
cw00.choi@...sung.com, b.zolnierkie@...sung.com, rjw@...ysocki.net,
sudeep.holla@....com, viresh.kumar@...aro.org, nm@...com,
sboyd@...nel.org, rui.zhang@...el.com, amit.kucheria@...durent.com,
daniel.lezcano@...aro.org, mingo@...hat.com, peterz@...radead.org,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
shawnguo@...nel.org, s.hauer@...gutronix.de, festevam@...il.com,
kernel@...gutronix.de, khilman@...nel.org, agross@...nel.org,
bjorn.andersson@...aro.org, robh@...nel.org,
matthias.bgg@...il.com, steven.price@....com,
tomeu.vizoso@...labora.com, alyssa.rosenzweig@...labora.com,
airlied@...ux.ie, daniel@...ll.ch, patrick.bellasi@...bug.net
Subject: Re: [PATCH 1/4] PM / EM: and devices to Energy Model
On Monday 20 Jan 2020 at 15:53:35 (+0100), Dietmar Eggemann wrote:
> Would be really nice if this wouldn't be required. We should really aim
> for 1 framework == 1 set of interfaces.
>
> What happens if someone calls em_get_pd() on a CPU EM?
>
> E.g:
>
> static struct perf_domain *pd_init(int cpu)
> {
> - struct em_perf_domain *obj = em_cpu_get(cpu);
> + struct device *dev = get_cpu_device(cpu);
> + struct em_perf_domain *obj = em_pd_get(dev);
> struct perf_domain *pd;
>
> Two versions of one functionality will confuse API user from the
> beginning ...
Agreed, this looks a bit confusing. It should be trivial to make
em_dev_get() (or whatever we end up calling it) work for CPUs too,
though. And we could always have a em_cpu_get(int cpu) API that is a
basically a wrapper around em_dev_get() for convenience.
Thanks,
Quentin
Powered by blists - more mailing lists