Commit Graph

29 Commits

Author SHA1 Message Date
shu.wang 8ed61483c9 dvfs: Fix the problem of system crash when A1 loads cpufreq.ko [1/1]
PD#SWPL-181678

Problem:
The wrong pointer was manipulated when setting the voltage,
causing a crash when loading cpufreq.ko

Solution:
Modified to determine the validity of the incoming pointer and
cpufreq_Voltage_set_skip flag before the pointer assignment operation.

Verify:
A1-AD403

Change-Id: Ic4d65a03b9befc05b29b853295979f41e102f612
Signed-off-by: shu.wang <shu.wang@amlogic.com>
2024-08-18 22:57:12 -07:00
Xingxing Wang 1aff77b574 cpufreq: do not add dsu voltage to dsuopp table when cluster has no dsureg [1/1]
PD#SWPL-177709

Problem:
dsuopp table contains dsu voltage even cluster has no dsureg

Solution:
1.do not config and parse dsu voltage when cluster has no dsureg
2.configure one dsu opp table if cluster has no dsureg

Verify:
S6&S7D

Change-Id: I66c02f898e0df8c849f70b0362ab0fc5e1dff2e1
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2024-08-18 22:56:44 -07:00
Xingxing Wang 1b5d8c23f5 cpufreq: coverity clean of cpufreq driver [1/1]
PD#SWPL-168345

Problem:
Passing null pointer "policy" to "cpufreq_generic_suspend",
which dereferences it

Solution:
add null pointer checking

Verify:
kernel5.15

Change-Id: I7f7f44fedd7b01c9f201421eff38ba2972e95ae1
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2024-05-30 06:03:55 -07:00
Chuan Liu 7bde3bb83b clk: s7d: Fix clock issue [1/1]
PD#SWPL-163050

Problem:
1 The parent of cecb and hcodec is incorrect
2 The vclk2_div register is incorrectly defined
3 no glitch mux does not work properly under certain circumstances

Solution:
1 Fixed
2 Fixed
3 Add CLK_OPS_PARENT_ENABLE to mux whose model is no glitch mux to
ensure that mux0 is enabled during mux switchover

Verify:
s7d_bm209

Change-Id: Ib78e899f7f1a93e1b9db6860c093dd28f1246491
Signed-off-by: Chuan Liu <chuan.liu@amlogic.com>
2024-04-17 19:31:21 +08:00
Xingxing Wang 1b1b663920 cpufreq: s7d dvfs bringup [1/1]
PD#SWPL-163073

Problem:
S7D Silicon Bringup - Kernel - Power management - DVFS

Solution:
dvfs bringup

Verify:
S7D

Change-Id: I1dd28b70f934ccc9f1c377dadc370971d705be2e
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2024-04-17 19:31:21 +08:00
Xingxing Wang 7c82d3f88c cpufreq: suspend frequency unit err [1/1]
PD#SWPL-152425

Problem:
cpu suspend frequency error

Solution:
correct cpu suspend frequecy

Verify:
S7 BH201

Change-Id: I752e128ff24cf31094da84cdaed87b5b38e5371f
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2024-01-22 12:48:45 +08:00
Xingxing Wang 6afb050abf cpufreq: dvfs bringup of s7 [1/1]
PD#SWPL-152425

Problem:
s7 dvfs bringup

Solution:
use dvfs v2 to bringup s7

Verify:
s7 skt

Change-Id: Ic1499df11129da0b553d565c165bddffcb53acf8
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2024-01-22 12:48:45 +08:00
Shunzhou Jiang 9d428a3f3b cpufreq: add online/offline interface [1/1]
PD#SWPL-139891

Problem:
cpufreq exit regulator put execute in suspend caused netlink
wakeup source count increase

Solution:
add online offline interface
when suspend, do cpufreq offline
when resume, do cpufreq online

Verify:
T7C/T3X

Change-Id: Ib0cc4bba379f8e0ac2ebd82f110c4a515f371c2f
Signed-off-by: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
2024-01-02 22:08:28 -07:00
Xingxing Wang bc0b81bb65 dvfs: use policy->related_cpus to register energy model [1/1]
PD#SWPL-142621

Problem:
crash in dvfs cooling device for cpu1 is not online for rtos boot.

Solution:
1.in cpufreq cooling device register flow, we will assign energy model
to cooling device only when policy->related_cpus equal to em->cpus.
2.we need to use policy->related_cpus to register energy model.

