summaryrefslogtreecommitdiffstats
path: root/drivers/devfreq
Commit message (Collapse)AuthorAge
* devfreq: check if debugfs is initialized before creationSumit Gupta2021-07-13
| | | | | | | | | | | | | | | | Added checks for debugfs_initialized() and name not null before creating debugfs node. Bug 3330530 Signed-off-by: Sumit Gupta <sumitg@nvidia.com> Change-Id: I11f3f898d51309f8b94ac8d920ceb8becec19c8d Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2552533 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
* devfreq: wmark: active: set interrupt_drivenKen Chang2020-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set interrupt_driven to 1 thus cancel_delayed_work_sync() won't be called in devfreq_monitor_suspend() when handling DEVFREQ_GOV_SUSPEND event. This will avoid below warning prints when runtime PM is enabled. [ 22.121071] INFO: trying to register non-static key. [ 22.126030] the code is fine but needs lockdep annotation. [ 22.131501] turning off the locking correctness validator. The backstrace: [ 9.322855] [<ffffff80080d3b04>] flush_work+0x1fc/0x208 [ 9.322858] [<ffffff80080d5180>] __cancel_work_timer+0xa0/0x188 [ 9.322862] [<ffffff80080d52bc>] cancel_delayed_work_sync+0x24/0x30 [ 9.322867] [<ffffff8008ce1da4>] devfreq_monitor_suspend+0x4c/0x80 [ 9.322871] [<ffffff8008ce6d7c>] devfreq_watermark_event_handler+0x3b4/0x458 [ 9.322874] [<ffffff8008ce1d20>] devfreq_suspend_device+0x60/0x98 [ 9.322878] [<ffffff800852dad4>] nvhost_module_runtime_suspend+0x64/0x160 [ 9.322883] [<ffffff800878dc64>] pm_generic_runtime_suspend+0x3c/0x58 [ 9.322887] [<ffffff800879e478>] genpd_runtime_suspend+0x98/0x230 [ 9.322890] [<ffffff8008790004>] __rpm_callback+0x74/0xa0 [ 9.322893] [<ffffff8008790064>] rpm_callback+0x34/0x98 [ 9.322896] [<ffffff80087906c8>] rpm_suspend+0x100/0x5f0 [ 9.322899] [<ffffff80087921d0>] pm_runtime_work+0x80/0xb8 [ 9.322902] [<ffffff80080d4054>] process_one_work+0x1e4/0x4b0 [ 9.322904] [<ffffff80080d4370>] worker_thread+0x50/0x4c8 [ 9.322908] [<ffffff80080daffc>] kthread+0xec/0xf0 [ 9.322911] [<ffffff80080838a0>] ret_from_fork+0x10/0x30 Bug 3128395 Change-Id: I15116cd452a062620c01e91f71eecba7d68cde17 Signed-off-by: Ken Chang <kenc@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2418831 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Aaron Tian <atian@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* podgov: Clear history and set freq before suspendMary Do2020-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the device is active, devfreq calls into podgov to set the device frequency based on the device workload. When the device goes into suspension, devfreq would do one last call into podgov before going into suspension. However, because podgov decides the frequency based on the history of previous loads, if the load drops suddenly (i.e. going from 100% to 0%), this last call might result in the frequency set high and kept high until devfreq resumes running. In this change, podgov would check if the device has been suspended, and if so, it would clear the history and set the frequency to min freq before suspending devfreq. As a result, whenever the device is suspended, its frequency will be set to min freq. Bug 200613859 Change-Id: I1ad2fd563407d53177a84f8fddbf47b699fa97b5 Signed-off-by: Mary Do <mdo@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2358085 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mubushir Rahman <mubushirr@nvidia.com> Reviewed-by: Peng Liu <pengliu@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: wmark: active: config params by sysfsAaron Tian2020-01-03
| | | | | | | | | | | | | | | Configure governor parameters through sysfs instead of debugfs, add add spinlock for concurrency protection. Bug 200501949 Change-Id: I0131e6ab0d3befe380ef4774eb4d6193d2266011 Signed-off-by: Aaron Tian <atian@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2267338 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: wmark: active: introduce freq_boost_en knobAaron Tian2019-12-11
| | | | | | | | | | | | | | | | | | | | There is a freq. boost mechanism in wmark_active governor, when current loading exceed load_max, directly set target freq. to fmax. Introduce 'freq_boost_en' knob to support enable/disable freq. boost. If performance does not regressed, freq. boost can be disabled to let DFS smoothly and save power. Bug 200501949 Change-Id: I6ec7b7079a22a8d974743d766cfd0cc7d0e2dcd4 Signed-off-by: Aaron Tian <atian@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2255082 GVS: Gerrit_Virtual_Submit Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* video: tegra: host: update T186 VIC actmon driverAaron Tian2019-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify T186/T210 VIC actmon driver and wmark_active governor to address the following issues: 1. To let VIC actmon reports accurate VIC active cycle counts, set static WEIGHT_COUNT in both VIC actmon and VIC IP block. It ensures VIC actmon can capture all activity signal toggle event from VIC. The value of WEIGHT_COUNT are equal to: 4 * (max VIC freq / VIC_actmon freq) = 4 * (1024 / 19.2) ~= 213 2. Since VIC actmon reports active "VIC clock cycle" instead of "VIC actmon clock cycle", "relative loading translation" should consider current VIC clock freq. E.g., - sample_period = 80 us, VIC freq = 115.2 Mhz - 9216 cycles represents 100% loading (115.2 * 80) 3. Update upper/lower wmark settings after VIC clock scaled completed, to ensure wmark settings are equil to 0 ~ 100% loading of current freq. - Register 'get_dev_status' instance in devfreq_dev_profile, to let wmark active governor can query current device freq. - Register devfreq transition notifier in wmark_active governor. It will query current device freq. and update corresponding wmark value after VIC freq. changed. Bug 200501949 Change-Id: Ic159eb93fddc37d55b0c9649a3afcb50ed82cac2 Signed-off-by: Aaron Tian <atian@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2200520 GVS: Gerrit_Virtual_Submit Reviewed-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: recent high as a scaling factorPeng Liu2019-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | A circle buffer is introduced to store recent normalized GPU active cycle counts. The highest value in this buffer marks the busiest moment in recent history. When podgov decides next GPU freqeuncy, it makes sure the new frequency level can satisfy the recent high work load. This can be considered as an adaptive GPU frequency floor. This feature can reduce stutter for certain use cases where work load spikes occur without any temporal pattern, such as 4k video playback. Bug 1963732 Change-Id: I70024f4d3ffb63425852e4f320eeffb6bc77c5e3 Signed-off-by: Peng Liu <pengliu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2114154 (cherry picked from commit 79ce3f6aa88f3950a13037bd4459fcc0bce6914e) Reviewed-on: https://git-master.nvidia.com/r/2120647 GVS: Gerrit_Virtual_Submit Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Tested-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: Aaron Tian <atian@nvidia.com> Tested-by: Aaron Tian <atian@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: add debug info when debugfs creation failSumit Gupta2019-05-09
| | | | | | | | | | | | | | | | | | | Add debugfs_lookup() to check if the debugfs creation failure is due to the directory already present. Also, calling panic to get the callstack to see which code is creating debugfs again. Panic was added because dumpstack() is not giving callstack due to low lo0g level. Bug 200491990 Change-Id: I45ac74c90f6c15a53a12f10d7147b476ce829b38 Signed-off-by: Sumit Gupta <sumitg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2110058 GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com> Tested-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: podgov: use cycles/sec to estimate loadPeng Liu2019-05-07
| | | | | | | | | | | | | | | | | | | | | | | | GPU clock may change within the period of time defined by smooth. Thus the result of averaging load percentages within smooth window has less meanning. New method keeps track of active GPU cycle count per time unit, and average load is average active cycle count divided by current GPU clock (total cycle count per time unit). Bug 1963732 Change-Id: I88cfb998f9bcfa0d6d0397f653f8e3096d4b3eed Signed-off-by: Peng Liu <pengliu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2033266 (cherry picked from commit 4080e458dd4e1651ef61f4d9cf3f2b5ea6eb6a1f) Reviewed-on: https://git-master.nvidia.com/r/2104701 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Aaron Tian <atian@nvidia.com> Tested-by: Aaron Tian <atian@nvidia.com> Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: add dumpstack in debugfs creation failuresumitg2019-03-15
| | | | | | | | | | | | | | | | | | Adding dump_stack() in error condition while creating debugfs to track possible double gpu gov addition path. "podgov: can't create debugfs directory" Bug 200491990 Change-Id: I6f7f3e1aa6ff0e86af9a399c7ce7a1bb75b4b7bb Signed-off-by: sumitg <sumitg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2023741 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com> Tested-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: add core kernel directory to include pathTimo Alho2018-07-10
| | | | | | | | | | | | | Add include path pointing to core kernel repository in order for the drivers to include "governor.h" and possibly other local header files from there. Bug 2246029 Change-Id: Ic4e31e51c6ef6fa8b2f9ef6ce19e4ae87f90a1f3 Signed-off-by: Timo Alho <talho@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1774215 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
* devfreq: add Makefile and Kconfig for Nvidia governorsTimo Alho2018-07-05
| | | | | | | | | | | | | | | | POD_SCALING, WMARK_ACTIVE, and WMARK_SIMPLE devfreq scaling governors were moved to linux-nvidia repository. Add corresponding Kconfig and Makefile for them. Bug 200427621 Change-Id: Ib6e9416c11c5a6938c472ebf2d9480d85ddd473d Signed-off-by: Timo Alho <talho@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1770155 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: wmark: active: add GPL module licenseJoseph Lo2018-07-05
| | | | | | | | | | | | | | | | | | | | Add GPL module license to able to use the symbols that are exported by "EXPORT_SYMBOL_GPL". Bug 200299507 Change-Id: I127507b86392ebc20f5d04a747c528e788d87294 Signed-off-by: Joseph Lo <josephl@nvidia.com> Reviewed-on: http://git-master/r/1478916 Reviewed-on: https://git-master.nvidia.com/r/1551729 (cherry picked from linux-4.9 commit aa85b2d73b55496faabf0deae896d021bda7d8c8) Reviewed-on: https://git-master.nvidia.com/r/1770154 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* Fix include paths for in-tree buildsStephen Warren2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some source files include header files using <> even though the header file is not in a directory typically in the system include path. This works when compiling the kernel with an O= option (which stores built files outside the source tree) because the kernel adds various extra source paths to the system include path. However, this doesn't happen when building in-tree, so the source must be fixed to use "" for "local" files. Similarly, fix one usage of "" where no path was specified in the "" filename, whereas the header was in a relative directory to the source. Again, with O= I believe this works because the kernel added the file's location into the include path, but doesn't for in-tree builds. Note: Parts of the original commit apply to source that has been moved to linux-nvidia.git; see change Icf4f94b671e73c0a889bb996edc3f15d5fbde98b for that part of the original rel-28 change. Bug 1978388 Change-Id: I907c88a4822b309a33c031ec21dd215047ea3e94 Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1544318 Reviewed-on: https://git-master.nvidia.com/r/1545674 Reviewed-on: https://git-master.nvidia.com/r/1546976 (cherry picked from linux-4.9 commit cc6281afdbe059734d53f54020f1ead0b5cf3659) Reviewed-on: https://git-master.nvidia.com/r/1770153 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: stop podgov polling when disabled through sysfsPeter Boonstoppel2018-07-05
| | | | | | | | | | | | | | | | | | | | | The pod governor allows scaling to be enabled/disabled through sysfs. In the current implementation the devfreq_monitor keeps polling periodically even when scaling is disabled. This patch disables the timer when scaling is disabled. NVGPU-20 Change-Id: I6842585afec48dbc9a2fe5aee96867c68612a127 Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-on: https://git-master/r/1485185 (cherry picked from linux-4.9 commit 96ebb9e97b84092a852274f90e214d3976944b78) Reviewed-on: https://git-master.nvidia.com/r/1770152 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: Clean up podgov parameter initializationPeter Boonstoppel2018-07-05
| | | | | | | | | | | | | | | | | | | | Remove support for VIC Remove checks for chipid Remove unused througput parameters Jira NVGPU-20 Change-Id: I806c5689df12ff742f1be577a25ecc1b194e5075 Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-on: https://git-master/r/1484197 (cherry picked from linux-4.9 commit 50ea795ac3224693b237445f2edd6d7296369576) Reviewed-on: https://git-master.nvidia.com/r/1770151 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: Use devfreq timers for podgovPeter Boonstoppel2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | The pod governor used to rely on being invoked from nvgpu on every gk20_busy/idle() call. This was done originally for load-tracking purposes. This change refactors the code to instead rely on devfreq's internal polling loop for calling the governor periodically. It also removes the idle timeout from the podgov code, since devfreq will keep polling even when the GPU is idle. Jira NVGPU-20 Change-Id: I767b74c250d199e3cd5f7e249a49736836a54c0d Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-on: https://git-master/r/1484196 (cherry picked from linux-4.9 commit 5a0a5adcd0bd6fabbff9818ed6adba79cd8242ef) Reviewed-on: https://git-master.nvidia.com/r/1770150 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: don't set last_scale for same freqDeepak Nibade2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In nvhost_pod_estimate_freq(), we have *freq = 0 in case we decide to keep same frequency In that case we set *freq as current frequency and then set last_scale timestamp This can result in keeping same frequency for long duration due to less delta from last_scale To fix this, return immediately in case *freq is zero and do not set last_scale timestamp Bug 200255163 Change-Id: Ie13bf54e2415c4016a101b9ea12a9abda83240fd Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1265185 Reviewed-on: http://git-master/r/1506359 (cherry picked from linux-4.9 commit be5331c94ebe9044cb67e3f622db517bfb7e28d4) Reviewed-on: https://git-master.nvidia.com/r/1770149 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: tegra: use soc/tegra/chip-id.h for soc headerTimo Alho2018-07-05
| | | | | | | | | | | | | | The soc tegra headers are unified and moved all the content of linux/tegra-soc.h to the soc/tegra/chip-id.h to have the single soc header for Tegra. Change-Id: I4c45721243574f5d9e533360538790a94eaa57de Signed-off-by: Timo Alho <talho@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1770148 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: remove throughput hints from podgovKonsta Holtta2018-07-05
| | | | | | | | | | | | | | | | | | | The CONFIG_TEGRA_THROUGHPUT-dependent throughput hint feature is dead, so remove the code from podgov that used it. Bug 1853519 Change-Id: Icb36eb0b2baa98757b3ce419080b43978384bbc9 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1454591 (cherry picked from linux-4.9 commit 96fcf87d98618ddf9a1e23a017294d201040859b) Reviewed-on: https://git-master.nvidia.com/r/1770147 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: set current freq in case no change requiredDeepak Nibade2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | API scaling_state_check() returns 0 in case no change in frequency is required In nvhost_pod_estimate_freq(), we set *freq to 0 in case scaling_state_check() returns 0 And as a result of this, update_devfreq() will just keep setting minimum frequency instead of keeping same frequency - and this results in huge performance degradation To fix this, set *freq to current frequency in case scaling_state_check() returns 0 as estimated frequency Bug 200255163 Change-Id: Ia8fe54dfd48b0898cc1dd53d821b1c95865b1f57 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1261281 (cherry picked from linux-4.9 commit 624718566201ce9c0b9780be6f29dc2ae9082b09) Reviewed-on: https://git-master.nvidia.com/r/1770146 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: remove FREQ_DONTSCALE return if same freqDeepak Nibade2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In nvhost_pod_estimate_freq(), we return GET_TARGET_FREQ_DONTSCALE if new frequency is same as current frequency And based on this return value, update_devfreq() will just return without actually calling target() function But it is possible that target() function has freq clipping of its own, and skipping target() itself will break this Hence in case we find new frequency same as current frequency, do not return GET_TARGET_FREQ_DONTSCALE Instead just return 0 Note that we still return GET_TARGET_FREQ_DONTSCALE if governor itself is disabled, and this is required in perf measurement cases Bug 200245796 Change-Id: I55a3a344982c5b5441ba011cd0dd254947e89e5c Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1251841 (cherry picked from linux-4.9 commit c6417ac88eb43501b8bf6d5351059ac2dadaf2c0) Reviewed-on: https://git-master.nvidia.com/r/1770145 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: wmark: fix compilation on kernel 4.4Mikko Perttunen2018-07-05
| | | | | | | | | | | | | | | | | | | The watermark devfreq governors were not building on kernel 4.4 due to a missing include of module.h Add the include. JIRA HOSTX-50 Change-Id: Ieebf5cd0bf6a0737e501423c1f182de5838f31a3 Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-on: http://git-master/r/1189446 (cherry picked from linux-4.9 commit e397f5ebd40c9f5114efdd0f6da7e189e51203a6) Reviewed-on: https://git-master.nvidia.com/r/1770144 GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: wmark: active: init average target freqShridhar Rasal2018-07-05
| | | | | | | | | | | | | | | | | | | | | - initializes average target freq parameter of active watermark governor parameter to current frequency set during start and resume from suspend. Bug 200165367 Change-Id: I56b43ea371c77e95285944433615660400da94ea Reviewed-on: http://git-master/r/936632 Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: http://git-master/r/1160862 (cherry picked from linux-4.9 commit 331b1f92e097209b3afd9ab92fe5337152c604e2) Reviewed-on: https://git-master.nvidia.com/r/1770143 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: Improvements watermark active policyArto Merilainen2018-07-05
| | | | | | | | | | | | | | | | | | | | | This patch modifies wmark active policy to... - track average frequency requirement - not scale too often - there is now 50ms hysteresis. Bug 1625576 Change-Id: I18afc5249a4821f62a0a58cdccd163e11763c841 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/719594 Reviewed-on: http://git-master/r/1160010 (cherry picked from linux-4.9 commit d451a28402cfee5bf393b44674b4a50a4321a131) Reviewed-on: https://git-master.nvidia.com/r/1770142 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: Improve wmark_active initializationArto Merilainen2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | | The wmark_active governor initialization assumes that the device frequency is the lowest possible frequency when the governor is started or resumed. However, this may not be correct if the governor was suspended/stopped before the clock had been slowed down. This patch modifies the governor to read the frequency during governor initialization and resume. Change-Id: I38d3256102b344bc8818c5623a015843678a8ce5 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/733007 Reviewed-on: http://git-master/r/1160009 (cherry picked from linux-4.9 commit 32e2561dffc5d7390fa4fd503651da9013403ecb) Reviewed-on: https://git-master.nvidia.com/r/1770141 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: Add Active Watermark governorArto Merilainen2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new watermark governor that actively alters the watermark values based on the current frequency and target load. The governor takes target load as a given property (80% by default) and every time when the governor re-estimation is triggered, the governor checks the current load and calculates the next frequency that would push the device as close this target load as possible. At this point also the watermark values are updated so that next time the interrupt should come when the load change is significant enough to cause frequency change to either next or previous frequency. Change-Id: I860a0bc984d55628a0e560652a93306616b080cf Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/598801 Reviewed-on: http://git-master/r/1160008 (cherry picked from linux-4.9 commit e55ba2a709574ce4f01ca2f8211393c795b75dad) [talho: removed Kconfig and Makefile changes from the patch] Signed-off-by: Timo Alho <talho@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1770140 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: Add debugfs interface to simple watermarkArto Merilainen2018-07-05
| | | | | | | | | | | | | | | | | This patch adds support to tune low and high watermark values in debugfs. Change-Id: I82056a5c1baa29df9e0389fda7d2bc2cc1771978 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/1160007 (cherry picked from linux-4.9 commit 69b139a5024dbe04daf9d22ac2a6493251846f12) Reviewed-on: https://git-master.nvidia.com/r/1770139 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: Rename watermark governorArto Merilainen2018-07-05
| | | | | | | | | | | | | | | | | | | | This patch renames watermark governor from "watermark" to "wmark_simple". This allows having more complex watermark based scaling algorithms available. Change-Id: If6a5653300f964173e6581bf256f7bf65041beb9 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/598799 Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: http://git-master/r/1160006 (cherry picked from linux-4.9 commit a47423f57343b9609341065350e399ada5d767d0) [talho: removed Kconfig and Makefile changes from patch] Signed-off-by: Timo Alho <talho@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1770138 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: governor_pod_scaling: Fix build errorsIshan Mittal2018-07-05
| | | | | | | | | | | | | | | | | | | | | | MODULE_LICENCE was not declared exit function didnt have an explicit return linux/module.h wasn't included because of which module_exit was throwing errors. Added the statement to do the same. Bug 200199306 Change-Id: Ib9e3a6f832b75095b9465dbe236a1f1c3606563f Signed-off-by: Ishan Mittal <imittal@nvidia.com> (cherry picked from linux-4.9 commit be9e41d39b8f9b6bbd716ea7a26ea7fdec54bad7) Reviewed-on: https://git-master.nvidia.com/r/1770137 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: compare previous_freq only if podgov disabledDeepak Nibade2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In update_devfreq(), we currently get target frequency, compare it with previous_freq, and set it only if new freq is different one But get_target_freq() (nvhost_pod_estimate_freq()) already takes care of such cases in normal conditions Hence, remove the check with previous_freq in update_devfreq() For case when we disable podgov governor, we might still end up setting max freq all the time Hence, add a check on previous_freq, and if previous_freq is already max, do not set it Bug 200175874 Bug 200161377 Change-Id: I287d37c07ee6214ed48612482211ce0f45088ca4 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1111437 Reviewed-on: http://git-master/r/1113417 (cherry picked from linux-4.9 commit 9c424ce31bedac5db0c2d93e083f20ea89ed1836) Reviewed-on: https://git-master.nvidia.com/r/1770136 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: get dev status after checking if scaling is enabledDeepak Nibade2018-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In nvhost_pod_estimate_freq(), we currently have below sequence - profile->get_dev_status() - check if (!podgov->enable) - check if (podgov->p_user) But in case we have podgov disabled, we unnecessarily call profile->get_dev_status() Hence, do all such checks before calling get_dev_status() Bug 200161377 Change-Id: I6128803c21bea6c5efefd517ea1c69e4f1b1597e Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/929508 Reviewed-on: http://git-master/r/933703 (cherry picked from linux-4.9 commit b8d1d439d206887c3cf4ff50119647b02efdae0e) Reviewed-on: https://git-master.nvidia.com/r/1770135 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* devfreq: tegra: add support for t18xSeshendra Gadagottu2018-07-05
| | | | | | | | | | | | | | | | | | Extend devfreq support for t18x Change-Id: I379110f9a1fb0b002b7224374f49a127929a635d Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/816897 Reviewed-on: http://git-master/r/828639 (cherry picked from linux-4.9 commit 4a43088268a3fe87b6208a77e806b4891226f9ff) Reviewed-on: https://git-master.nvidia.com/r/1770134 GVS: Gerrit_Virtual_Submit Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* video: tegra: host: move pod_scaling.cSam Payne2018-07-05
move pod_scaling.c from nvhost to devfreq bug 1645757 Change-Id: I0e905bf7e14aa264c4235ddfa94536acd5e4c008 Signed-off-by: Sam Payne <spayne@nvidia.com> Reviewed-on: http://git-master/r/743942 Reviewed-on: http://git-master/r/756665 (cherry picked from linux-4.9 commit 80a8f5a341351c3973aee12fe1615785bcf8d6ee) Reviewed-on: https://git-master.nvidia.com/r/1770133 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com> Tested-by: Timo Alho <talho@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>