lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <CAPDyKFpbA-fopq11Lc0j9hgM86DjveNh+Q=w=nEn2fvcFyp93w@mail.gmail.com> Date: Fri, 6 Sep 2024 10:49:17 +0200 From: Ulf Hansson <ulf.hansson@...aro.org> To: Viresh Kumar <viresh.kumar@...aro.org> Cc: Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>, Stephen Boyd <sboyd@...nel.org>, Dikshita Agarwal <quic_dikshita@...cinc.com>, Bjorn Andersson <andersson@...nel.org>, Konrad Dybcio <quic_kdybcio@...cinc.com>, Nikunj Kela <nkela@...cinc.com>, "Bryan O'Donoghue" <bryan.odonoghue@...aro.org>, Thierry Reding <thierry.reding@...il.com>, Mikko Perttunen <mperttunen@...dia.com>, Jonathan Hunter <jonathanh@...dia.com>, Stephan Gerhold <stephan@...hold.net>, Ilia Lin <ilia.lin@...nel.org>, Stanimir Varbanov <stanimir.k.varbanov@...il.com>, Vikash Garodia <quic_vgarodia@...cinc.com>, linux-pm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH 2/2] OPP/pmdomain: Fix the assignment of the required-devs On Fri, 6 Sept 2024 at 08:14, Viresh Kumar <viresh.kumar@...aro.org> wrote: > > On 04-09-24, 14:57, Ulf Hansson wrote: > > > Yeah, I missed that, it doesn't happen via DT but by platform code. I > > > do see problems where situation would be a bit ambiguous. Your example > > > with a minor change to your code: > > > > > > opp_table_devA: opp-table-devA { > > > compatible = "operating-points-v2"; > > > > > > opp-devA-50 { > > > opp-hz = /bits/ 64 <2500>; > > > required-opps = <&opp_pd_50, &opp_pd_51>; //corresponds to pd_perf1 and pd_perf0 (in reverse order) > > > }; > > > .... > > > > > > devA { > > > compatible = "foo,bar"; > > > power-domains = <&pd_perf0>, <&pd_perf1>; //both > > > pd_perf0 and pd_perf1 has OPP tables. > > > power-domain-names = "perf0", "perf1"; > > > operating-points-v2 = <&opp_table_devA>; > > > }; > > > > > > Here, I don't think there is a way for us to know which genpd does > > > opp_pd_50 belongs to and to which one opp_pd_51 does. > > > > > > We solve this by sending clock_names and regulator_names in OPP > > > config structure. That gives the ordering in which required_opps are > > > present. The same needs to be done for genpd, and then genpd core > > > would be able to attach the right genpd with right required opp. > > > > No, we don't need this for gend as $subject patch is addressing this > > problem too. Let me elaborate. > > > > The OPP core holds the information about the devA's required-opps and > > to what OPP table each required-opps belongs to > > (opp_table->required_opp_tables[n]). > > > > The genpd core holds the information about the allocated virtual > > devices that it creates when it attached devA to its power-domains. > > The virtual device(s) gets a genpd attached to it and that genpd also > > has an OPP table associated with it (genpd->opp_table). > > > > By asking the OPP core to walk through the array of allocated > > required-opps for devA and to match it against a *one* of the virtual > > devices' genpd->opp_table, we can figure out at what index we should > > assign the virtual device to in the opp_table->required_devs[index]. > > How do we differentiate between two cases where the required-opps can > be defined as either of these: > > required-opps = <&opp_pd_50, &opp_pd_51>; //corresponds to pd_perf1 and pd_perf0 (in reverse order) > > OR > > required-opps = <&opp_pd_51, &opp_pd_50>; //corresponds to pd_perf0 and pd_perf1 > > I thought this can't be fixed without some platform code telling how > the DT is really configured, i.e. order of the power domains in the > required-opps. I don't think we need platform code for this. When registering a genpd provider, an OPP table gets assigned to it. When hooking up a device to one of its genpd providers, that virtual device then also gets a handle to its genpd's OPP table. Each of the phandles in the required-opps points to another OPP table, which OPP table should be associated with a specific genpd. In other words, the information is there, we should not need anything additional in DT. Kind regards Uffe
Powered by blists - more mailing lists