Verify:
t7c

Change-Id: Ia0d1d1ee8422c801a477398504b199d266a9d97c
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2023-10-19 06:09:08 -07:00
Shunzhou Jiang d3b47c5f6b Revert "cpufreq: fix cluster1 voltage scaling issue [1/1]"
PD#SWPL-139891

Problem:
cpufreq regulator init and exit count not match

Solution:
let regulator init and exit match

Verify:
t7c

Change-Id: I78c3a82b8b487a6f4eef391bd582148cc061c815
Signed-off-by: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
2023-09-25 00:14:06 -07:00
Shunzhou Jiang a044573c79 cpufreq: fix cluster1 voltage scaling issue [1/1]
PD#SWPL-139891

Problem:
cpufreq regulator init and exit count not match

Solution:
let regulator init and exit match

Verify:
AX201-S928X

Change-Id: Ia182a59c2b3cee7175607a03605e90d53f2c4b39
Signed-off-by: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
2023-09-19 03:58:48 -07:00
Dezhen Wang dadc15697a coverity: fix [1/1]
PD#SWPL-136722

Problem:
coverity errors

Solution:
fix the coverity errors

Verify:
local

Change-Id: I5b210b5c44ee6a0e34c1c8b9685fe2d38cd52b1b
Signed-off-by: Dezhen Wang <dezhen.wang@amlogic.com>
2023-09-03 21:53:42 -07:00
Xingxing Wang 5778c4917a dvfs: /sys/kernel/debug/kmemleak scan leakage issue in dvfs driver [1/1]
PD#SWPL-137629

Problem:
memleak in dvfs driver

Solution:
add kfree code at the right place

Verify:
s1a

Change-Id: I5b1b66078d7c5c8b439b4746a835f2d1a9310ead
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2023-08-27 23:03:54 -07:00
Hanjie Lin 0c20aadef6 cpufreq: unregister driver when reboot [1/1]
PD#SWPL-123773

Problem:
t3x/t5m isolated cpuX for APU, offline cpus flow may
cause sched_cpu_deactivate fail when cpuX offline.

Solution:
unregister cpufreq driver when reboot, then no sugov/deadline
tasks exsit.

Verify:
t3x

Change-Id: Ic3962c86582f6507dfffdce3f235910597b323c7
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-06-20 01:52:23 -07:00
Xingxing Wang 54a47b3b71 dvfs: align cpu frequency in big little clusters [1/1]
PD#SWPL-119769

Problem:
cpu frequency too large to keep performance

Solution:
1.if one cluster runs at max freq, the other cluster keep
freq above 1G
2.align opp-table to kernel4.9(remove 100M&250M)

Verify:
g12b

Change-Id: I8fc30d04526d1cefbe585c9917eaa7018da5db56
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2023-06-06 20:58:48 -07:00
shu.wang 6247f8679e dvfs: A1 kernel5.15 Loading amlogic-cpufreq.ko crash [1/1]
PD#SWPL-121024

Problem:
A1 kernel5.15 Loading amlogic-cpufreq.ko crash

Solution:
1.Add return error code when cpu regulator is not found.
2.skip regulator checking when cpufreq_voltage_set_skip is configured.

Verify:
A113L-AD403

Change-Id: I0c1fd610ab7839cca847cd91d89a4f94c13c75e5
Signed-off-by: shu.wang <shu.wang@amlogic.com>
2023-05-14 20:21:54 -07:00
Xingxing Wang 5e19f7ff23 dvfs: s5 5.15 dvfs bringup [1/1]
PD#SWPL-108722

Problem:
Kernel5.15: S5 Bringup - Power - CPUFREQ driver

Solution:
config dvfs in dts

Verify:
S5 AX201

Change-Id: I54351d15115fd72efafabb0b1942291d9e9b3ee3
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2023-04-15 08:59:04 +08:00
Xingxing Wang d4db60d198 dvfs: reboot panic result from missing NULL pointor checking [1/1]
PD#SWPL-105422

Problem:
reboot panic

Solution:
add NULL pointor checking in suspend callback

Verify:
SC2

Change-Id: I42fdf4ee0186acf2ff9d493bcea6a535508ac1a9
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2022-12-13 04:25:04 -08:00
Xingxing Wang be33fc93a3 dvfs: skip uevent of cooling device after suspend [1/1]
PD#SWPL-102556

