Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop-4.19-rt104 kenel crash when enable cpufreq #317

Open
xsyr opened this issue Jan 24, 2024 · 0 comments
Open

develop-4.19-rt104 kenel crash when enable cpufreq #317

xsyr opened this issue Jan 24, 2024 · 0 comments

Comments

@xsyr
Copy link

xsyr commented Jan 24, 2024

chip: rk3566
board:

log snippet

Welcome to Ubuntu 20.04.6 LTS!

[    1.727029] BUG: scheduling while atomic: (direxec)/163/0x00010002
[    1.727033] Modules linked in:
[    1.727036] Preemption disabled at:
[    1.727050] [<ffffff800816ccac>] __mod_node_page_state+0x38/0x10c
[    1.727057] CPU: 0 PID: 163 Comm: (direxec) Not tainted 4.19.232-rt104 #1
[    1.727058] Hardware name: EmbedFire LubanCat (DT)
[    1.727061] Call trace:
[    1.727068]  dump_backtrace+0x0/0x178
[    1.727072]  show_stack+0x14/0x1c
[    1.727079]  dump_stack+0x80/0xa8
[    1.727084]  __schedule_bug+0x94/0xac
[    1.727086]  __schedule+0x6c/0x484
[    1.727089]  schedule+0x90/0xc4
[    1.727093]  rt_spin_lock_slowlock_locked+0x128/0x25c
[    1.727095]  rt_spin_lock_slowlock+0x5c/0x8c
[    1.727098]  rt_spin_lock+0x4c/0x58
[    1.727103]  cpufreq_acct_update_power+0x88/0x37c
[    1.727107]  account_system_index_time+0xa0/0xc0
[    1.727110]  account_system_time+0x78/0x84
[    1.727113]  account_process_tick+0x8c/0xa0
[    1.727118]  update_process_times+0x20/0x54
[    1.727123]  tick_sched_timer+0x1b4/0x298
[    1.727126]  __hrtimer_run_queues+0xe4/0x13c
[    1.727129]  hrtimer_interrupt+0xe0/0x22c
[    1.727135]  arch_timer_handler_phys+0x28/0x3c
[    1.727139]  handle_percpu_devid_irq+0x94/0x130
[    1.727144]  generic_handle_irq+0x18/0x2c
[    1.727146]  __handle_domain_irq+0xe8/0xec
[    1.727149]  gic_handle_irq+0xd4/0x1ac
[    1.727151]  el1_irq+0xb0/0x13c
[    1.727158]  check_preemption_disabled+0x8/0xe0
[    1.727162]  __mod_node_page_state+0x5c/0x10c
[    1.727168]  page_add_new_anon_rmap+0x60/0x8c
[    1.727170]  wp_page_copy+0x1d0/0x678
[    1.727173]  __handle_mm_fault+0xc68/0xedc
[    1.727176]  handle_mm_fault+0x170/0x1d0
[    1.727180]  do_page_fault+0x1dc/0x348
[    1.727182]  do_mem_abort+0x54/0xe8
[    1.727184]  el0_da+0x1c/0x20
[    1.727239] Unable to handle kernel paging request at virtual address ffffff00125ec625
[    1.727243] Mem abort info:
[    1.727247]   ESR = 0x96000004
[    1.727254]   Exception class = DABT (current EL), IL = 32 bits
[    1.727257]   SET = 0, FnV = 0
[    1.727258]   EA = 0, S1PTW = 0
[    1.727259] Data abort info:
[    1.727261]   ISV = 0, ISS = 0x00000004
[    1.727262]   CM = 0, WnR = 0
[    1.727265] [ffffff00125ec625] address between user and kernel address ranges
[    1.727268] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    1.727271] Modules linked in:
[    1.727277] Process (direxec) (pid: 163, stack limit = 0x000000005f0a3c46)
[    1.727282] CPU: 0 PID: 163 Comm: (direxec) Tainted: G        W         4.19.232-rt104 #1
[    1.727284] Hardware name: EmbedFire LubanCat (DT)
[    1.727286] pstate: 80400089 (Nzcv daIf +PAN -UAO)
[    1.727292] pc : enqueue_task_rt+0x25c/0x2d8
[    1.727294] lr : enqueue_task_rt+0x68/0x2d8

full booting log:

kernel-log.txt

enable cpufreq:

CONFIG_CPU_FREQ=y
CONFIG_CPUFREQ_DT=y
CONFIG_CPUFREQ_DT_PLATDEV=y
CONFIG_PM_OPP=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_TIMES=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_ARM_ROCKCHIP_CPUFREQ=y

full kenel config file:

lubancat2_defconfig.zip

scpcom pushed a commit to scpcom/linux that referenced this issue Apr 28, 2024
[ Upstream commit a51cd6b ]

In case when is64 == 1 in emit(A64_REV32(is64, dst, dst), ctx) the
generated insn reverses byte order for both high and low 32-bit words,
resuling in an incorrect swap as indicated by the jit test:

[ 9757.262607] test_bpf: rockchip-linux#312 BSWAP 16: 0x0123456789abcdef -> 0xefcd jited:1 8 PASS
[ 9757.264435] test_bpf: rockchip-linux#313 BSWAP 32: 0x0123456789abcdef -> 0xefcdab89 jited:1 ret 1460850314 != -271733879 (0x5712ce8a != 0xefcdab89)FAIL (1 times)
[ 9757.266260] test_bpf: rockchip-linux#314 BSWAP 64: 0x0123456789abcdef -> 0x67452301 jited:1 8 PASS
[ 9757.268000] test_bpf: rockchip-linux#315 BSWAP 64: 0x0123456789abcdef >> 32 -> 0xefcdab89 jited:1 8 PASS
[ 9757.269686] test_bpf: rockchip-linux#316 BSWAP 16: 0xfedcba9876543210 -> 0x1032 jited:1 8 PASS
[ 9757.271380] test_bpf: rockchip-linux#317 BSWAP 32: 0xfedcba9876543210 -> 0x10325476 jited:1 ret -1460850316 != 271733878 (0xa8ed3174 != 0x10325476)FAIL (1 times)
[ 9757.273022] test_bpf: rockchip-linux#318 BSWAP 64: 0xfedcba9876543210 -> 0x98badcfe jited:1 7 PASS
[ 9757.274721] test_bpf: rockchip-linux#319 BSWAP 64: 0xfedcba9876543210 >> 32 -> 0x10325476 jited:1 9 PASS

Fix this by forcing 32bit variant of rev32.

Fixes: 1104247 ("bpf, arm64: Support unconditional bswap")
Signed-off-by: Artem Savkov <[email protected]>
Tested-by: Puranjay Mohan <[email protected]>
Acked-by: Puranjay Mohan <[email protected]>
Acked-by: Xu Kuohai <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant