Commit Graph

81 Commits

Author SHA1 Message Date
song.han 4e675645ef debug: lockup and panic flow optimize [1/1]
PD#SWPL-144359

Problem:
add debug feature

Solution:
show sysrq't' when rcu stall panic
fiq dump other cpu stack when hardlockup panic
improve watchdog panic notifier priority
disable watchdog when set panic_print

Verify:
s4

Change-Id: I6af43456105a3cf802d54608d62cbb25d327a73e
Signed-off-by: song.han <song.han@amlogic.com>
2023-11-06 14:42:38 +08:00
Jianxiong Pan 1f6599c5fd zapper: rename CONFIG_AMLOGIC_ZAPPER_CUT_C1A. [1/1]
PD#SWPL-140594

Problem:
rename CONFIG_AMLOGIC_ZAPPER_C1A.

Solution:
CONFIG_AMLOGIC_ZAPPER_CUT_C1A.

Verify:
build pass.

Test:
run on s1a board normally.

Change-Id: I3a8ab8d81af2c4d14b51c117ac16d75f3980adac
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
2023-10-09 20:08:39 +08:00
Lei Zhang 8aa540b7c9 revert "softirq: not check if CPU has a RT task" [1/1]
PD#SWPL-115695

Problem:
softirq be processed in ksoftirqd

Solution:
not check if CPU has a RT task

Verify:
on T3

Change-Id: Id64d6b284f66a1c079d06acde06503b544360965
Signed-off-by: Lei Zhang <lei.zhang@amlogic.com>
2023-09-21 20:52:20 +08:00
song.han e2ab106c2c iotrace: record module base on last start [1/1]
PD#SWPL-136207

Problem:
use kprobe to forbid free module init text

Solution:
record module base and use offset to parse
this module symbol

Verify:
SC2_AH212

Change-Id: I43bd306e94e9a6a5afe6411a9cd9e93db0342b7a
Signed-off-by: song.han <song.han@amlogic.com>
2023-09-19 20:09:48 +08:00
qiankun.wang 051f9dd9dc arm64: traps: optimize do_undefinstr print [1/1]
PD#SWPL-136432

Problem:
Native code will perform the 'BUG_ON' process,
and the log isn't favorable for debug.

Solution:
add the vendor hook function to perform the
'show_regs' and 'panic'.

Verify:
T3

Change-Id: I7a0f2c10b5db8ed10207d1fcbc7cc214054c7ae3
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-09-18 20:18:49 +08:00
qiankun.wang d33a365eea reg_detect: postpone the call of 'ioremap'. [1/1]
PD#SWPL-139674

Problem:
the system can't run 'ioremap' without
the Buddy system.

Solution:
set the variable 'check_reg_flag' to
postpone the function call 'ioremap'.

Verify:
T5M

Change-Id: Ieee33ff37a54037e3a3d1c258b127e1cbcd83b5a
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-09-14 21:17:29 +08:00
dongqing.li fee7ee35f1 ramdump: ker5.15 flush cache all when kernel panic. [1/1]
PD#SWPL-137107

Problem:
The data in the ramdump crash file is abnormal
because the cache data has not been flushed back.

Solution:
1. Use ipi_stop hook to flush online cpu cache.
2. Use panic_notifier to flush panic cpu cache.

Verify:
sc2_ah212

Change-Id: Ifad5bd4203fdde327b8c2b19357aa2d92586063f
Signed-off-by: dongqing.li <dongqing.li@amlogic.com>
2023-09-13 16:15:37 +08:00
qinglin.li 9d3b531cb4 break_gki: adjust break gki config [2/2]
PD#SWPL-137861

Problem:
adjust break gki config

Solution:
CONFIG_AMLOGIC_BREAK_GKI_20 only break gki2.0
CONFIG_AMLOGIC_BREAK_GKI break gki 1.0 and 2.0

Verify:
local

Change-Id: Ic86c771027980aa24c638d5f89c014240d65ec91
Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
2023-09-05 20:43:25 +08:00
Jianxiong Pan b75016a67d zapper: remove c1a relate code. [1/1]
PD#SWPL-126879

Problem:
memory optimization.

Solution:
remove c1a relate code.

Verify:
s1a.

Test:
run on s1a board normally.

Change-Id: Idbd24a529666278295724f26d10f1a720877ca6a
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
2023-08-15 20:09:03 -07:00
Hanjie Lin 875fa4747f isolcpus: add amlogic support and boot optimize [1/1]
PD#SWPL-119598

Problem:
system is too slow because the cpu5 is turned off
at system startup.

Solution:
turn on the cpu5 at system startup.

Verify:
SC2

Change-Id: I738fccb70c96d6495b314fa51cf319d5800c75a0
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-08-09 21:58:46 -07:00
qiankun.wang f5412875b9 secmon: modify the wrong config [2/2]
PD#SWPL-135009

Problem:
The config 'CONFIG_AMLOGIC_SEC' has been
converted to CONFIG_AMLOGIC_SECMON.

Solution:
delete the config 'CONFIG_AMLOGIC_SEC',and
add the config 'CONFIG_AMLOGIC_SECMON'.

Verify:
SC2

Change-Id: I664ce36b86af24ff3e92adcf31f6149ecf381dcb
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-08-09 04:29:35 -07:00
song.han e7971b4f06 smc: do not disable preempt with noret smc [1/1]
PD#SWPL-133116

Problem:
noret smc no need to disable preempt

Solution:
do not disable preempt with noret smc

Verify:
s1a_bg209

Change-Id: I0e6faa45b19a4269fe24dc003cce34f816fc9083
Signed-off-by: song.han <song.han@amlogic.com>
2023-08-04 02:18:50 -07:00
Hanjie Lin b257fa1e5d debug: GKI20 clean [2/6]
PD#SWPL-132209

Problem:
GKI20 code clean

Solution:
1, clean irq_check function
2, clean smc_thr and psci smc
3, clean AMLOGIC_BGKI_DEBUG_IOTRACE
4, clean CONFIG_AMLOGIC_BGKI_DEBUG_MISC
5, restore trace_android_vh_ftrace_format_check
6, sched_show_task optimize
7, change cpupri_check_rt kretprobe to kprobe
8, iotrace dump use unbound workqueue

Verify:
sc2

Change-Id: Idcdf9010cfd960b80c493e58b3c81bec8468ac84
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-07-25 22:16:21 -07:00
Jianxiong Pan e61f35dc14 zapper: memory optimization about usb3, defconfig. [2/2]
PD#SWPL-126879

Problem:
memory optimization.

Solution:
disable usb3
delete useless config

Verify:
t215.

Change-Id: Ie23b7cd2e1ca96100a2534928293d8211917622a
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
2023-07-05 21:03:06 -07:00
qiankun.wang 0335d01014 iotrace: save register value in IO-R-E [1/1]
PD#SWPL-129901

Problem:
IO-R-E can't read the register's data.

Solution:
when the "read" action is over, the hook function
will get the value from the action.

Verify:
SC2

Change-Id: I12426209bf92e5c242022041e01ed6a7711808dc
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-06-29 06:56:16 -07:00
qiankun.wang 52a028cac6 ramoops: don't parse ftrace buf when shutdown or cold boot [1/1]
PD#SWPL-128460

Problem:
system shutdown reboot or cold boot,parse ftrace old buf
will cause kernel crash

Solution:
skip parse ftrace old buf when shutdown reboot or cold
boot

Verify:
SC2

Change-Id: Ib2580c0206b97461389369d587f2266a8b3836f2
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-06-28 06:58:47 -07:00
Lei Zhang 4eac904433 debug: optimize log print [1/1]
PD#SWPL-125874

Problem:
log print deranged when use pr_cont

Solution:
optimize log print

Verify:
on SC2

Change-Id: If71749e1cb88dd19836869b84d86327b86ef0b17
Signed-off-by: Lei Zhang <lei.zhang@amlogic.com>
2023-06-14 18:21:04 -07:00
qiankun.wang b6ed5e8381 iotrace: fix reg error [1/1]
PD#SWPL-127124

Problem:
system will record the register twice rather
than the register and the value.

Solution:
record the value

Verify:
SC2

Change-Id: I5de33f780475b2ac3ebeac8c2dfea779900875ce
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-06-13 01:00:39 -07:00
Hanjie Lin 3fcef5de34 kretprobes: disable irq in ret handler [2/3]
PD#SWPL-121806

Problem:
ret handler running in origin task context with preempt_disable
it's not safe for interrupt and may cause nested kprobe and miss

Solution:
disable irq in ret handler
add AMLOGIC_BGKI_KPROBES

Verify:
sc2

