summaryrefslogtreecommitdiffstats
path: root/drivers/devfreq
AgeCommit message (Collapse)AuthorFilesLines
2016-12-08devfreq: rk3399_dmc: Don't use OPP structures outside of RCU locksViresh Kumar1-6/+5
The OPP structures are abused to the best here, without understanding how the OPP core and RCU locks work. In short, the OPP pointer saved in 'rk3399_dmcfreq' can become invalid under your nose, as the OPP core may free it. Fix various abuses around OPP structures and calls. Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-12-08devfreq: rk3399_dmc: Remove dangling rcu_read_unlock()Viresh Kumar1-1/+0
This call never had the rcu_read_lock() counterpart. Remove the unlock part as well. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-12-08devfreq: exynos: Don't use OPP structures outside of RCU locksViresh Kumar1-15/+14
The OPP structures are abused to the best here, without understanding how the OPP core and RCU locks work. In short, the OPP pointer saved 'struct exynos_bus' can become invalid under your nose, as the OPP core may free it. Fix various abuses around OPP structures and calls. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-11-17PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq devChanwoo Choi1-1/+1
This patch uses the resource-managed to add the devfreq device. This function will make it easy to handle the devfreq device. - struct devfreq *devm_devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile, const char *governor_name, void *data); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: correct comment typo.MyungJoo Ham1-1/+1
The function name in the comment was incorrect. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-11-17PM / devfreq: exynos-ppmu: Remove unused mutex from struct exynos_ppmuAxel Lin1-3/+0
The mutex is not used at all, remove it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: exynos-ppmu: ppmu_events array should not be NULL terminatedAxel Lin1-2/+0
The rest of the code uses ARRAY_SIZE to count the number of entries in ppmu_events array. The NULL terminated entry makes ARRAY_SIZE return off-by-one value. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: exynos-ppmu: Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/devfreq/event/exynos-ppmu.ko | grep alias $ After this patch: $ modinfo drivers/devfreq/event/exynos-ppmu.ko | grep alias alias: of:N*T*Csamsung,exynos-ppmu-v2C* alias: of:N*T*Csamsung,exynos-ppmu-v2 alias: of:N*T*Csamsung,exynos-ppmuC* alias: of:N*T*Csamsung,exynos-ppmu Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: rockchip-dfi: Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/devfreq/event/rockchip-dfi.ko | grep alias $ After this patch: $ modinfo drivers/devfreq/event/rockchip-dfi.ko | grep alias alias: of:N*T*Crockchip,rk3399-dfiC* alias: of:N*T*Crockchip,rk3399-dfi Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: exynos-nocp: Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/devfreq/event/exynos-nocp.ko | grep alias $ After this patch: $ modinfo drivers/devfreq/event/exynos-nocp.ko | grep alias alias: of:N*T*Csamsung,exynos5420-nocpC* alias: of:N*T*Csamsung,exynos5420-nocp Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: rk3399_dmc: Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/devfreq/rk3399_dmc.ko | grep alias $ After this patch: $ modinfo drivers/devfreq/rk3399_dmc.ko | grep alias alias: of:N*T*Crockchip,rk3399-dmcC* alias: of:N*T*Crockchip,rk3399-dmc Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-10-11PM / devfreq: Skip status update on uninitialized previous_freqTobias Jakobi1-0/+4
In case devfreq->previous_freq is still uninitialized in devfreq_update_status(), i.e. it has value '0', the lookups in that function fail, eventually leading to some error message: [ 3.041292] devfreq bus_dmc: Couldn't update frequency transition information. Just skip the statup update in this situation. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-10-11PM / devfreq: Add proper locking around list_del()Axel Lin1-1/+3
Use devfreq_list_lock around list_del() to prevent list corruption. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-10-10PM / devfreq: exynos-nocp: Remove redundant codeAxel Lin1-3/+0
load_count/total_count are reset by devfreq_event_get_event(), so remove the redundant code in exynos_nocp_get_event(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> [ rjw: Subject/changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-10-10PM / devfreq: exynos-nocp: Select REGMAP_MMIOAxel Lin1-0/+1
This driver uses devm_regmap_init_mmio(), so select REGMAP_MMIO to avoid build failure. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-19PM / devfreq: rk3399_dmc: Remove explictly regulator_put call in .removeAxel Lin1-10/+0
Current code uses devm_regulator_get() in .probe so a regulator_put() will be automatically called when unload the module. Remove the explictly regulator_put() call and then we can also remove rk3399_dmcfreq_remove(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-19PM / devfreq: rockchip: add PM_DEVFREQ_EVENT dependencyArnd Bergmann1-0/+1
The newly added ARM_RK3399_DMC_DEVFREQ driver requires the DEVFREQ_EVENT_ROCKCHIP_DFI driver and tries to turn that on through a 'select' statement, and that in turn has a dependency on PM_DEVFREQ_EVENT, which may be disabled here: warning: (ARM_RK3399_DMC_DEVFREQ) selects DEVFREQ_EVENT_ROCKCHIP_DFI which has unmet direct dependencies (PM_DEVFREQ && PM_DEVFREQ_EVENT && ARCH_ROCKCHIP) We probably want a 'depends on' here, but other drivers use 'select' too, so for consistency I'm doing the same. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 5a893e31a636 (PM / devfreq: rockchip: add devfreq driver for rk3399 dmc) Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-14partial revert of "PM / devfreq: Add COMPILE_TEST for build coverage"Stephen Rothwell1-1/+1
This reverts the Tegra part of commit 797da5598f3a (PM / devfreq: Add COMPILE_TEST for build coverage) that introduced a build failute in in linux-next. [ rjw: Changelog ] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-06PM / devfreq: rockchip: add devfreq driver for rk3399 dmcLin Huang3-0/+492
base on dfi result, we do ddr frequency scaling, register dmc driver to devfreq framework, and use simple-ondemand policy. Signed-off-by: Lin Huang <hl@rock-chips.com> Signed-off-by: MyngJoo Ham <myngjoo.ham@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-06PM / devfreq: event: support rockchip dfi controllerLin Huang3-0/+264
on rk3399 platform, there is dfi conroller can monitor ddr load, base on this result, we can do ddr freqency scaling. Signed-off-by: Lin Huang <hl@rock-chips.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-06PM / devfreq: fix Kconfig indent styleJisheng Zhang1-8/+8
Use tab rather than space to indent, and tab + two spaces to indent help message. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-09-06PM / devfreq: Add COMPILE_TEST for build coverageKrzysztof Kozlowski2-4/+4
The SoC-specific devfreq and devfreq-event drivers can be build tested on all architectures. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-09-06PM / devfreq: exynos-ppmu: remove unneeded of_node_put()Wei Yongjun1-2/+0
for_each_child_of_node() performs an of_node_put() on each iteration, so putting an of_node_put() before a continue results in a double put. Generated by: scripts/coccinelle/iterators/device_node_continue.cocci Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandlePeter Chen1-3/+6
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. [Commit updated to fix an error by MyungJoo] Cc: Chanwoo Choi <cw00.choi@samsung.com> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Kukjin Kim <kgene@kernel.org> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: add missing of_node_put after calling of_parse_phandlePeter Chen1-0/+2
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: exynos-ppmu: fix error path in exynos_ppmu_probe()Bartlomiej Zolnierkiewicz1-1/+2
iounmap() needs to be called in case of memory allocation (for devfreq-event devices) failure. Fix it. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: exynos: fix error path in exynos_bus_probe()Bartlomiej Zolnierkiewicz1-1/+1
In case of exynos_bus_parse_of() failure the code shouldn't try to remove the OPP table and disable+unprepare bus->clk as it has been already handled in exynos_bus_parse_of(). Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: make event/exynos-ppmu DEVFREQ_EVENT_EXYNOS_PPMU tristatePaul Gortmaker1-1/+1
The Kconfig currently controlling compilation of this code is: config DEVFREQ_EVENT_EXYNOS_PPMU bool "EXYNOS PPMU (Platform Performance Monitoring Unit) DEVFREQ event Driver" ...meaning that it currently is not being built as a module by anyone. Rather than rip out the existing modular code, Chanwoo indicated that he'd rather see the driver offered as tristate. I don't have the hardware for runtime validation, so this change is only validated for compile and modpost. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: make event/exynos-nocp DEVFREQ_EVENT_EXYNOS_NOCP tristatePaul Gortmaker1-1/+1
The Kconfig currently controlling compilation of this code is: event/Kconfig:config DEVFREQ_EVENT_EXYNOS_NOCP event/Kconfig: bool "EXYNOS NoC (Network On Chip) Probe DEVFREQ event Driver" ...meaning that it currently is not being built as a module by anyone. Rather than rip out the existing modular code, Chanwoo indicated that he'd rather see the driver offered as tristate. I don't have the hardware for runtime validation, so this change is only validated for compile and modpost. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: make exynos-bus ARM_EXYNOS_BUS_DEVFREQ tristatePaul Gortmaker1-1/+1
The Kconfig currently controlling compilation of this code is: devfreq/Kconfig:config ARM_EXYNOS_BUS_DEVFREQ devfreq/Kconfig: bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" ...meaning that it currently is not being built as a module by anyone. Rather than rip out the existing modular code, Chanwoo indicated that he'd rather see the driver offered as tristate. I don't have the hardware for runtime validation, so this change is only validated for compile and modpost. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: make devfreq-event explicitly non-modularPaul Gortmaker1-11/+1
The Kconfig currently controlling compilation of this code is: menuconfig PM_DEVFREQ_EVENT bool "DEVFREQ-Event device Support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. This code wasn't using module_init, so we don't need to be concerned with altering the initcall level here. We don't replace module.h with init.h since the file already has that. But we do add export.h since this file does export some symbols. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-07-06PM / devfreq: make devfreq explicitly non-modularPaul Gortmaker1-12/+1
The Kconfig currently controlling compilation of this code is: menuconfig PM_DEVFREQ bool "Generic Dynamic Voltage and Frequency Scaling (DVFS) support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. This code wasn't using module_init, so we don't need to be concerned with altering the initcall level here. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. We don't replace module.h with init.h since the file already has that. But we do add export.h since this file does export some symbols. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-06-23PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failedChanwoo Choi1-1/+4
This patch sends the DEVFREQ_POSTCHANGE notification when devfreq->profile->targer() is failed. The PRECHANGE/POSTCHANGE should be paired. Fixes: 0fe3a66410a3 (PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier) Reported-by: Lin Huang <hl@rock-chips.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-06-22PM / devfreq: fix initialization of current frequency in last statusLukasz Luba1-0/+1
Some systems need current frequency from last_status for calculation but it is zeroed during initialization. When the device starts there is no history, but we can assume that the last frequency was the same as the initial frequency (which is also used in 'previous_freq'). The log shows the result of this misinterpreted value. [ 2.042847] ... Failed to get voltage for frequency 0: -34 Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Reviewed-by: Javi Merino <javi.merino@arm.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-06-22PM / devfreq: exynos-nocp: Remove incorrect IS_ERR() checkDan Carpenter1-3/+0
Smatch complains because platform_get_resource() returns NULL on error and not an error pointer so the check is wrong. Julia Lawall pointed out that normally we don't check these, because devm_ioremap_resource() has a check for NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-06-22PM / devfreq: remove double put_deviceMyungJoo Ham1-1/+0
When device_register() returns with error, it has already done put_device() on the input device pointer. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-06-22PM / devfreq: fix double call put_deviceCai Zhiyong1-1/+0
1295 */ 1296 void device_unregister(struct device *dev) 1297 { 1298 pr_debug("device: '%s': %s\n", dev_name(dev), __func__); 1299 device_del(dev); 1300 put_device(dev); 1301 } 1302 EXPORT_SYMBOL_GPL(device_unregister); 1303 device_unregister is called put_device, there is no need to call put_device(&devfreq->dev) again. Signed-off-by: Cai Zhiyong <caizhiyong@huawei.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-06-22PM / devfreq: fix duplicated kfree on devfreq pointerMyungJoo Ham1-1/+0
device_unregister() calls kfree already. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-06-22PM / devfreq: devm_kzalloc to have dev pointer more preciselyMyungJoo Ham1-9/+9
devm_kzalloc of devfreq's statistics data structure has been using its parent device as the dev allocated for. If a device's devfreq is disabled in run-time, such allocated memory won't be freed. Desginating more precisely with the devfreq device pointer fixes the issue. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-05-03PM / devfreq: style/typo fixesMyungJoo Ham2-4/+2
- Typo in comments fixed - Unnecessary return statement removed Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-05-03PM / devfreq: event: Find the instance of devfreq-event device by using phandleChanwoo Choi1-0/+5
This patch use the phandle to find the instance of devfreq-event device in Device Tree when calling the devfreq_event_get_edev_by_phandle() because there is two type devfreq-event devices as following: First case, exynos-ppmu.c driver provides the maximum four event of each PPMU. So, when getting the instance of devfreq-event device, using the unique name of struct devfreq_event_desc. Second case, exynos-nocp.c driver provide the only one event of each NoC Probe device. So, when getting the instance of devfreq-event device, using the phandle of each NoC probe device. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-05-03PM / devfreq: event: Add new Exynos NoC probe driverChanwoo Choi4-0/+392
This patch adds NoC (Network on Chip) Probe driver which provides the primitive values to get the performance data. The packets that the Network on Chip (NoC) probes detects are transported over the network infrastructure. Exynos542x bus has multiple NoC probes to provide bandwidth information about behavior of the SoC that you can use while analyzing system performance. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Markus Reichl <m.reichl@fivetechno.de> Tested-by: Anand Moon <linux.amoon@gmail.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-05-03PM / devfreq: exynos: Remove unused exynos4/5 busfreq driverChanwoo Choi8-1828/+0
This patch removes the unused exynos4/5 busfreq driver. Instead, generic exynos-bus frequency driver support the all Exynos SoCs. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-05-03PM / devfreq: exynos: Add support of bus frequency of sub-blocks using ↵Chanwoo Choi2-46/+174
passive governor This patch adds the support of bus frequency feature for sub-blocks which share the one power line. If each bus depends on the power line, each bus is not able to change the voltage by oneself. To optimize the power-consumption on runtime, some buses using the same power line should change the source clock and regulator at the same time. So, this patch uses the passive governor to support the bus frequency for all buses which sharing the one power line. For example, Exynos3250 include the two power line for AXI buses as following: : VDD_MIF : MIF (Memory Interface) provide the DMC (Dynamic Memory Controller) with the power (regulator). : VDD_INT : INT (Internal) provide the various sub-blocks with the power (regulator). Each bus is included in as follwoing block. In the case of VDD_MIF, only DMC bus use the power line. So, there is no any depencency between buese. But, in the case of VDD_INT, various buses share the one power line of VDD_INT. We need to make the depenency between buses. When using passive governor, there is no problem to support the bus frequency as DVFS for all buses. One bus should be operated as the parent bus device which gathering the current load of INT block and then decides the new frequency with some governors except of passive governor. After deciding the new frequency by the parent bus device, the rest bus devices will change the each source clock according to new frequency of the parent bus device. - MIF (Memory Interface) block : VDD_MIF |--- DMC - INT (Internal) block : VDD_INT |--- LEFTBUS (parent) |--- PERIL |--- MFC |--- G3D |--- RIGHTBUS |--- FSYS |--- LCD0 |--- PERIR |--- ISP |--- CAM Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> [tjakobi: Reported debugfs error during booting and cw00.choi fix it.] Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-05-03PM / devfreq: Add new passive governorChanwoo Choi3-0/+216
This patch adds the new passive governor for DEVFREQ framework. The following governors are already present and used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The following governors are independently used for one device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers. - ondemand / performance / powersave / userspace The passive governor depends on operation of parent driver with specific governos extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree: - the source clock and OPP tables - the instance of parent device For exameple, there are one more devfreq device drivers which need to change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, specific device driver is operated as parent with ondemand governor and then the rest device driver with passive governor is influenced by parent device. Suggested-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> [tjakobi: Reported RCU locking issue and cw00.choi fix it] Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> [linux.amoon: Reported possible recursive locking and cw00.choi fix it] Reported-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-05-03PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifierChanwoo Choi1-1/+162
This patch adds the new DEVFREQ_TRANSITION_NOTIFIER notifier to send the notification when the frequency of device is changed. This notifier has two state as following: - DEVFREQ_PRECHANGE : Notify it before chaning the frequency of device - DEVFREQ_POSTCHANGE : Notify it after changed the frequency of device And this patch adds the resourced-managed function to release the resource automatically when error happen. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> [m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board] Tested-by: Markus Reichl <m.reichl@fivetechno.de> Tested-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-05-03PM / devfreq: Add devfreq_get_devfreq_by_phandle()Chanwoo Choi1-0/+44
This patch adds the new devfreq_get_devfreq_by_phandle() OF helper function which can find the instance of devfreq device by using phandle ("devfreq"). Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> [m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board] Tested-by: Markus Reichl <m.reichl@fivetechno.de> Tested-by: Anand Moon <linux.amoon@gmail.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-05-03PM / devfreq: exynos: Add generic exynos bus frequency driverChanwoo Choi3-0/+459
This patch adds the generic exynos bus frequency driver for AMBA AXI bus of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC have the common architecture for bus between DRAM and sub-blocks in SoC. This driver can support the generic bus frequency driver for Exynos SoCs. In devicetree, Each bus block has a bus clock, regulator, operation-point and devfreq-event devices which measure the utilization of each bus block. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> [m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board] Tested-by: Markus Reichl <m.reichl@fivetechno.de> Tested-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-03-17PM / devfreq: Spelling s/frequnecy/frequency/Geert Uytterhoeven1-1/+1
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-02-23PM / devfreq: tegra: Set freq in rate callbackTomeu Vizoso1-0/+2
As per the documentation of the devfreq_dev_profile.target callback, set the freq argument to the new frequency before returning. This caused endless messages like this after recent changes in the core: devfreq 6000c800.actmon: Couldn't update frequency transition information. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reported-by: Tyler Baker <tyler.baker@linaro.org> Tested-by: Thierry Reding <treding@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>