Problem:
suspend fail

Solution:
drop uevent after suspend

Verify:
T7C

Change-Id: I922bd1b0490b3a1bb60f2cb2834ce4f78b557cc2
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2022-12-05 21:08:21 -07:00
Liming Xue 61fff05790 Typo Check: dsp and thermal wrong words [1/1]
PD#SWPL-103829

Problem:
there are words spelling error

Solution:
correct spelling mistakes

Verify:
local scan

Change-Id: Ifc0bf977d64ceed2ae67a3235077fc9d4c734f0e
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2022-12-05 21:08:18 -07:00
Xingxing Wang 405d1b19ac dvfs: there is no cluster proc file when replug in cpus of the cluster [1/1]
PD#SWPL-96045

Problem:
there is no cluster proc file when replug in cpus of the cluster

Solution:
move proc file create interface from register_em to init callback

Verify:
T7C

Change-Id: Iefd070545df1843c6983ccbb73c1fde834b8afd3
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2022-12-02 14:04:55 +08:00
Xingxing Wang 6d3073b8cc dvfs: add cpufreq limit configure in bootargs [1/1]
PD#SWPL-98851

Problem:
Support the boot parameter to configure the maximum operating
frequency of the CPU

Solution:
add cpufreq limit configure in bootargs

Verify:
C3 AW419

Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
Change-Id: Ic5ad5931854d48ae42f39c9d07fab6c66e112497
2022-10-27 23:06:03 -07:00
pengzhao.liu b946ffb848 typo: clear typo problem [1/1]
PD#SWPL-89627

Problem:
clear typo problem

Solution:
clear typo problem

Verify:
s4d

Signed-off-by: pengzhao.liu <pengzhao.liu@amlogic.com>
Change-Id: I9121c9d4b54df9b9a7c244182693e0fd616f5a9e
2022-09-07 20:06:45 +08:00
Xingxing Wang 0ca6c8f7bf dvfs: c3 dvfs bringup [1/1]
PD#SWPL-83856

Problem:
C3 Silicon Bringup - Kernel - Power management - DVFS

Solution:
config dvfs in dts

Verify:
C3 AW419

Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
Change-Id: I3e88dd68f24214545749c12489e22036916fb33b
2022-06-30 18:09:28 +08:00
Jian Hu 5176ebdee7 dvfs: fix clock warning when first scaling from high rate to low [1/1]
PD#SWPL-83545

Problem:
there is warning when cpufreq scaling from 1200M to 512M

Solution:
sync sys pll enable count

Verify:
a1

Change-Id: Ie974e7d10abdb60fec15ab776fa522c143477b61
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
2022-06-06 09:50:56 +08:00
Xingxing Wang 3e46c5c887 dvfs: enable dvfs of A1 on k5.15 [1/1]
PD#SWPL-77424

Problem:
kernel5.15 for A1:CPUFREQ driver

Solution:
enable in dts

Verify:
A1 ad401

Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
Change-Id: I86034ac14d96402776e8ffd6c0d8022cad231e39
2022-05-13 02:53:10 -07:00
qinglin.li 7c6316bebd printk : printk optimization [2/2]
PD#SWPL-70486

Problem:
use common tag in driver when printf

Solution:
set common pr_fmt in driver

Verify:
s4d

Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
Change-Id: Ieee271d289e4d2f81258875d36288046b996a5d2
2022-02-14 19:55:32 -07:00
wanwei.jiang 6772e3cf9f cpufreq: support cpufreq driver for c2 [1/1]
PD#SWPL-70938

Problem:
support cpufreq driver for c2

Solution:
support cpufreq driver for c2

Verify:
C2 Af400

Change-Id: I8ccb7bc3e38a898d9d12406e8f66c9a7678a81e5
Signed-off-by: wanwei.jiang <wanwei.jiang@amlogic.com>
2022-01-21 15:53:41 +08:00
wanwei.jiang 8751d93d08 cpufreq: porting cpufreq driver [1/1]
PD#SWPL-67706

Problem:
porting cpufreq driver

Solution:
1. porting cpufreq driver
2. depends on pwm-regulator, so set CONFIG_REGULATOR_PWM to m

Verify:
s4d

Signed-off-by: wanwei.jiang <wanwei.jiang@amlogic.com>
Change-Id: I9ca89af7fd3fe084a54ff05dee5500fcc82d212f
2021-12-30 10:01:59 +08:00