revyos / th1520-linux-kernel

TH1520 linux kernel
Other
11 stars 6 forks source link

add TH1520 cpu frequency driver #2

Closed ixgbe01 closed 9 months ago

RevySR commented 9 months ago

已合并到v6.6.2 branch

测试之后发现有以下启动log 是预期的吗

[   19.575395] ------------[ cut here ]------------
[   19.580041] cpu_pll1_foutpostdiv already disabled
[   19.584796] WARNING: CPU: 1 PID: 73 at drivers/clk/clk.c:1090 clk_core_disable+0x114/0x118
[   19.584833] Modules linked in:
[   19.584846] CPU: 1 PID: 73 Comm: kworker/u10:2 Not tainted 6.6.2+ #1
[   19.584861] Hardware name: Sipeed Lichee Pi 4A (DT)
[   19.584870] Workqueue: events_unbound deferred_probe_work_func
[   19.584890] epc : clk_core_disable+0x114/0x118
[   19.584906]  ra : clk_core_disable+0x114/0x118
[   19.584919] epc : ffffffff805e65e2 ra : ffffffff805e65e2 sp : ffffffc80092b430
[   19.584930]  gp : ffffffff819a1e68 tp : ffffffd900bea940 t0 : 5f00000000000000
[   19.584939]  t1 : 0000000000000063 t2 : 5f316c6c705f7570 s0 : ffffffc80092b450
[   19.584948]  s1 : ffffffd919896000 a0 : 0000000000000025 a1 : ffffffff818961a0
[   19.584959]  a2 : 0000000000000010 a3 : 00000000000000c3 a4 : 72221fe995eede00
[   19.584967]  a5 : 72221fe995eede00 a6 : c0000000ffffefff a7 : ffffffff819e1770
[   19.584976]  s2 : ffffffd919896000 s3 : 0000000000000001 s4 : ffffffff80c6b6c8
[   19.584983]  s5 : ffffffff819a66d0 s6 : ffffffff819e1768 s7 : 00000000000c3500
[   19.584992]  s8 : 00000000000aae60 s9 : 00000000000b71b0 s10: ffffffff819a40a8
[   19.585001]  s11: ffffffff819a66e8 t3 : ffffffff819b60f7 t4 : ffffffff819b60f7
[   19.585009]  t5 : ffffffff819b60f8 t6 : ffffffc80092b228
[   19.585016] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
[   19.585026] [<ffffffff805e65e2>] clk_core_disable+0x114/0x118
[   19.585044] [<ffffffff805e661a>] clk_disable+0x34/0x4c
[   19.585059] [<ffffffff80727b20>] light_set_target+0x318/0x6a6
[   19.585077] [<ffffffff8072354c>] __cpufreq_driver_target+0x194/0x2a8
[   19.585094] [<ffffffff807250f8>] cpufreq_online+0x9c4/0xa4a
[   19.585109] [<ffffffff8072524c>] cpufreq_add_dev+0xac/0xbc
[   19.585121] [<ffffffff8064e33a>] subsys_interface_register+0xf6/0x108
[   19.585138] [<ffffffff80721aae>] cpufreq_register_driver+0x150/0x2b8
[   19.585152] [<ffffffff80727446>] light_cpufreq_probe+0x31a/0x4f6
[   19.585166] [<ffffffff8065306a>] platform_probe+0x5e/0xaa
[   19.585185] [<ffffffff80650142>] really_probe+0x9e/0x33e
[   19.585198] [<ffffffff80650460>] __driver_probe_device+0x7e/0x136
[   19.585211] [<ffffffff80650550>] driver_probe_device+0x38/0xc4
[   19.585223] [<ffffffff8065065e>] __device_attach_driver+0x82/0xe4
[   19.585237] [<ffffffff8064e078>] bus_for_each_drv+0x70/0xc4
[   19.585252] [<ffffffff80650a80>] __device_attach+0xb2/0x1ce
[   19.585264] [<ffffffff80650da0>] device_initial_probe+0x1a/0x22
[   19.585278] [<ffffffff8064f000>] bus_probe_device+0x96/0x98
[   19.585292] [<ffffffff8064c63a>] device_add+0x558/0x70c
[   19.585303] [<ffffffff80765eb8>] of_device_add+0x3c/0x4c
[   19.585325] [<ffffffff80765f7a>] of_platform_device_create_pdata+0x80/0xb6
[   19.585342] [<ffffffff80766298>] of_platform_bus_create+0x186/0x2b4
[   19.585359] [<ffffffff80766556>] of_platform_populate+0x5a/0x10c
[   19.585378] [<ffffffff80766686>] devm_of_platform_populate+0x52/0x98
[   19.585396] [<ffffffff8076117a>] light_aon_probe+0xfa/0x14e
[   19.585413] [<ffffffff8065306a>] platform_probe+0x5e/0xaa
[   19.585427] [<ffffffff80650142>] really_probe+0x9e/0x33e
[   19.585441] [<ffffffff80650460>] __driver_probe_device+0x7e/0x136
[   19.585456] [<ffffffff80650550>] driver_probe_device+0x38/0xc4
[   19.585469] [<ffffffff8065065e>] __device_attach_driver+0x82/0xe4
[   19.585484] [<ffffffff8064e078>] bus_for_each_drv+0x70/0xc4
[   19.585499] [<ffffffff80650a80>] __device_attach+0xb2/0x1ce
[   19.585513] [<ffffffff80650da0>] device_initial_probe+0x1a/0x22
[   19.585526] [<ffffffff8064f000>] bus_probe_device+0x96/0x98
[   19.585540] [<ffffffff8064fd72>] deferred_probe_work_func+0xb2/0x102
[   19.585554] [<ffffffff8003727a>] process_one_work+0x17a/0x302
[   19.585573] [<ffffffff800376c0>] worker_thread+0x2be/0x3f8
[   19.585586] [<ffffffff80040924>] kthread+0xc4/0xe4
[   19.585599] [<ffffffff80003e2e>] ret_from_fork+0xe/0x20
[   19.585616] ---[ end trace 0000000000000000 ]---
[   19.937678] ------------[ cut here ]------------
[   19.942360] cpu_pll1_foutpostdiv already unprepared
[   19.947315] WARNING: CPU: 1 PID: 73 at drivers/clk/clk.c:949 clk_core_unprepare+0x156/0x170
[   19.947341] Modules linked in:
[   19.947350] CPU: 1 PID: 73 Comm: kworker/u10:2 Tainted: G        W          6.6.2+ #1
[   19.947363] Hardware name: Sipeed Lichee Pi 4A (DT)
[   19.947370] Workqueue: events_unbound deferred_probe_work_func
[   19.947386] epc : clk_core_unprepare+0x156/0x170
[   19.947400]  ra : clk_core_unprepare+0x156/0x170
[   19.947412] epc : ffffffff805e6472 ra : ffffffff805e6472 sp : ffffffc80092b430
[   19.947421]  gp : ffffffff819a1e68 tp : ffffffd900bea940 t0 : 5f00000000000000
[   19.947430]  t1 : 0000000000000063 t2 : 5f316c6c705f7570 s0 : ffffffc80092b450
[   19.947438]  s1 : ffffffd919896000 a0 : 0000000000000027 a1 : ffffffff818961a0
[   19.947445]  a2 : 0000000000000010 a3 : 0000000000000100 a4 : 72221fe995eede00
[   19.947454]  a5 : 72221fe995eede00 a6 : c0000000ffffefff a7 : ffffffff819e1770
[   19.947462]  s2 : 000000002faf0800 s3 : 0000000000000001 s4 : ffffffff80c6b6c8
[   19.947471]  s5 : ffffffff819a66d0 s6 : ffffffff819e1768 s7 : 00000000000c3500
[   19.947480]  s8 : 00000000000aae60 s9 : 00000000000b71b0 s10: ffffffff819a40a8
[   19.947488]  s11: ffffffff819a66e8 t3 : ffffffff819b60f7 t4 : ffffffff819b60f7
[   19.947497]  t5 : ffffffff819b60f8 t6 : ffffffc80092b228
[   19.947504] status: 0000000200000120 badaddr: 0000000000000000 cause: 0000000000000003
[   19.947514] [<ffffffff805e6472>] clk_core_unprepare+0x156/0x170
[   19.947531] [<ffffffff805e64ba>] clk_unprepare+0x2e/0x42
[   19.947545] [<ffffffff80727b2c>] light_set_target+0x324/0x6a6
[   19.947560] [<ffffffff8072354c>] __cpufreq_driver_target+0x194/0x2a8
[   19.947574] [<ffffffff807250f8>] cpufreq_online+0x9c4/0xa4a
[   19.947587] [<ffffffff8072524c>] cpufreq_add_dev+0xac/0xbc
[   19.947598] [<ffffffff8064e33a>] subsys_interface_register+0xf6/0x108
[   19.947612] [<ffffffff80721aae>] cpufreq_register_driver+0x150/0x2b8
[   19.947624] [<ffffffff80727446>] light_cpufreq_probe+0x31a/0x4f6
[   19.947638] [<ffffffff8065306a>] platform_probe+0x5e/0xaa
[   19.947653] [<ffffffff80650142>] really_probe+0x9e/0x33e
[   19.947664] [<ffffffff80650460>] __driver_probe_device+0x7e/0x136
[   19.947677] [<ffffffff80650550>] driver_probe_device+0x38/0xc4
[   19.947689] [<ffffffff8065065e>] __device_attach_driver+0x82/0xe4
[   19.947703] [<ffffffff8064e078>] bus_for_each_drv+0x70/0xc4
[   19.947715] [<ffffffff80650a80>] __device_attach+0xb2/0x1ce
[   19.947730] [<ffffffff80650da0>] device_initial_probe+0x1a/0x22
[   19.947744] [<ffffffff8064f000>] bus_probe_device+0x96/0x98
[   19.947756] [<ffffffff8064c63a>] device_add+0x558/0x70c
[   19.947767] [<ffffffff80765eb8>] of_device_add+0x3c/0x4c
[   19.947785] [<ffffffff80765f7a>] of_platform_device_create_pdata+0x80/0xb6
[   19.947802] [<ffffffff80766298>] of_platform_bus_create+0x186/0x2b4
[   19.947819] [<ffffffff80766556>] of_platform_populate+0x5a/0x10c
[   19.947835] [<ffffffff80766686>] devm_of_platform_populate+0x52/0x98
[   19.947854] [<ffffffff8076117a>] light_aon_probe+0xfa/0x14e
[   19.947870] [<ffffffff8065306a>] platform_probe+0x5e/0xaa
[   19.947882] [<ffffffff80650142>] really_probe+0x9e/0x33e
[   19.947895] [<ffffffff80650460>] __driver_probe_device+0x7e/0x136
[   19.947908] [<ffffffff80650550>] driver_probe_device+0x38/0xc4
[   19.947920] [<ffffffff8065065e>] __device_attach_driver+0x82/0xe4
[   19.947933] [<ffffffff8064e078>] bus_for_each_drv+0x70/0xc4
[   19.947946] [<ffffffff80650a80>] __device_attach+0xb2/0x1ce
[   19.947958] [<ffffffff80650da0>] device_initial_probe+0x1a/0x22
[   19.947972] [<ffffffff8064f000>] bus_probe_device+0x96/0x98
[   19.947983] [<ffffffff8064fd72>] deferred_probe_work_func+0xb2/0x102
[   19.947997] [<ffffffff8003727a>] process_one_work+0x17a/0x302
[   19.948010] [<ffffffff800376c0>] worker_thread+0x2be/0x3f8
[   19.948022] [<ffffffff80040924>] kthread+0xc4/0xe4
[   19.948034] [<ffffffff80003e2e>] ret_from_fork+0xe/0x20
[   19.948047] ---[ end trace 0000000000000000 ]---
[   19.948070] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 750000 KHz, changing to: 800000 KHz
[   20.325365] cpu cpu0: finish to register cpufreq driver
ixgbe01 commented 9 months ago

@Rabenda 您好,启动log 与我用 https://github.com/revyos/thead-kernel.git (Linux 5.10.113) 在荔枝派(TH1520)上的显示是一致的。 Linux5_10_113_LicheePi启动日志.txt

RevySR commented 9 months ago

@Rabenda 您好,启动log 与我用 https://github.com/revyos/thead-kernel.git (Linux 5.10.113) 在荔枝派(TH1520)上的显示是一致的。 Linux5_10_113_LicheePi启动日志.txt

OK 补丁已经手动合并到 th1520-v6.6.3 已测试

https://github.com/revyos/th1520-linux-kernel/actions/runs/7024423780

RevySR commented 9 months ago

可以提交到upstream吗

ixgbe01 commented 9 months ago

可以提交到upstream吗

是提交到 https://github.com/torvalds/linux 这里吗? 主要实现cpu 调频的驱动的作者是 Alibaba Group Holding Limited ,我提交到 upstream (https://github.com/torvalds/linux)是不是不太好啊