Change-Id: I143e874336d87b143d1607b8e9a7588f84d7bc55
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-06-13 01:00:25 -07:00
qiankun.wang 019db657be iotrace: add reg detect [1/1]
PD#SWPL-127124

Problem:
register was accidentally modified by unknown program

Solution:
add reg detect func when write reg

Verify:
SC2

Change-Id: Ia5db45839a7f69fc819e7cfc9843a4e6503ebce9
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-06-12 00:48:11 -07:00
qiankun.wang e6045d91cd sched: vts: vts_kernel_proc_file_api_test [1/2]
PD#SWPL-124519

Problem:
vts_kernel_proc_file_api_test module 3 fail.

Solution:
add 3 proc file interfaces 'sched_latency_ns',
'sched_wakeup_granularity_ns',
'sched_tunable_scaling'.

Verify:
SC2

Change-Id: I88e8d7a91db601d1b1cb773d15583fabe7021a07
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-05-29 23:40:57 -07:00
qiankun.wang 73edbb1b97 debug: arm: fix compile error with --upgrade [1/1]
PD#SWPL-118595

Problem:
'./mk.sh --arch arm --upgrade', an error
occurred during compilation.

Solution:
add a header file and change the function
name.

Verify:
SC2

Change-Id: I660a1d196f4216f0fa48b8ce7c59f2874d7e1a92
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-05-21 19:02:52 -07:00
Wanwei Jiang 4573701caa audio_utils: optimize exception handling [1/1]
PD#SWPL-123408

Problem:
reboot testing will result in kernel panic

Solution:
1. modify kmap_atomic to kmap and kumap_atomic to kunmap
2. optimize exception handling

Verify:
sc2

Change-Id: I37e043cedcf08191de6e5b86d516f24386cf8533
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2023-05-12 03:55:52 -07:00
Hanjie Lin 03454cd6d9 smp: add APU support [2/2]
PD#SWPL-119162

Problem:
APU should not be seen except audio

Solution:
add APU support

Verify:
t5m

Change-Id: I0c4267b362f3d0bf398484b2318c88bdf0b00588
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-05-08 02:30:25 -07:00
qiankun.wang 9cf5f36fb8 debug: support FIQ dump debugging when hard lockup. [1/1]
PD#SWPL-118595

Problem:
FIQ dump debugging when hard lockup
TV-60426

Solution:
Support FIQ dump debugging when hard lockup

Verify:
SC2

Change-Id: Ie68d4411e0f714cc04c657d9c5d625c4797cb7a2
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-05-06 01:35:15 -07:00
song.han f411bfdab1 iotrace: hook regmap r/w reg when iotrace ko [1/1]
PD#SWPL-119464

Problem:
when iotrace driver build to ko, it has some register r/w
operation not be hooked

Solution:
hook regmap r/w operation when iotrace build to ko

Verify:
SC2_AH212

Change-Id: I763b90fd91e76e5d4138db8ad1d2268c5b33e873
Signed-off-by: song.han <song.han@amlogic.com>
2023-05-03 22:52:30 -07:00
Wanwei Jiang 9b2038bba3 audio: exception handling and optimization log [1/1]
PD#SWPL-121815

Problem:
exception handling and optimization log

Solution:
exception handling and optimization log

Verify:
local

Change-Id: Ife94f13be53fd7791d9492f8272bda9576328407
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2023-04-28 14:48:52 -07:00
Jianxin Pan 11155146ab zapper: remove unused code of media module. [1/1]
PD#SWPL-116862

Problem:
media module memory optimization.

Solution:
disable the unused code for zapper.
reduce vmalloc used size from 17324k to 12556k.

Verify:
t215.

Test:
play video normally.

Change-Id: Iaa4c95c6641d76f80a11493c5c84f624cdac6424
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2023-04-27 21:24:07 -07:00
qiankun.wang c514cc75a9 watchdog: change the interface address [1/1]
PD#SWPL-121006

Problem:
The use of interface that actively triggers
HardLockup is too complex.

Solution:
The interface is 'sysrq-trigger', and in
/sys/kernel/debug/aml_debug/,you can echo
x to this parameter to panic.

Verify:
SC2

Change-Id: Ia49b08dbd9e2fe458d463e79e19cfc438b75b26f
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-04-27 02:51:01 -07:00
song.han 820797e318 iotrace: add ramoops_io_dump support [1/1]
PD#SWPL-119464

Problem:
add ramoops_io_dump support

Solution:
add ramoops_io_dump bootargs to support dump iotrace log

Verify:
SC2_AH212

Change-Id: Ie0eef9bf2cb269f82d2d01872d2515695666bb15
Signed-off-by: song.han <song.han@amlogic.com>
2023-04-25 06:28:18 -07:00
Jianxiong Pan fedeacaae5 kconfig: enable amlogic env debug. [1/1]
PD#SWPL-116862

Problem:
accidentally turned off the env debug config.

Solution:
enable amlogic env debug config.

Verify:
build pass.

Change-Id: I03d4e6fb79b0b6a8835f4d54b3d3b9b6f2664fd8
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
2023-04-20 23:10:58 -07:00
song.han 29925ebc8a debug: iotrace driver follow gki 2.0 [2/2]
PD#SWPL-109963

Problem:
iotrace driver need follow gki 2.0

Solution:
iotrace driver build to ko

Verify:
sc2_ah212

Change-Id: I472bc63b6594c58d7c94f74e1bf1a070978b20fd
Signed-off-by: song.han <song.han@amlogic.com>
2023-04-20 06:15:21 -07:00
Jianxin Pan e1710a5aa6 zapper: remove zapper unused. [1/1]
PD#SWPL-116862

Problem:
memory optimization for zapper.

Solution:
remove zapper unnecessary code in the media module.

Verify:
t215.

Change-Id: I835a52262ff8e68d744b051507ba9fdbd4b279d9
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2023-04-19 03:15:57 -07:00
Dezhen Wang 40f4e2261e init: dump env/args if too many [1/2]
PD#SWPL-119265

Problem:
kernel will panic if too many boot args

Solution:
dump them for debug

Verify:
t7

Change-Id: Ib78ee8d997836f02df0d4f8092c87435d4b15e29
Signed-off-by: Dezhen Wang <dezhen.wang@amlogic.com>
2023-04-17 19:25:18 -07:00
Lei Zhang 5da53b86b7 softirq: not check if CPU has a RT task [1/1]
PD#SWPL-115695

Problem:
softirq be processed in ksoftirqd

Solution:
not check if CPU has a RT task

Verify:
on T3

Change-Id: I821f0bf6c32db8ccdfc752b60f50e703f95cdfb9
Signed-off-by: Lei Zhang <lei.zhang@amlogic.com>
2023-04-17 19:25:15 -07:00
qiankun.wang 15c95c9b2d trace: fix crash when open function_graph. [1/1]
PD#SWPL-114246

Problem:
The system crashs when echo function_graph >
current_tracer

Solution:
disable the function of "irq check" when enable
function_graph.

Verify:
SC2

Change-Id: I21247370b50550bce8d4551527a308b49e26b247
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-04-10 06:14:09 -07:00
Lei Zhang df6af177d8 iotrace: __nocfi when read/write register [1/1]
PD#SWPL-115907

Problem:
read/write register cost more time

Solution:
__nocfi when read/write register

Verify:
on SC2 ah212

Change-Id: Id2737b3037f8ee2d57e11fbd195e853fe7c0541f
Signed-off-by: Lei Zhang <lei.zhang@amlogic.com>
2023-03-30 02:13:31 -07:00
Hanjie Lin c2d1f7dd3c debug: optimize smc lockup check [1/1]
PD#SWPL-114679

Problem:
smc call can nest in interrupt, and it may cause wrong long smc
warning by mistake

Solution:
only check smc status in hardlockup

Verify:
sc2

Change-Id: I12f3135e2bd06637a107c4c476e25b79338e0f1c
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-03-17 02:12:34 -07:00
qiankun.wang eb313db403 watchdog: optimize hardlockup detect precision [1/1]
PD#SWPL-104071

Problem:
Hardlockup detect precision is from 8s to 24s and
too insufficient.

Solution:
Hardlockup detect precision is 9-11s.

Verify:
SC2

Change-Id: Ic035a3e8dafde891f2c428213c1c51a77adebed3
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-03-16 02:22:24 -07:00
Hanjie Lin db6c055628 sched: fix duplicate __pick_first_entity compile error [1/1]
PD#SWPL-106817

Problem:
drivers/debug/sched.c added __pick_first_entity()

Solution:
remove

Verify:
ah212

Change-Id: Iff8b56054da62f2a4698dd08570e4ccd5aa33ba7
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-03-03 04:17:37 -08:00
qiankun.wang 6273413c6d watchdog: change the interface address [1/1]
PD#SWPL-104071

Problem:
The interface that actively triggers
HardLockup is at an illegal address.

Solution:
The interface is 'params', and in
/sys/kernel/debug/aml_debug/,you can echo
sysrq=x to this parameter to panic.

Verify:
SC2

Change-Id: I7b8f784f0f0fc2a5674e3c7386e81f13d8ec6d6b
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
2023-03-01 00:56:53 -08:00
qinglin.li 101e177c32 gki_20: modify break gki_20 [2/3]
PD#SWPL-101048

Problem:
break GKI 2.0 configs add depends on CONFIG_AMLOGIC_BREAK_GKI_20

Solution:
break GKI 2.0 configs add depends on CONFIG_AMLOGIC_BREAK_GKI_20

Verify:
local

Change-Id: I31aa00603f41a734f881a77a932dbfbbfe1a7a81
Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
2023-02-28 06:10:46 -08:00
Hanjie Lin e33b2fcffb sched: fix common14-5.15 compile sched_stat_runtime error [1/1]
PD#SWPL-106817

Problem:
common14-5.15 didn't export trace_sched_stat_runtime

Solution:
remove it

Verify:
ah212

Change-Id: I59f5ee43dfaabc1e081772ef1fb8b543b121618e
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-02-27 00:04:37 -08:00
Hanjie Lin d1d550e8c9 sched: scheduler optimize [1/1]
PD#SWPL-106817

Problem:
scheduler profile

Solution:
1, check_preempt_wakeup avoid too frequently preempt
2, pick_next_task_fair try to find long-wait high prio task in big cgroup
3, add place_entity wakeup compensation factor
4, select rt more nice when curr is high prio cfs task

Verify:
aq222

Change-Id: I48324cae9aab49c5bc79a8979c6e88ec0b34f921
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-02-24 03:56:31 -08:00
Lei Zhang 5daeeae0b4 TRACE: add Kconfig dependence for meson atrace [1/1]
PD#SWPL-107451

Problem:
C3 build break

Solution:
add Kconfig dependedce for meson atrace

Verify:
on SC2

Change-Id: I66c2fcd589bb7c0909b19c96ebba73aede6e30d7
Signed-off-by: Lei Zhang <lei.zhang@amlogic.com>
2023-02-09 20:13:49 -08:00
Hanjie Lin ddbdcf7a92 TRACE: optimize meson_atrace function [1/1]
PD#SWPL-107451

Problem:
1, perfetto cannot parse meson_atrace event
2, trace_printk cannot work on release version

Solution:
1, change meson_atrace event to trace_print event
2, porting aml_trace_printk

Verify:
on S905X4 AH212

Change-Id: I2656544038113316dc1e756b3ff57edf33cc5c88
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2023-02-08 20:45:27 -08:00
Hanjie Lin caa8b668c5 debug: gki optimize [2/4]
PD#SWPL-99365

Problem:
gki optimize

Solution:
1, code optimize
2, watchdog_hld to ko

Verify:
sc2_ah212

Change-Id: Ibb1b16bd61d794defb39d53f17ad86179ba4a661
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2022-12-27 04:32:55 -08:00
qinglin.li e6fb1070ac printk: caller buffer use over size [1/1]
PD#SWPL-101578

Problem:
caller buffer use over size

Solution:
limit use size

Verify:
s4

Change-Id: I2631feb50f80d3b8242a98eed48d5a1e66620da5
Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
2022-12-05 21:08:14 -07:00
yufei.huan f070355da9 deinterlace: T3 Kernel 5.15 Android T Bringup - di [1/1]
PD#SWPL-97906

Problem:
T3 Kernel 5.15 Android T Bringup - di

Solution:
sync DI code

Verify:
smith

Change-Id: I590e2d71a453849d48207cccc3442e44da59c2da
Signed-off-by: yufei.huan <yufei.huan@amlogic.com>
2022-12-02 14:04:56 +08:00
qinglin.li e23e9bfc33 printk: use vendor_hook print cpu and irq info [2/3]
PD#SWPL-101578

Problem:
use vendor_hook print cpu and irq info

Solution:
use vendor_hook print cpu and irq info

Verify:
sc2

Change-Id: I52f0474ea55d4136933c0a2c12daf31eff4ab261
Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
2022-11-21 22:36:36 -07:00