Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
odroid-linux-3.10.y-rt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oai
odroid-linux-3.10.y-rt
Commits
754172e0
Commit
754172e0
authored
Nov 03, 2015
by
Mauro Ribeiro
Committed by
Gerrit Code Review
Nov 03, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "exynos: thermal: show throttle counters." into odroidxu3-3.10.y
parents
87a3c28f
bf33772f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
4 deletions
+42
-4
drivers/thermal/exynos_thermal.c
drivers/thermal/exynos_thermal.c
+42
-4
No files found.
drivers/thermal/exynos_thermal.c
View file @
754172e0
...
...
@@ -226,6 +226,8 @@ static enum mif_noti_state_t mif_old_state = MIF_TH_LV1;
static
bool
is_suspending
;
static
bool
is_cpu_hotplugged_out
;
static
unsigned
long
ctmu_normal
,
ctmu_cold
,
ctmu_hot
,
ctmu_critical
,
throttle_cpu
;
static
BLOCKING_NOTIFIER_HEAD
(
exynos_tmu_notifier
);
static
BLOCKING_NOTIFIER_HEAD
(
exynos_gpu_notifier
);
...
...
@@ -540,18 +542,35 @@ static void exynos_check_tmu_noti_state(int min_temp, int max_temp)
enum
tmu_noti_state_t
cur_state
;
/* check current temperature state */
if
(
max_temp
>
HOT_CRITICAL_TEMP
)
if
(
max_temp
>
HOT_CRITICAL_TEMP
)
{
cur_state
=
TMU_CRITICAL
;
else
if
(
max_temp
>
HOT_NORMAL_TEMP
&&
max_temp
<=
HOT_CRITICAL_TEMP
)
ctmu_critical
++
;
}
else
if
(
max_temp
>
HOT_NORMAL_TEMP
&&
max_temp
<=
HOT_CRITICAL_TEMP
)
{
cur_state
=
TMU_HOT
;
else
if
(
max_temp
>
COLD_TEMP
&&
max_temp
<=
HOT_NORMAL_TEMP
)
ctmu_hot
++
;
}
else
if
(
max_temp
>
COLD_TEMP
&&
max_temp
<=
HOT_NORMAL_TEMP
)
{
cur_state
=
TMU_NORMAL
;
else
ctmu_normal
++
;
}
else
{
cur_state
=
TMU_COLD
;
ctmu_cold
++
;
}
if
(
min_temp
<=
COLD_TEMP
)
cur_state
=
TMU_COLD
;
/* Just to check for overflow */
if
(
ctmu_critical
>=
ULONG_MAX
)
ctmu_critical
=
0
;
if
(
ctmu_hot
>=
ULONG_MAX
)
ctmu_hot
=
0
;
if
(
ctmu_normal
>=
ULONG_MAX
)
ctmu_normal
=
0
;
if
(
ctmu_cold
>
ULONG_MAX
)
ctmu_cold
=
0
;
if
(
throttle_cpu
>
ULONG_MAX
)
throttle_cpu
=
0
;
exynos_tmu_call_notifier
(
cur_state
,
max_temp
);
}
...
...
@@ -666,6 +685,7 @@ static int __ref exynos_throttle_cpu_hotplug(struct thermal_zone_device *thermal
* If current temperature is lower than low threshold,
* call big_cores_hotplug(false) for hotplugged out cpus.
*/
throttle_cpu
++
;
ret
=
big_cores_hotplug
(
false
);
if
(
ret
)
pr_err
(
"%s: failed big cores hotplug in
\n
"
,
...
...
@@ -679,6 +699,7 @@ static int __ref exynos_throttle_cpu_hotplug(struct thermal_zone_device *thermal
* If current temperature is higher than high threshold,
* call big_cores_hotplug(true) to hold temperature down.
*/
throttle_cpu
++
;
ret
=
big_cores_hotplug
(
true
);
if
(
ret
)
pr_err
(
"%s: failed big cores hotplug out
\n
"
,
...
...
@@ -1778,8 +1799,25 @@ exynos_thermal_sensor_temp(struct device *dev,
static
DEVICE_ATTR
(
temp
,
S_IRUSR
|
S_IRGRP
,
exynos_thermal_sensor_temp
,
NULL
);
static
ssize_t
exynos_throttle_counter
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
int
len
=
0
;
len
+=
snprintf
(
&
buf
[
len
],
PAGE_SIZE
,
"TMU_NORMAL :%ld
\n
"
,
ctmu_normal
);
len
+=
snprintf
(
&
buf
[
len
],
PAGE_SIZE
,
"TMU_COLD :%ld
\n
"
,
ctmu_cold
);
len
+=
snprintf
(
&
buf
[
len
],
PAGE_SIZE
,
"TMU_HOT :%ld
\n
"
,
ctmu_hot
);
len
+=
snprintf
(
&
buf
[
len
],
PAGE_SIZE
,
"TMU_CRITICAL :%ld
\n
"
,
ctmu_critical
);
len
+=
snprintf
(
&
buf
[
len
],
PAGE_SIZE
,
"THROTTLE_CPU :%ld
\n
"
,
throttle_cpu
);
return
len
;
}
static
DEVICE_ATTR
(
throttle
,
S_IRUGO
,
exynos_throttle_counter
,
NULL
);
static
struct
attribute
*
exynos_thermal_sensor_attributes
[]
=
{
&
dev_attr_temp
.
attr
,
&
dev_attr_throttle
.
attr
,
NULL
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment