Commit graph

7 commits

Author SHA1 Message Date
Sharat Masetty
a2d4f1e7f9 devfreq: Fix possible race in tz_start() handler
The TZ governor start can be invoked through the sysfs governor store()
operation. This opens up a possible race when user space tries to set
the same governor operation twice  leading to calling the TZ governors
tz_handler() in succession. While the first one goes through
successfully and queues the work for starting the bandwidth governor,
before the work gets to run, the second invocation of the tz_handler
reinitializes the work. This causes the internal state of the work item
to be reset causing a crash in the kernel workqueue handler.

This patch tries to address this problem by not allowing the
tz_handler() to run the next time, if the first invocation was already
successful and potentially in progress.

Change-Id: Id2d6b9f680c873937a64eeb483ce8359306cd7b0
Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
2020-04-01 10:55:53 +05:30
Harshdeep Dhatt
1f6bfc5a45 devfreq: Restrict gpu governors to gpu devfreq devices
These governors should fail if being set for any device
other than the gpu device. Do this by checking that the
devfreq device for which this governor is being set for
has the gpu device as it's parent device.

The vbif_bw governor immutable attribute is used
to restrict it being set for only gpu devfreq devices.
Because we don't intend to change the governor for
the devfreq devices which have this governor set as
default.

Change-Id: I391557c0d52a1f4ffba70e010401a0769587dea0
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2019-11-26 14:12:54 -07:00
Deepak Kumar
90365a0309 adreno_tz: Fix compilation errors for 32bit kernel
This fixes below compilation error for 32bit kernel
build. Compiler reference __aeabi_uldivmod if there
is a 64bit divide or module. Change is to use do_div
to fix this.

governor_msm_adreno_tz.c: undefined reference to `__aeabi_uldivmod'.

Change-Id: I4de7ada2274698d20d304d8ffe1a92d3bcb7653d
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2019-10-22 12:31:37 +05:30
Harshitha Sai Neelati
15b395bdf9 adreno_tz: Correct acc_relative_busy calculation
Current acc_relative_busy calculation is causing integer overflow
in 32 bit system. "stats->busy_time * stats->current_frequency"
results in a value which is beyond the 32 bit range.

Typecasting the value to u64 to avoid overflow.

Change-Id: Id97da02bef608787ceb7c9751bbfc203af56deb1
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
2019-09-20 16:58:10 +05:30
Harshdeep Dhatt
c05377299b devfreq: Use devfreq_update_stats for gpu governors
This is the recommended way of using the devfreq api from
within governors. The devfreq_update_stats() will utilize the
devfreq.last_status to get the target device status so we no
longer need to declare a local variable to get the target
status.

Change-Id: I5d80e39468e3eb90e55dcb0a813cb846a65ee8a5
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2019-07-15 17:12:39 -06:00
Urvashi Agrawal
efcac5e453 msm: kgsl: Use SHM bridge APIs to register buffer with TZ
Instead of directly allocating memory and registering the
buffers to TZ, use SHM bridge to allocate buffers and
register those buffers to TZ.

Change-Id: Ibdc5a66af432f1fb2c8813b0b3578503f404eefc
Signed-off-by: Urvashi Agrawal <urvaagra@codeaurora.org>
Signed-off-by: Raghu Ananya Arabolu <rarabolu@codeaurora.org>
2019-05-01 23:00:30 -07:00
Urvashi Agrawal
0389e5ba59 msm: kgsl: Add GPU bus governor from 4.14 to 4.19
Adding a snapshot of the devfreq files on 4.14 as of
commit 9ac69cf (clk: qcom: gcc: Support code for clock
controller for sdxprairie).

Change-Id: Ib9491280c14f0ec0ff1c3b34aba5ce1e4f510b54
Signed-off-by: Urvashi Agrawal <urvaagra@codeaurora.org>
2019-01-22 12:53:54 -08:00