- 29 5月, 2020 4 次提交
-
-
由 Kamil Konieczny 提交于
Add enable regulators to dev_pm_opp_set_regulators() and disable regulators to dev_pm_opp_put_regulators(). Even if bootloader leaves regulators enabled, they should be enabled in kernel in order to increase the reference count. Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com> Acked-by: NClément Péron <peron.clem@gmail.com> Tested-by: NClément Péron <peron.clem@gmail.com> Signed-off-by: NKamil Konieczny <k.konieczny@samsung.com> [ Viresh: Enable the regulator only after it is programmed and add a flag to track its status. ] Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
Reorder the code a bit to make it more readable. Add additional comment as well. Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com> Acked-by: NClément Péron <peron.clem@gmail.com> Tested-by: NClément Péron <peron.clem@gmail.com> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Georgi Djakov 提交于
If the OPP bandwidth values are populated, we want to switch also the interconnect bandwidth in addition to frequency and voltage. Signed-off-by: NGeorgi Djakov <georgi.djakov@linaro.org> Reviewed-by: NMatthias Kaehlcke <mka@chromium.org> Reviewed-by: NSibi Sankar <sibis@codeaurora.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Georgi Djakov 提交于
The OPP bindings now support bandwidth values, so add support to parse it from device tree and store it into the new dev_pm_opp_icc_bw struct, which is part of the dev_pm_opp. Signed-off-by: NGeorgi Djakov <georgi.djakov@linaro.org> Reviewed-by: NMatthias Kaehlcke <mka@chromium.org> [ Viresh: Create _read_bw() and use it, renamed _of_find_icc_paths() to dev_pm_opp_of_find_icc_paths(), exported it and made opp_table argument optional. Also drop the depends on from Kconfig. ] Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 13 5月, 2020 1 次提交
-
-
由 Saravana Kannan 提交于
The opp-hz DT property is not mandatory and we may use another property as a key in the OPP table. Add helper functions to simplify the reading and comparing the keys. Signed-off-by: NSaravana Kannan <saravanak@google.com> Signed-off-by: NGeorgi Djakov <georgi.djakov@linaro.org> Reviewed-by: NMatthias Kaehlcke <mka@chromium.org> Reviewed-by: NSibi Sankar <sibis@codeaurora.org> [ Viresh: Removed an unnecessary comment ] Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 13 4月, 2020 1 次提交
-
-
由 Rajendra Nayak 提交于
With OPP core now supporting DVFS for IO devices, we have instances of IO devices (same IP block) which require an OPP on some platforms/SoCs while just needing to scale the clock on some others. In order to avoid conditional code in every driver which supports such devices (to check for availability of OPPs and then deciding to do either dev_pm_opp_set_rate() or clk_set_rate()) add support to manage empty OPP tables with a clk handle. This makes dev_pm_opp_set_rate() equivalent of a clk_set_rate() for devices with just a clk and no OPPs specified, and makes dev_pm_opp_set_rate(0) bail out without throwing an error. Signed-off-by: NRajendra Nayak <rnayak@codeaurora.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 10 12月, 2019 1 次提交
-
-
由 Viresh Kumar 提交于
A kref or refcount isn't the right tool to be used here for counting number of devices that are sharing the static OPPs created for the OPP table. For example, we are reinitializing the kref again, after it reaches a value of 0 and frees the resources, if the static OPPs get added for the same OPP table structure (as the OPP table structure was never freed). That is messy and very unclear. This patch makes parsed_static_opps an unsigned integer and uses it to count the number of users of the static OPPs. The increment and decrement to parsed_static_opps is done under opp_table->lock now to make sure no races are possible if the OPP table is getting added and removed in parallel (which doesn't happen in practice, but can in theory). Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 11 11月, 2019 1 次提交
-
-
由 Stephen Boyd 提交于
On some SoCs the Adaptive Voltage Scaling (AVS) technique is employed to optimize the operating voltage of a device. At a given frequency, the hardware monitors dynamic factors and either makes a suggestion for how much to adjust a voltage for the current frequency, or it automatically adjusts the voltage without software intervention. Add an API to the OPP library for the former case, so that AVS type devices can update the voltages for an OPP when the hardware determines the voltage should change. The assumption is that drivers like CPUfreq or devfreq will register for the OPP notifiers and adjust the voltage according to suggestions that AVS makes. This patch is derived from [1] submitted by Stephen. [1] https://lore.kernel.org/patchwork/patch/599279/Signed-off-by: NStephen Boyd <sboyd@codeaurora.org> [Roger Lu: Changed to rcu less implementation] Signed-off-by: NRoger Lu <roger.lu@mediatek.com> [s.nawrocki@samsung.com: added handling of OPP min/max voltage] Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 22 10月, 2019 1 次提交
-
-
由 Stephen Boyd 提交于
On some SoCs the Adaptive Voltage Scaling (AVS) technique is employed to optimize the operating voltage of a device. At a given frequency, the hardware monitors dynamic factors and either makes a suggestion for how much to adjust a voltage for the current frequency, or it automatically adjusts the voltage without software intervention. Add an API to the OPP library for the former case, so that AVS type devices can update the voltages for an OPP when the hardware determines the voltage should change. The assumption is that drivers like CPUfreq or devfreq will register for the OPP notifiers and adjust the voltage according to suggestions that AVS makes. This patch is derived from [1] submitted by Stephen. [1] https://lore.kernel.org/patchwork/patch/599279/Signed-off-by: NStephen Boyd <sboyd@codeaurora.org> Signed-off-by: NRoger Lu <roger.lu@mediatek.com> [s.nawrocki@samsung.com: added handling of OPP min/max voltage] Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 21 10月, 2019 1 次提交
-
-
由 Marek Szyprowski 提交于
All the drivers, which use the OPP framework control regulators, which are already enabled. Typically those regulators are also system critical, due to providing power to CPU core or system buses. It turned out that there are cases, where calling regulator_enable() on such boot-enabled regulator has side-effects and might change its initial voltage due to performing initial voltage balancing without all restrictions from the consumers. Until this issue becomes finally solved in regulator core, avoid calling regulator_enable()/disable() from the OPP framework. This reverts commit 7f93ff73. Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: NMark Brown <broonie@kernel.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 26 7月, 2019 5 次提交
-
-
Add enable regulators to dev_pm_opp_set_regulators() and disable regulators to dev_pm_opp_put_regulators(). Even if bootloader leaves regulators enabled, they should be enabled in kernel in order to increase the reference count. Signed-off-by: NKamil Konieczny <k.konieczny@partner.samsung.com> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
The list_kref was added for static OPPs and to track their users. The kref is initialized while the static OPPs are added, but removed unconditionally even if the static OPPs were never added. This causes refcount mismatch warnings currently. Fix that by always initializing the kref when the OPP table is first initialized. The refcount is later incremented only for the second user onwards. Fixes: d0e8ae6c ("OPP: Create separate kref for static OPPs list") Reported-by: NRajendra Nayak <rnayak@codeaurora.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Niklas Cassel 提交于
Since the performance states in the OPP table are unique, implement a dev_pm_opp_find_level_exact() in order to be able to fetch a specific OPP. Signed-off-by: NNiklas Cassel <niklas.cassel@linaro.org> [ Viresh: Updated commit log ] Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
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: NRajendra Nayak <rnayak@codeaurora.org> Tested-by: NRajendra Nayak <rnayak@codeaurora.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
A device may have multiple power-domains and not all of them may be scalable (i.e. support performance states). But dev_pm_opp_attach_genpd() doesn't take that into account currently. Fix that by not verifying the names argument with "power-domain-names" DT property and finding the index into the required-opps array. The names argument will anyway get verified later on when we call dev_pm_domain_attach_by_name(). Fixes: 6319aee1 ("opp: Attach genpds to devices from within OPP core") Reported-by: NRajendra Nayak <rnayak@codeaurora.org> Tested-by: NRajendra Nayak <rnayak@codeaurora.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 24 6月, 2019 1 次提交
-
-
由 Dmitry Osipenko 提交于
_set_opp_custom() receives a set of OPP supplies as its arguments and the caller of it passes NULL when the supplies are not valid. But _set_opp_custom(), by mistake, checks for error by performing IS_ERR(old_supply) on it which will always evaluate to false. The problem was spotted during of testing of upcoming update for the NVIDIA Tegra CPUFreq driver. Cc: stable <stable@vger.kernel.org> Fixes: 7e535993 ("OPP: Separate out custom OPP handler specific code") Reported-by: NMarc Dietrich <marvin24@gmx.de> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> [ Viresh: Massaged changelog ] Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 19 6月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Reviewed-by: NEnrico Weigelt <info@metux.net> Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org> Reviewed-by: NAllison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 17 6月, 2019 2 次提交
-
-
由 Rajendra Nayak 提交于
For devices with performance state, we use dev_pm_opp_set_rate() to set the appropriate clk rate and the performance state. We do need a way to remove the performance state vote when we idle the device and turn the clocks off. Use dev_pm_opp_set_rate() with freq = 0 to achieve this. Signed-off-by: NRajendra Nayak <rnayak@codeaurora.org> Signed-off-by: NStephen Boyd <swboyd@chromium.org> [ Viresh: Updated _set_required_opps() to handle the !opp case ] Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Stephen Boyd 提交于
The OPP table normally contains 'fmax' values corresponding to the voltage or performance levels of each OPP, but we don't necessarily want all the devices to run at fmax all the time. Running at fmax makes sense for devices like CPU/GPU, which have a finite amount of work to do and since a specific amount of energy is consumed at an OPP, its better to run at the highest possible frequency for that voltage value. On the other hand, we have IO devices which need to run at specific frequencies only for their proper functioning, instead of maximum possible frequency. The OPP core currently roundup to the next possible OPP for a frequency and select the fmax value. To support the IO devices by the OPP core, lets do the roundup to fetch the voltage or performance state values, but not use the OPP frequency value. Rather use the value returned by clk_round_rate(). The current user, cpufreq, of dev_pm_opp_set_rate() already does the rounding to the next OPP before calling this routine and it won't have any side affects because of this change. Signed-off-by: NStephen Boyd <swboyd@chromium.org> Signed-off-by: NRajendra Nayak <rnayak@codeaurora.org> [ Viresh: Massaged changelog, added comment and use temp_opp variable instead ] Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 20 5月, 2019 2 次提交
-
-
由 Viresh Kumar 提交于
Currently the space for the array of virtual devices is allocated along with the OPP table, but that isn't going to work well from now onwards. For single power domain case, a driver can either use the original device structure for setting the performance state (if genpd attached with dev_pm_domain_attach()) or use the virtual device structure (if genpd attached with dev_pm_domain_attach_by_name(), which returns the virtual device) and so we can't know in advance if we are going to need genpd_virt_devs array or not. Lets delay the allocation a bit and do it along with dev_pm_opp_attach_genpd() rather. The deallocation is done from dev_pm_opp_detach_genpd(). Tested-by: NNiklas Cassel <niklas.cassel@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
The OPP core requires the virtual device pointers to set performance state on behalf of the device, for the multiple power domain case. The genpd API (dev_pm_domain_attach_by_name()) has evolved now to support even the single power domain case and that lets us add common code for handling both the cases more efficiently. The virtual device structure returned by dev_pm_domain_attach_by_name() isn't normally used by the cpufreq drivers as they don't manage power on/off of the domains and so is only useful for the OPP core. This patch moves all the complexity into the OPP core to make the end drivers simple. The earlier APIs dev_pm_opp_{set|put}_genpd_virt_dev() are reworked into dev_pm_opp_{attach|detach}_genpd(). The new helper dev_pm_opp_attach_genpd() accepts a NULL terminated array of strings which contains names of all the genpd's to attach. It then attaches all the domains and saves the pointers to the virtual devices. The other helper undo the work done by this helper. Tested-by: NNiklas Cassel <niklas.cassel@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 10 4月, 2019 1 次提交
-
-
由 Andrew-sh.Cheng 提交于
This patch introduces a new helper routine in the OPP core, which returns the OPP with the highest frequency which has voltage less than or equal to the target voltage passed to the helper. Signed-off-by: NAndrew-sh.Cheng <andrew-sh.cheng@mediatek.com> [ Viresh: Massaged the commit log and renamed the helper with some cleanups. ] Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 12 3月, 2019 1 次提交
-
-
由 Viresh Kumar 提交于
At boot up, CPUFreq core performs a sanity check to see if the system is running at a frequency defined in the frequency table of the CPU. If so, we try to find a valid frequency (lowest frequency greater than the currently programmed frequency) from the table and set it. When the call reaches dev_pm_opp_set_rate(), it calls _find_freq_ceil(opp_table, &old_freq) to find the previously configured OPP and this call also updates the old_freq. This eventually sets the old_freq == freq (new target requested by cpufreq core) and we skip updating the performance state in this case. Fix this by also updating the performance state when the old_freq == freq. Fixes: ca1b5d77 ("OPP: Configure all required OPPs") Cc: v5.0 <stable@vger.kernel.org> # v5.0 Reported-by: NNiklas Cassel <niklas.cassel@linaro.org> Tested-by: NJorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 07 2月, 2019 2 次提交
-
-
由 Greg Kroah-Hartman 提交于
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Viresh Kumar <vireshk@kernel.org> Cc: Nishanth Menon <nm@ti.com> Cc: Stephen Boyd <sboyd@kernel.org> Cc: linux-pm@vger.kernel.org Reviewed-by: NStephen Boyd <sboyd@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
The previous frequency value isn't getting used in the routine _generic_set_opp_clk_only(), drop it. Reviewed-by: NStephen Boyd <sboyd@kernel.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 23 1月, 2019 1 次提交
-
-
由 Rajendra Nayak 提交于
Now that the OPP bindings are updated to include an optional 'opp-level' property, add support to parse it from device tree and store it as part of dev_pm_opp structure. Also add and export an helper 'dev_pm_opp_get_level()' that can be used to get the level value read from device tree when present. Reviewed-by: NStephen Boyd <swboyd@chromium.org> Acked-by: NViresh Kumar <viresh.kumar@linaro.org> Signed-off-by: NRajendra Nayak <rnayak@codeaurora.org> Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: NAndy Gross <andy.gross@linaro.org>
-
- 04 1月, 2019 1 次提交
-
-
由 Viresh Kumar 提交于
Since the commit 2a4eb735 "OPP: Don't remove dynamic OPPs from _dev_pm_opp_remove_table()", dynamically created OPP aren't automatically removed anymore by dev_pm_opp_cpumask_remove_table(). This affects the scpi and scmi cpufreq drivers which no longer free OPPs on failures or on invocations of the policy->exit() callback. Create a generic OPP helper dev_pm_opp_remove_all_dynamic() which can be called from these drivers instead of dev_pm_opp_cpumask_remove_table(). In dev_pm_opp_remove_all_dynamic(), we need to make sure that the opp_list isn't getting accessed simultaneously from other parts of the OPP core while the helper is freeing dynamic OPPs, i.e. we can't drop the opp_table->lock while traversing through the OPP list. And to accomplish that, this patch also creates _opp_kref_release_unlocked() which can be called from this new helper with the opp_table lock already held. Cc: 4.20 <stable@vger.kernel.org> # v4.20 Reported-by: NValentin Schneider <valentin.schneider@arm.com> Fixes: 2a4eb735 "OPP: Don't remove dynamic OPPs from _dev_pm_opp_remove_table()" Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org> Tested-by: NValentin Schneider <valentin.schneider@arm.com> Reviewed-by: NSudeep Holla <sudeep.holla@arm.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 14 12月, 2018 1 次提交
-
-
由 Viresh Kumar 提交于
dev_pm_genpd_set_performance_state() needs to handle performance state propagation going forward. Currently this routine only gets the required performance state of the device's genpd as an argument, but it doesn't know how to translate that to master genpd(s) of the device's genpd. Introduce a new helper dev_pm_opp_xlate_performance_state() which will be used to translate from performance state of a device (or genpd sub-domain) to another device (or master genpd). Normally the src_table (of genpd sub-domain) will have the "required_opps" property set to point to one of the OPPs in the dst_table (of master genpd), but in some cases the genpd and its master have one to one mapping of performance states and so none of them have the "required-opps" property set. Return the performance state of the src_table as it is in such cases. Tested-by: NRajendra Nayak <rnayak@codeaurora.org> Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 11 12月, 2018 2 次提交
-
-
由 Viresh Kumar 提交于
There is one case where we may end up with no "supply" directory for the OPPs in debugfs. That happens when the OPP core isn't managing the regulators for the device and the device's OPP do have microvolt property. It happens because the opp_table->regulator_count remains set to 0 and the debugfs routines don't add any supply directory in such a case. This commit fixes that by setting opp_table->regulator_count to 1 in that particular case. But to make everything work nicely and not break other parts of the core, regulator_count is defined as "int" now instead of "unsigned int" and it can have different special values now. It is set to -1 initially to mark it "uninitialized" and later only we set it to 0 or positive values after checking how many supplies are there. This also helps in finding the bugs where only few of the OPPs have the "opp-microvolt" property set and not all. Fixes: 1fae788e ("PM / OPP: Don't create debugfs "supply-0" directory unnecessarily") Reported-by: NQuentin Perret <quentin.perret@arm.com> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
The value of opp_table->regulator_count is not very consistent right now and it may end up being 0 while we do have a "opp-microvolt" property in the OPP table. It was kept that way as we used to check if any regulators are set with the OPP core for a device or not using value of regulator_count. Lets use opp_table->regulators for that purpose as the meaning of regulator_count is going to change in the later patches. Reported-by: NQuentin Perret <quentin.perret@arm.com> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 05 11月, 2018 5 次提交
-
-
由 Viresh Kumar 提交于
Now that all the infrastructure is in place to support multiple required OPPs, lets switch over to using it. A new internal routine _set_required_opps() takes care of updating performance state for all the required OPPs. With this the performance state updates are supported even when the end device needs to configure regulators as well, that wasn't the case earlier. The pstates were earlier stored in the end device's OPP structures, that also changes now as those values are stored in the genpd's OPP structures. And so we switch over to using pm_genpd_opp_to_performance_state() instead of of_genpd_opp_to_performance_state() to get performance state for the genpd OPPs. The routine _generic_set_opp_domain() is not required anymore and is removed. On errors we don't try to recover by reverting to old settings as things are really complex now and the calls here should never really fail unless there is a bug. There is no point increasing the complexity, for code which will never be executed. Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
Multiple generic power domains for a consumer device are supported with the help of virtual devices, which are created for each consumer device - genpd pair. These are the device structures which are attached to the power domain and are required by the OPP core to set the performance state of the genpd. The helpers added by this commit are required to be called once for each of these virtual devices. These are required only if multiple domains are available for a device, otherwise the actual device structure will be used instead by the OPP core. The new helpers also support the complex cases where the consumer device wouldn't always require all the domains. For example, a camera may require only one power domain during normal operations but two during high resolution operations. The consumer driver can call dev_pm_opp_put_genpd_virt_dev(high_resolution_genpd_virt_dev) if it is currently operating in the normal mode and doesn't have any performance requirements from the genpd which manages high resolution power requirements. The consumer driver can later call dev_pm_opp_set_genpd_virt_dev(high_resolution_genpd_virt_dev) once it switches back to the high resolution mode. The new helpers differ from other OPP set/put helpers as the new ones can be called with OPPs initialized for the table as we may need to call them on the fly because of the complex case explained above. For this reason it is possible that the genpd virt_dev structure may be used in parallel while the new helpers are running and a new mutex is added to protect against that. We didn't use the existing opp_table->lock mutex as that is widely used in the OPP core and we will need this lock in the dev_pm_opp_set_rate() helper while changing OPP and we need to make sure there is not much contention while doing that as that's the hotpath. Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
An earlier commit populated the OPP tables from the "required-opps" property, this commit populates the individual OPPs. This is repeated for each OPP in the OPP table and these populated OPPs will be used by later commits. Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
The current implementation works only for the case where a single phandle is present in the "required-opps" property, while DT allows multiple phandles to be present there. This patch adds new infrastructure to parse all the phandles present in "required-opps" property and save pointers of the required OPP's OPP tables. These will be used by later commits. Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
Create a separate routine to take care of custom set_opp() handler specific stuff. Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 04 10月, 2018 1 次提交
-
-
由 Viresh Kumar 提交于
Return error number instead of 0 on failures. Fixes: a1e8c136 ("PM / OPP: "opp-hz" is optional for power domains") Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 01 10月, 2018 1 次提交
-
-
由 Viresh Kumar 提交于
When two or more devices are sharing their clock and voltage rails, they share the same OPP table. But there are some corner cases where the OPP core incorrectly creates separate OPP tables for them. For example, CPU 0 and 1 share clock/voltage rails. The platform specific code calls dev_pm_opp_set_regulators() for CPU0 and the OPP core creates an OPP table for it (the individual OPPs aren't initialized as of now). The same is repeated for CPU1 then. Because _opp_get_opp_table() doesn't compare DT node pointers currently, it fails to find the link between CPU0 and CPU1 and so creates a new OPP table. Fix this by calling _managed_opp() from _opp_get_opp_table(). _managed_opp() gain an additional argument (index) to get the right node pointer. This resulted in simplifying code in _of_add_opp_table_v2() as well. Tested-by: NNiklas Cassel <niklas.cassel@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
- 20 9月, 2018 3 次提交
-
-
由 Viresh Kumar 提交于
Currently there are two separate ways to free the OPP table based on how it is created in the first place. We call _dev_pm_opp_remove_table() to free the static and/or dynamic OPP, OPP list devices, etc. This is done for the case where the OPP table is added while initializing the OPPs, like via the path dev_pm_opp_of_add_table(). We also call dev_pm_opp_put_opp_table() in some cases which eventually frees the OPP table structure once the reference count reaches 0. This is used by the first case as well as other cases like dev_pm_opp_set_regulators() where the OPPs aren't necessarily initialized at this point. This whole thing is a bit unclear and messy and obstruct any further cleanup/fixup of OPP core. This patch tries to streamline this by keeping a single path for OPP table destruction, i.e. dev_pm_opp_put_opp_table(). All the cleanup happens in _opp_table_kref_release() now after the reference count reaches 0. _dev_pm_opp_remove_table() is removed as it isn't required anymore. We don't drop the reference to the OPP table after creating it from _of_add_opp_table_v{1|2}() anymore and the same is dropped only when we try to remove them. Tested-by: NNiklas Cassel <niklas.cassel@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
Only one platform was depending on this feature and it is already updated now. Stop removing dynamic OPPs from _dev_pm_opp_remove_table(). This simplifies lot of paths and removes unnecessary parameters. Tested-by: NNiklas Cassel <niklas.cassel@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-
由 Viresh Kumar 提交于
The static OPPs don't always get freed with the OPP table, it can happen before that as well. For example, if the OPP table is first created using helpers like dev_pm_opp_set_supported_hw() and the OPPs are created at a later point. Now when the OPPs are removed, the OPP table stays until the time dev_pm_opp_put_supported_hw() is called. Later patches will streamline the freeing of OPP table and that requires the static OPPs to get freed with help of a separate kernel reference. This patch prepares for that by creating a separate kref for static OPPs list. Tested-by: NNiklas Cassel <niklas.cassel@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
-