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

Kernel bug on power key press #2

Open
kristofpetho opened this issue May 4, 2021 · 9 comments
Open

Kernel bug on power key press #2

kristofpetho opened this issue May 4, 2021 · 9 comments

Comments

@kristofpetho
Copy link

Hi @YuHuang65, you have been so helpful with the other issue, I wanted to bring to your attention that anytime the power key is pressed, the following is triggered in the kernel:

[12434.277491] [20210504_15:08:27.067097]@0 ------------[ cut here ]------------
[12434.277511] [20210504_15:08:27.067121]@0 WARNING: CPU: 0 PID: 2071 at kernel/time/timer.c:1394 del_timer_sync+0xb8/0xd0
[12434.277520] [20210504_15:08:27.067131]@0 CPU: 0 PID: 2071 Comm: netmgrd Tainted: G S W 5.4.61-Omega #1
[12434.277525] [20210504_15:08:27.067135]@0 Hardware name: Qualcomm Technologies, Inc. Lahaina MTP lemonadep (DT)
[12434.277530] [20210504_15:08:27.067141]@0 pstate: 00400085 (nzcv daIf +PAN -UAO)
[12434.277536] [20210504_15:08:27.067147]@0 pc : del_timer_sync+0xb8/0xd0
[12434.277546] [20210504_15:08:27.067157]@0 lr : __kthread_cancel_work_sync+0xe0/0x150
[12434.277550] [20210504_15:08:27.067161]@0 sp : ffffffc010003cf0
[12434.277554] [20210504_15:08:27.067164]@0 x29: ffffffc010003cf0 x28: ffffffd397707018
[12434.277559] [20210504_15:08:27.067170]@0 x27: ffffff81f3d9d800 x26: ffffffd397707018
[12434.277565] [20210504_15:08:27.067176]@0 x25: ffffffd397a79ca8 x24: ffffff81f3166d48
[12434.277570] [20210504_15:08:27.067181]@0 x23: ffffff81f3166dd8 x22: ffffff81f30de584
[12434.277575] [20210504_15:08:27.067186]@0 x21: ffffff81f30de584 x20: ffffff81f3166d70
[12434.277580] [20210504_15:08:27.067191]@0 x19: ffffff81f3166d48 x18: 0000000000080000
[12434.277585] [20210504_15:08:27.067196]@0 x17: 0000000000000000 x16: 0000000000000000
[12434.277591] [20210504_15:08:27.067201]@0 x15: 000000000632ea00 x14: 0000000000000000
[12434.277596] [20210504_15:08:27.067207]@0 x13: 00000000000066eb x12: 0000000000000001
[12434.277601] [20210504_15:08:27.067212]@0 x11: 0000000000000000 x10: 0000000000000000
[12434.277606] [20210504_15:08:27.067217]@0 x9 : 000000000000cddb x8 : 000000000085a4a3
[12434.277612] [20210504_15:08:27.067222]@0 x7 : ffffff81fecbd240 x6 : 0000005c1ee08d27
[12434.277617] [20210504_15:08:27.067228]@0 x5 : ffffff8040ac5c80 x4 : 0000000000000000
[12434.277622] [20210504_15:08:27.067233]@0 x3 : ffffff81f30de584 x2 : 0000000000000000
[12434.277627] [20210504_15:08:27.067238]@0 x1 : ffffff8040ac5c80 x0 : 000000002e000000
[12434.277633] [20210504_15:08:27.067244]@0 Call trace:
[12434.277639] [20210504_15:08:27.067250]@0 del_timer_sync+0xb8/0xd0
[12434.277644] [20210504_15:08:27.067255]@0 __kthread_cancel_work_sync+0xe0/0x150
[12434.277650] [20210504_15:08:27.067260]@0 kthread_cancel_delayed_work_sync+0x10/0x20
[12434.277660] [20210504_15:08:27.067271]@0 qpnp_pon_input_dispatch+0x21c/0x2e0
[12434.277666] [20210504_15:08:27.067276]@0 qpnp_kpdpwr_irq+0x1c/0x50
[12434.277673] [20210504_15:08:27.067284]@0 __handle_irq_event_percpu+0x58/0x2a0
[12434.277678] [20210504_15:08:27.067289]@0 handle_irq_event+0x60/0x130
[12434.277684] [20210504_15:08:27.067295]@0 handle_edge_irq+0xb4/0x210
[12434.277689] [20210504_15:08:27.067300]@0 generic_handle_irq+0x28/0x40
[12434.277698] [20210504_15:08:27.067309]@0 periph_interrupt+0xa8/0x130
[12434.277703] [20210504_15:08:27.067313]@0 pmic_arb_chained_irq+0x140/0x240
[12434.277707] [20210504_15:08:27.067318]@0 __handle_domain_irq+0x74/0xd0
[12434.277714] [20210504_15:08:27.067324]@0 gic_handle_irq+0xc0/0x164
[12434.277720] [20210504_15:08:27.067331]@0 el1_irq+0xf0/0x1c0
[12434.277730] [20210504_15:08:27.067340]@0 _raw_spin_unlock_irq+0x10/0x50
[12434.277737] [20210504_15:08:27.067347]@0 __schedule+0x320/0x860
[12434.277741] [20210504_15:08:27.067352]@0 schedule+0x40/0xe0
[12434.277748] [20210504_15:08:27.067359]@0 __refrigerator+0x44/0xe0
[12434.277755] [20210504_15:08:27.067366]@0 get_signal+0x7c8/0x840
[12434.277763] [20210504_15:08:27.067374]@0 do_notify_resume+0x16c/0x1420
[12434.277768] [20210504_15:08:27.067379]@0 work_pending+0x8/0x10
[12434.277772] [20210504_15:08:27.067383]@0 ---[ end trace 7bbf3fd4650fdb41 ]---

@YuHuang65
Copy link
Contributor

Hi @YuHuang65, you have been so helpful with the other issue, I wanted to bring to your attention that anytime the power key is pressed, the following is triggered in the kernel:

[12434.277491] [20210504_15:08:27.067097]@0 ------------[ cut here ]------------
[12434.277511] [20210504_15:08:27.067121]@0 WARNING: CPU: 0 PID: 2071 at kernel/time/timer.c:1394 del_timer_sync+0xb8/0xd0
[12434.277520] [20210504_15:08:27.067131]@0 CPU: 0 PID: 2071 Comm: netmgrd Tainted: G S W 5.4.61-Omega #1
[12434.277525] [20210504_15:08:27.067135]@0 Hardware name: Qualcomm Technologies, Inc. Lahaina MTP lemonadep (DT)
[12434.277530] [20210504_15:08:27.067141]@0 pstate: 00400085 (nzcv daIf +PAN -UAO)
[12434.277536] [20210504_15:08:27.067147]@0 pc : del_timer_sync+0xb8/0xd0
[12434.277546] [20210504_15:08:27.067157]@0 lr : __kthread_cancel_work_sync+0xe0/0x150
[12434.277550] [20210504_15:08:27.067161]@0 sp : ffffffc010003cf0
[12434.277554] [20210504_15:08:27.067164]@0 x29: ffffffc010003cf0 x28: ffffffd397707018
[12434.277559] [20210504_15:08:27.067170]@0 x27: ffffff81f3d9d800 x26: ffffffd397707018
[12434.277565] [20210504_15:08:27.067176]@0 x25: ffffffd397a79ca8 x24: ffffff81f3166d48
[12434.277570] [20210504_15:08:27.067181]@0 x23: ffffff81f3166dd8 x22: ffffff81f30de584
[12434.277575] [20210504_15:08:27.067186]@0 x21: ffffff81f30de584 x20: ffffff81f3166d70
[12434.277580] [20210504_15:08:27.067191]@0 x19: ffffff81f3166d48 x18: 0000000000080000
[12434.277585] [20210504_15:08:27.067196]@0 x17: 0000000000000000 x16: 0000000000000000
[12434.277591] [20210504_15:08:27.067201]@0 x15: 000000000632ea00 x14: 0000000000000000
[12434.277596] [20210504_15:08:27.067207]@0 x13: 00000000000066eb x12: 0000000000000001
[12434.277601] [20210504_15:08:27.067212]@0 x11: 0000000000000000 x10: 0000000000000000
[12434.277606] [20210504_15:08:27.067217]@0 x9 : 000000000000cddb x8 : 000000000085a4a3
[12434.277612] [20210504_15:08:27.067222]@0 x7 : ffffff81fecbd240 x6 : 0000005c1ee08d27
[12434.277617] [20210504_15:08:27.067228]@0 x5 : ffffff8040ac5c80 x4 : 0000000000000000
[12434.277622] [20210504_15:08:27.067233]@0 x3 : ffffff81f30de584 x2 : 0000000000000000
[12434.277627] [20210504_15:08:27.067238]@0 x1 : ffffff8040ac5c80 x0 : 000000002e000000
[12434.277633] [20210504_15:08:27.067244]@0 Call trace:
[12434.277639] [20210504_15:08:27.067250]@0 del_timer_sync+0xb8/0xd0
[12434.277644] [20210504_15:08:27.067255]@0 __kthread_cancel_work_sync+0xe0/0x150
[12434.277650] [20210504_15:08:27.067260]@0 kthread_cancel_delayed_work_sync+0x10/0x20
[12434.277660] [20210504_15:08:27.067271]@0 qpnp_pon_input_dispatch+0x21c/0x2e0
[12434.277666] [20210504_15:08:27.067276]@0 qpnp_kpdpwr_irq+0x1c/0x50
[12434.277673] [20210504_15:08:27.067284]@0 __handle_irq_event_percpu+0x58/0x2a0
[12434.277678] [20210504_15:08:27.067289]@0 handle_irq_event+0x60/0x130
[12434.277684] [20210504_15:08:27.067295]@0 handle_edge_irq+0xb4/0x210
[12434.277689] [20210504_15:08:27.067300]@0 generic_handle_irq+0x28/0x40
[12434.277698] [20210504_15:08:27.067309]@0 periph_interrupt+0xa8/0x130
[12434.277703] [20210504_15:08:27.067313]@0 pmic_arb_chained_irq+0x140/0x240
[12434.277707] [20210504_15:08:27.067318]@0 __handle_domain_irq+0x74/0xd0
[12434.277714] [20210504_15:08:27.067324]@0 gic_handle_irq+0xc0/0x164
[12434.277720] [20210504_15:08:27.067331]@0 el1_irq+0xf0/0x1c0
[12434.277730] [20210504_15:08:27.067340]@0 _raw_spin_unlock_irq+0x10/0x50
[12434.277737] [20210504_15:08:27.067347]@0 __schedule+0x320/0x860
[12434.277741] [20210504_15:08:27.067352]@0 schedule+0x40/0xe0
[12434.277748] [20210504_15:08:27.067359]@0 __refrigerator+0x44/0xe0
[12434.277755] [20210504_15:08:27.067366]@0 get_signal+0x7c8/0x840
[12434.277763] [20210504_15:08:27.067374]@0 do_notify_resume+0x16c/0x1420
[12434.277768] [20210504_15:08:27.067379]@0 work_pending+0x8/0x10
[12434.277772] [20210504_15:08:27.067383]@0 ---[ end trace 7bbf3fd4650fdb41 ]---

Could you please describe the problem in detail? It means that there is on response when your power key is press or other condition.

@kristofpetho
Copy link
Author

Hi, correct. Anytime I press the power key on the device, the above bug is triggered in the kernel and I see it in dmesg.

@YuHuang65
Copy link
Contributor

Hi, correct. Anytime I press the power key on the device, the above bug is triggered in the kernel and I see it in dmesg.

I can't confirm the specific problems from above dmesg directly, is there a corresponding event response when the power key is pressed? Like the following event log:
[20210501_13:21:20.279706]@0 Power-Key DOWN
......
[20210501_13:21:20.458642]@0 Power-Key UP

@kristofpetho
Copy link
Author

Sorry, you're right, should have included that...

One example:

[ 1940.973864] [20210508_12:07:06.447325]@0 Power-Key UP
[ 1940.973900] [20210508_12:07:06.447366]@0 ------------[ cut here ]------------
[ 1940.973915] [20210508_12:07:06.447381]@0 WARNING: CPU: 0 PID: 0 at kernel/time/timer.c:1394 del_timer_sync+0xb8/0xd0
[ 1940.973923] [20210508_12:07:06.447389]@0 CPU: 0 PID: 0 Comm: swapper/0 Tainted: G S      W         5.4.61-Omega #1
[ 1940.973928] [20210508_12:07:06.447394]@0 Hardware name: Qualcomm Technologies, Inc. Lahaina MTP lemonadep (DT)
[ 1940.973934] [20210508_12:07:06.447400]@0 pstate: 00400085 (nzcv daIf +PAN -UAO)
[ 1940.973939] [20210508_12:07:06.447405]@0 pc : del_timer_sync+0xb8/0xd0
[ 1940.973948] [20210508_12:07:06.447415]@0 lr : __kthread_cancel_work_sync+0xe0/0x150
[ 1940.973952] [20210508_12:07:06.447419]@0 sp : ffffffc010003cf0
[ 1940.973957] [20210508_12:07:06.447423]@0 x29: ffffffc010003cf0 x28: ffffffd604c98018 
[ 1940.973963] [20210508_12:07:06.447430]@0 x27: ffffff81f3d9f200 x26: ffffffd604c98018 
[ 1940.973968] [20210508_12:07:06.447435]@0 x25: ffffffd604fe9ca8 x24: ffffff81f3131548 
[ 1940.973973] [20210508_12:07:06.447440]@0 x23: ffffff81f31315d8 x22: ffffff81f3714184 
[ 1940.973979] [20210508_12:07:06.447445]@0 x21: ffffff81f3714184 x20: ffffff81f3131570 
[ 1940.973983] [20210508_12:07:06.447450]@0 x19: ffffff81f3131548 x18: ffffffd60500c988 
[ 1940.973989] [20210508_12:07:06.447455]@0 x17: 0000000000000000 x16: ffffffd604fe9e04 
[ 1940.973994] [20210508_12:07:06.447461]@0 x15: 000000000632ea00 x14: 0000000000000001 
[ 1940.973998] [20210508_12:07:06.447465]@0 x13: 0000000000007cd1 x12: 0000000000000000 
[ 1940.974004] [20210508_12:07:06.447470]@0 x11: 0000000000000005 x10: 0000000000000098 
[ 1940.974008] [20210508_12:07:06.447475]@0 x9 : 0000000000000000 x8 : 0000000000000000 
[ 1940.974013] [20210508_12:07:06.447480]@0 x7 : ffffff81fecb9240 x6 : 00000013a46649e5 
[ 1940.974018] [20210508_12:07:06.447485]@0 x5 : ffffffd604ff8440 x4 : 0000000000000000 
[ 1940.974023] [20210508_12:07:06.447490]@0 x3 : ffffff81f3714184 x2 : 0000000000000000 
[ 1940.974028] [20210508_12:07:06.447495]@0 x1 : ffffffd604ff8440 x0 : 0000000026800000 
[ 1940.974035] [20210508_12:07:06.447502]@0 Call trace:
[ 1940.974042] [20210508_12:07:06.447508]@0  del_timer_sync+0xb8/0xd0
[ 1940.974047] [20210508_12:07:06.447513]@0  __kthread_cancel_work_sync+0xe0/0x150
[ 1940.974052] [20210508_12:07:06.447519]@0  kthread_cancel_delayed_work_sync+0x10/0x20
[ 1940.974060] [20210508_12:07:06.447527]@0  qpnp_pon_input_dispatch+0x21c/0x2e0
[ 1940.974065] [20210508_12:07:06.447532]@0  qpnp_kpdpwr_irq+0x1c/0x50
[ 1940.974071] [20210508_12:07:06.447538]@0  __handle_irq_event_percpu+0x58/0x2a0
[ 1940.974076] [20210508_12:07:06.447542]@0  handle_irq_event+0x60/0x130
[ 1940.974081] [20210508_12:07:06.447548]@0  handle_edge_irq+0xb4/0x210
[ 1940.974085] [20210508_12:07:06.447552]@0  generic_handle_irq+0x28/0x40
[ 1940.974094] [20210508_12:07:06.447560]@0  periph_interrupt+0x9c/0x120
[ 1940.974100] [20210508_12:07:06.447566]@0  pmic_arb_chained_irq+0x134/0x250
[ 1940.974105] [20210508_12:07:06.447571]@0  __handle_domain_irq+0x74/0xd0
[ 1940.974111] [20210508_12:07:06.447578]@0  gic_handle_irq+0xc0/0x164
[ 1940.974117] [20210508_12:07:06.447584]@0  el1_irq+0xb8/0x180
[ 1940.974125] [20210508_12:07:06.447591]@0  lpm_cpuidle_enter+0x1f4/0x550
[ 1940.974130] [20210508_12:07:06.447596]@0  cpuidle_enter_state+0x7c/0x380
[ 1940.974134] [20210508_12:07:06.447600]@0  cpuidle_enter+0x34/0x50
[ 1940.974142] [20210508_12:07:06.447609]@0  do_idle+0x230/0x300
[ 1940.974146] [20210508_12:07:06.447613]@0  cpu_startup_entry+0x20/0x40
[ 1940.974153] [20210508_12:07:06.447620]@0  rest_init+0xd0/0xdc
[ 1940.974160] [20210508_12:07:06.447627]@0  arch_call_rest_init+0xc/0x14
[ 1940.974166] [20210508_12:07:06.447632]@0  start_kernel+0x4a8/0x4dc
[ 1940.974171] [20210508_12:07:06.447637]@0 ---[ end trace be94c329d205bc34 ]---

Another example:

[ 1938.111156] [20210508_12:07:03.584585]@0 Power-Key UP
[ 1938.111282] [20210508_12:07:03.584743]@0 ------------[ cut here ]------------
[ 1938.111340] [20210508_12:07:03.584803]@0 WARNING: CPU: 0 PID: 0 at kernel/time/timer.c:1394 del_timer_sync+0xb8/0xd0
[ 1938.111368] [20210508_12:07:03.584830]@0 CPU: 0 PID: 0 Comm: swapper/0 Tainted: G S      W         5.4.61-Omega #1
[ 1938.111380] [20210508_12:07:03.584842]@0 Hardware name: Qualcomm Technologies, Inc. Lahaina MTP lemonadep (DT)
[ 1938.111397] [20210508_12:07:03.584860]@0 pstate: 00400085 (nzcv daIf +PAN -UAO)
[ 1938.111409] [20210508_12:07:03.584873]@0 pc : del_timer_sync+0xb8/0xd0
[ 1938.111440] [20210508_12:07:03.584901]@0 lr : __kthread_cancel_work_sync+0xe0/0x150
[ 1938.111449] [20210508_12:07:03.584913]@0 sp : ffffffc010003cf0
[ 1938.111459] [20210508_12:07:03.584921]@0 x29: ffffffc010003cf0 x28: ffffffd604c98018 
[ 1938.111474] [20210508_12:07:03.584938]@0 x27: ffffff81f3d9f200 x26: ffffffd604c98018 
[ 1938.111488] [20210508_12:07:03.584952]@0 x25: ffffffd604fe9ca8 x24: ffffff81f3131548 
[ 1938.111500] [20210508_12:07:03.584964]@0 x23: ffffff81f31315d8 x22: ffffff81f3714184 
[ 1938.111512] [20210508_12:07:03.584977]@0 x21: ffffff81f3714184 x20: ffffff81f3131570 
[ 1938.111525] [20210508_12:07:03.584989]@0 x19: ffffff81f3131548 x18: ffffffd60500c988 
[ 1938.111537] [20210508_12:07:03.585001]@0 x17: 0000000000000000 x16: ffffffd604fe9e04 
[ 1938.111550] [20210508_12:07:03.585014]@0 x15: 000000000632ea00 x14: 0000000000000001 
[ 1938.111562] [20210508_12:07:03.585026]@0 x13: 0000000000004b71 x12: 0000000000000000 
[ 1938.111574] [20210508_12:07:03.585038]@0 x11: 0000000000000000 x10: 000000000000007b 
[ 1938.111586] [20210508_12:07:03.585050]@0 x9 : 0000000000000000 x8 : 0000000000000000 
[ 1938.111598] [20210508_12:07:03.585062]@0 x7 : ffffff81fecb9240 x6 : 00000013a11f39e5 
[ 1938.111611] [20210508_12:07:03.585075]@0 x5 : ffffffd604ff8440 x4 : 0000000000000000 
[ 1938.111624] [20210508_12:07:03.585088]@0 x3 : ffffff81f3714184 x2 : 0000000000000000 
[ 1938.111636] [20210508_12:07:03.585100]@0 x1 : ffffffd604ff8440 x0 : 0000000023800000 
[ 1938.111652] [20210508_12:07:03.585116]@0 Call trace:
[ 1938.111669] [20210508_12:07:03.585132]@0  del_timer_sync+0xb8/0xd0
[ 1938.111682] [20210508_12:07:03.585145]@0  __kthread_cancel_work_sync+0xe0/0x150
[ 1938.111696] [20210508_12:07:03.585159]@0  kthread_cancel_delayed_work_sync+0x10/0x20
[ 1938.111719] [20210508_12:07:03.585182]@0  qpnp_pon_input_dispatch+0x21c/0x2e0
[ 1938.111731] [20210508_12:07:03.585194]@0  qpnp_kpdpwr_irq+0x1c/0x50
[ 1938.111753] [20210508_12:07:03.585215]@0  __handle_irq_event_percpu+0x58/0x2a0
[ 1938.111765] [20210508_12:07:03.585228]@0  handle_irq_event+0x60/0x130
[ 1938.111780] [20210508_12:07:03.585243]@0  handle_edge_irq+0xb4/0x210
[ 1938.111792] [20210508_12:07:03.585255]@0  generic_handle_irq+0x28/0x40
[ 1938.111815] [20210508_12:07:03.585278]@0  periph_interrupt+0x9c/0x120
[ 1938.111829] [20210508_12:07:03.585292]@0  pmic_arb_chained_irq+0x134/0x250
[ 1938.111839] [20210508_12:07:03.585303]@0  __handle_domain_irq+0x74/0xd0
[ 1938.111856] [20210508_12:07:03.585320]@0  gic_handle_irq+0xc0/0x164
[ 1938.111870] [20210508_12:07:03.585333]@0  el1_irq+0xb8/0x180
[ 1938.111892] [20210508_12:07:03.585355]@0  lpm_cpuidle_enter+0x1f4/0x550
[ 1938.111905] [20210508_12:07:03.585368]@0  cpuidle_enter_state+0x7c/0x380
[ 1938.111917] [20210508_12:07:03.585380]@0  cpuidle_enter+0x34/0x50
[ 1938.111938] [20210508_12:07:03.585402]@0  do_idle+0x230/0x300
[ 1938.111950] [20210508_12:07:03.585414]@0  cpu_startup_entry+0x24/0x40
[ 1938.111972] [20210508_12:07:03.585434]@0  rest_init+0xd0/0xdc
[ 1938.111990] [20210508_12:07:03.585454]@0  arch_call_rest_init+0xc/0x14
[ 1938.112003] [20210508_12:07:03.585467]@0  start_kernel+0x4a8/0x4dc
[ 1938.112014] [20210508_12:07:03.585478]@0 ---[ end trace be94c329d205bc33 ]---

@YuHuang65
Copy link
Contributor

It seems that the devicetree codes are not synchronized fully. Maybe you can check the devicetree codes in path "arch/arm64/boot/dts/vendor/qcom".

@kristofpetho
Copy link
Author

It seems that the devicetree codes are not synchronized fully. Maybe you can check the devicetree codes in path "arch/arm64/boot/dts/vendor/qcom".

Thanks, I just checked and the entire repo is synchronized. I'm also using the stock dtbo partition with my kernel.

@kristofpetho
Copy link
Author

Hi @YuHuang65, to put more context around it, the exact same issue is on fully stock kernel.

05-01 09:34:15.365     0     0 I         : [20210501_09:34:15.364466]@0 Power-Key UP
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364522]@0 ------------[ cut here ]------------
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364543]@0 WARNING: CPU: 0 PID: 2689 at kernel/time/timer.c:1394 del_timer_sync+0x2c/0x54
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364550]@0 Modules linked in: wlan(O) rmnet_offload(O) rmnet_shs(O) radio_i2c_rtc6226_qca swr_dmic_dlkm pinctrl_wcd_dlkm wsa_macro_dlkm wcd938x_slave_dlkm oem_aboard native_dlkm camera aw8697 op_rf_cable_monitor hdmi_dlkm platform_dlkm stub_dlkm rx_macro_dlkm machine_dlkm va_macro_dlkm tfa9894_dlkm tri_key wsa883x_dlkm tx_macro_dlkm rdbg swr_ctrl_dlkm wcd938x_dlkm mbhc_dlkm bolero_cdc_dlkm wcd9xxx_dlkm pinctrl_lpi_dlkm q6_dlkm adsp_loader_dlkm slimbus_ngd bt_fm_slim btpower oplus_chg apr_dlkm swr_dlkm q6_notifier_dlkm rmnet_core(O) slimbus rmnet_ctl(O) q6_pdr_dlkm wcd_core_dlkm bootloader_log snd_event_dlkm sim_holder_detect touchscreen gf_spi_driver fingerprint_detect project_info op_cmdline [last unloaded: rmnet_offload]
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364659]@0 CPU: 0 PID: 2689 Comm: ndroid.systemui Tainted: G S      W  O      5.4.61-qgki-g92f5660 #1
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364666]@0 Hardware name: Qualcomm Technologies, Inc. Lahaina MTP lemonadep (DT)
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364675]@0 pstate: 00400085 (nzcv daIf +PAN -UAO)
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364683]@0 pc: del_timer_sync+0x2c/0x54
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364696]@0 lr: __kthread_cancel_work_sync.llvm.15590761224792837501+0x70/0x140
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364703]@0 sp: ffffffc010003a80
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364708]@0 x29: ffffffc010003a80 x28: ffffff803541a500
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364716]@0 x27: ffffffe7adf969b8 x26: ffffffe7adfaa058
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364724]@0 x25: 0000000000000007 x24: ffffffe7af1ff490
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364732]@0 x23: ffffff81f3221700 x22: ffffff81f3221704
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364739]@0 x21: 0000000000000080 x20: ffffff81f3263948
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364747]@0 x19: ffffff81f3263970 x18: ffffffc010005088
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364754]@0 x17: 0000000000000805 x16: ffffff80430e80e0
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364762]@0 x15: ffffff80430e80e8 x14: 0000000000000000
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364770]@0 x13: 0000000000009cf2 x12: 0000000034155555
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364777]@0 x11: 00000000000015b1 x10: 0000000000010103
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364785]@0 x9: 0000000000010102 x8 : 0000000000000000
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364792]@0 x7: 0000000000000000 x6 : ffffffe7af4ca121
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364800]@0 x5: ffffff803541a500 x4 : 0000000000000000
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364807]@0 x3: ffffffc010003988 x2 : 0000000000000001
05-01 09:34:15.365     0     0 W [20210501_09:34:15.364815]@0 x1: 0000000000000080 x0 : ffffff81f3263970
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364822]@0 Call trace:
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364832]@0  del_timer_sync+0x2c/0x54
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364840]@0  __kthread_cancel_work_sync.llvm.15590761224792837501+0x70/0x140
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364848]@0  kthread_cancel_delayed_work_sync+0x14/0x24
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364860]@0  qpnp_pon_input_dispatch+0x250/0x29c
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364868]@0  qpnp_kpdpwr_irq+0x20/0x50
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364877]@0  __handle_irq_event_percpu+0x164/0x358
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364885]@0  handle_irq_event+0x60/0xd8
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364893]@0  handle_edge_irq+0x140/0x3d8
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364900]@0  generic_handle_irq+0x44/0x84
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364911]@0  periph_interrupt+0x98/0x198
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364919]@0  pmic_arb_chained_irq+0x1b8/0x3c0
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364926]@0  __handle_domain_irq+0xa0/0x100
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364936]@0  gic_handle_irq+0xb8/0x15c
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364944]@0  el1_irq+0x104/0x200
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364950]@0  __do_softirq+0x8c/0x3f4
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364960]@0  irq_exit+0xbc/0xc0
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364967]@0  __handle_domain_irq+0xa8/0x100
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364974]@0  gic_handle_irq+0xb8/0x15c
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364980]@0  el1_irq+0x104/0x200
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.364991]@0  _raw_spin_unlock_irq+0x1c/0x50
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.365002]@0  finish_task_switch+0xd8/0x214
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.365009]@0  __schedule+0x624/0x8e0
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.365016]@0  schedule+0x8c/0xc0
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.365025]@0  do_notify_resume+0xa8/0x168
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.365032]@0  work_pending+0x8/0x10
05-01 09:34:15.365     0     0 W         : [20210501_09:34:15.365040]@0 ---[ end trace cc693c9833b3e4ba ]---
05-01 09:34:15.365     0     0 F         : [20210501_09:34:15.365051]@0 panic_flush_device_cache_circled_off

@YuHuang65
Copy link
Contributor

I'm sorry it took so long to reply, could you please what's your problem on your phone now. I need to know the actual problem phenomenon to confirm which module get the problem on your phone.
The log you uploaded will also be printed on normal OnePlus 9Pro, so I can't judge your problem with this log.

@kristofpetho
Copy link
Author

I'm sorry it took so long to reply, could you please what's your problem on your phone now. I need to know the actual problem phenomenon to confirm which module get the problem on your phone.
The log you uploaded will also be printed on normal OnePlus 9Pro, so I can't judge your problem with this log.

Thanks, I just feel like on a production kernel this shouldn't happen. But like you say, it's there on stock and and I don't see any symptoms other than this warning being triggered in the kernel.

anayw2001 pushed a commit to anayw2001/android_kernel_oneplus_sm8350 that referenced this issue Jun 10, 2021
I don't think kthreads are supposed to be IRQ safe but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
lineageos-gerrit pushed a commit to LineageOS/android_kernel_oneplus_sm8350 that referenced this issue Sep 22, 2021
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
SnowCore8 pushed a commit to SnowCore8/android_kernel_oneplus9pro_sm8350 that referenced this issue Oct 20, 2021
This patch implements deduplication feature in zram. The purpose
of this work is naturally to save amount of memory usage by zram.

Android is one of the biggest users to use zram as swap and it's
really important to save amount of memory usage. There is a paper
that reports that duplication ratio of Android's memory content is
rather high [1]. And, there is a similar work on zswap that also
reports that experiments has shown that around 10-15% of pages
stored in zswp are duplicates and deduplicate them provides some
benefits [2].

Also, there is a different kind of workload that uses zram as blockdev
and store build outputs into it to reduce wear-out problem of real
blockdev. In this workload, deduplication hit is very high due to
temporary files and intermediate object files. Detailed analysis is
on the bottom of this description.

Anyway, if we can detect duplicated content and avoid to store duplicated
content at different memory space, we can save memory. This patch
tries to do that.

Implementation is almost simple and intuitive but I should note
one thing about implementation detail.

To check duplication, this patch uses checksum of the page and
collision of this checksum could be possible. There would be
many choices to handle this situation but this patch chooses
to allow entry with duplicated checksum to be added to the hash,
but, not to compare all entries with duplicated checksum
when checking duplication. I guess that checksum collision is quite
rare event and we don't need to pay any attention to such a case.
Therefore, I decided the most simplest way to implement the feature.
If there is a different opinion, I can accept and go that way.

Following is the result of this patch.

Test result #1 (Swap):
Android Marshmallow, emulator, x86_64, Backporting to kernel v3.18

orig_data_size: 145297408
compr_data_size: 32408125
mem_used_total: 32276480
dup_data_size: 3188134
meta_data_size: 1444272

Last two metrics added to mm_stat are related to this work.
First one, dup_data_size, is amount of saved memory by avoiding
to store duplicated page. Later one, meta_data_size, is the amount of
data structure to support deduplication. If dup > meta, we can judge
that the patch improves memory usage.

In Adnroid, we can save 5% of memory usage by this work.

Test result OnePlusOSS#2 (Blockdev):
build the kernel and store output to ext4 FS on zram

<no-dedup>
Elapsed time: 249 s
mm_stat: 430845952 191014886 196898816 0 196898816 28320 0 0 0

<dedup>
Elapsed time: 250 s
mm_stat: 430505984 190971334 148365312 0 148365312 28404 0 47287038  3945792

There is no performance degradation and save 23% memory.

Test result OnePlusOSS#3 (Blockdev):
copy android build output dir(out/host) to ext4 FS on zram

<no-dedup>
Elapsed time: out/host: 88 s
mm_stat: 8834420736 3658184579 3834208256 0 3834208256 32889 0 0 0

<dedup>
Elapsed time: out/host: 100 s
mm_stat: 8832929792 3657329322 2832015360 0 2832015360 32609 0 952568877 80880336

It shows performance degradation roughly 13% and save 24% memory. Maybe,
it is due to overhead of calculating checksum and comparison.

Test result OnePlusOSS#4 (Blockdev):
copy android build output dir(out/target/common) to ext4 FS on zram

<no-dedup>
Elapsed time: out/host: 203 s
mm_stat: 4041678848 2310355010 2346577920 0 2346582016 500 4 0 0

<dedup>
Elapsed time: out/host: 201 s
mm_stat: 4041666560 2310488276 1338150912 0 1338150912 476 0 989088794 24564336

Memory is saved by 42% and performance is the same. Even if there is overhead
of calculating checksum and comparison, large hit ratio compensate it since
hit leads to less compression attempt.

I checked the detailed reason of savings on kernel build workload and
there are some cases that deduplication happens.

1) *.cmd
Build command is usually similar in one directory so content of these file
are very similar. In my system, more than 789 lines in fs/ext4/.namei.o.cmd
and fs/ext4/.inode.o.cmd are the same in 944 and 938 lines of the file,
respectively.

2) intermediate object files
built-in.o and temporary object file have the similar contents. More than
50% of fs/ext4/ext4.o is the same with fs/ext4/built-in.o.

3) vmlinux
.tmp_vmlinux1 and .tmp_vmlinux2 and arch/x86/boo/compressed/vmlinux.bin
have the similar contents.

Android test has similar case that some of object files(.class
and .so) are similar with another ones.
(./host/linux-x86/lib/libartd.so and
./host/linux-x86-lib/libartd-comiler.so)

Anyway, benefit seems to be largely dependent on the workload so
following patch will make this feature optional. However, this feature
can help some usecases so is deserved to be merged.

[1]: MemScope: Analyzing Memory Duplication on Android Systems,
dl.acm.org/citation.cfm?id=2797023
[2]: zswap: Optimize compressed pool memory utilization,
lkml.kernel.org/r/1341407574.7551.1471584870761.JavaMail.weblogic@epwas3p2

Change-Id: I8fe80c956c33f88a6af337d50d9e210e5c35ce37
Reviewed-by: Sergey Senozhatsky <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Signed-off-by: Joonsoo Kim <[email protected]>
Link: https://lore.kernel.org/patchwork/patch/787162/
Patch-mainline: linux-kernel@ Thu, 11 May 2017 22:30:26
Signed-off-by: Charan Teja Reddy <[email protected]>
Signed-off-by: Park Ju Hyung <[email protected]>
SnowCore8 pushed a commit to SnowCore8/android_kernel_oneplus9pro_sm8350 that referenced this issue Nov 23, 2021
This patch implements deduplication feature in zram. The purpose
of this work is naturally to save amount of memory usage by zram.

Android is one of the biggest users to use zram as swap and it's
really important to save amount of memory usage. There is a paper
that reports that duplication ratio of Android's memory content is
rather high [1]. And, there is a similar work on zswap that also
reports that experiments has shown that around 10-15% of pages
stored in zswp are duplicates and deduplicate them provides some
benefits [2].

Also, there is a different kind of workload that uses zram as blockdev
and store build outputs into it to reduce wear-out problem of real
blockdev. In this workload, deduplication hit is very high due to
temporary files and intermediate object files. Detailed analysis is
on the bottom of this description.

Anyway, if we can detect duplicated content and avoid to store duplicated
content at different memory space, we can save memory. This patch
tries to do that.

Implementation is almost simple and intuitive but I should note
one thing about implementation detail.

To check duplication, this patch uses checksum of the page and
collision of this checksum could be possible. There would be
many choices to handle this situation but this patch chooses
to allow entry with duplicated checksum to be added to the hash,
but, not to compare all entries with duplicated checksum
when checking duplication. I guess that checksum collision is quite
rare event and we don't need to pay any attention to such a case.
Therefore, I decided the most simplest way to implement the feature.
If there is a different opinion, I can accept and go that way.

Following is the result of this patch.

Test result #1 (Swap):
Android Marshmallow, emulator, x86_64, Backporting to kernel v3.18

orig_data_size: 145297408
compr_data_size: 32408125
mem_used_total: 32276480
dup_data_size: 3188134
meta_data_size: 1444272

Last two metrics added to mm_stat are related to this work.
First one, dup_data_size, is amount of saved memory by avoiding
to store duplicated page. Later one, meta_data_size, is the amount of
data structure to support deduplication. If dup > meta, we can judge
that the patch improves memory usage.

In Adnroid, we can save 5% of memory usage by this work.

Test result OnePlusOSS#2 (Blockdev):
build the kernel and store output to ext4 FS on zram

<no-dedup>
Elapsed time: 249 s
mm_stat: 430845952 191014886 196898816 0 196898816 28320 0 0 0

<dedup>
Elapsed time: 250 s
mm_stat: 430505984 190971334 148365312 0 148365312 28404 0 47287038  3945792

There is no performance degradation and save 23% memory.

Test result OnePlusOSS#3 (Blockdev):
copy android build output dir(out/host) to ext4 FS on zram

<no-dedup>
Elapsed time: out/host: 88 s
mm_stat: 8834420736 3658184579 3834208256 0 3834208256 32889 0 0 0

<dedup>
Elapsed time: out/host: 100 s
mm_stat: 8832929792 3657329322 2832015360 0 2832015360 32609 0 952568877 80880336

It shows performance degradation roughly 13% and save 24% memory. Maybe,
it is due to overhead of calculating checksum and comparison.

Test result OnePlusOSS#4 (Blockdev):
copy android build output dir(out/target/common) to ext4 FS on zram

<no-dedup>
Elapsed time: out/host: 203 s
mm_stat: 4041678848 2310355010 2346577920 0 2346582016 500 4 0 0

<dedup>
Elapsed time: out/host: 201 s
mm_stat: 4041666560 2310488276 1338150912 0 1338150912 476 0 989088794 24564336

Memory is saved by 42% and performance is the same. Even if there is overhead
of calculating checksum and comparison, large hit ratio compensate it since
hit leads to less compression attempt.

I checked the detailed reason of savings on kernel build workload and
there are some cases that deduplication happens.

1) *.cmd
Build command is usually similar in one directory so content of these file
are very similar. In my system, more than 789 lines in fs/ext4/.namei.o.cmd
and fs/ext4/.inode.o.cmd are the same in 944 and 938 lines of the file,
respectively.

2) intermediate object files
built-in.o and temporary object file have the similar contents. More than
50% of fs/ext4/ext4.o is the same with fs/ext4/built-in.o.

3) vmlinux
.tmp_vmlinux1 and .tmp_vmlinux2 and arch/x86/boo/compressed/vmlinux.bin
have the similar contents.

Android test has similar case that some of object files(.class
and .so) are similar with another ones.
(./host/linux-x86/lib/libartd.so and
./host/linux-x86-lib/libartd-comiler.so)

Anyway, benefit seems to be largely dependent on the workload so
following patch will make this feature optional. However, this feature
can help some usecases so is deserved to be merged.

[1]: MemScope: Analyzing Memory Duplication on Android Systems,
dl.acm.org/citation.cfm?id=2797023
[2]: zswap: Optimize compressed pool memory utilization,
lkml.kernel.org/r/1341407574.7551.1471584870761.JavaMail.weblogic@epwas3p2

Change-Id: I8fe80c956c33f88a6af337d50d9e210e5c35ce37
Reviewed-by: Sergey Senozhatsky <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Signed-off-by: Joonsoo Kim <[email protected]>
Link: https://lore.kernel.org/patchwork/patch/787162/
Patch-mainline: linux-kernel@ Thu, 11 May 2017 22:30:26
Signed-off-by: Charan Teja Reddy <[email protected]>
Signed-off-by: Park Ju Hyung <[email protected]>
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Mar 1, 2022
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Mar 4, 2022
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Mar 4, 2022
…ePlus Nord N200 Oxygen 11.0.2.0.DE17AA

Change-Id: I5b330bd462725059b55db81268b91d274445af83

techpack: oneplus: Remove unnecessary debug info from pstore

Fails compilation on some environments + we don't need it.

Change-Id: Ib348bac230ae30b85de633ba58dfa7e9ce9f9254

disp: msm: sde: Rework PLANE_PROP_ALPHA handling

* matches with our z-order fix

Co-authored-by: alk3pInjection <[email protected]>
Signed-off-by: alk3pInjection <[email protected]>
Change-Id: Ic65ac6dc5489980ed9e2aebc4965b17886de6030

disp: msm: sde: Refactor fod dimming

* Check oneplus_dimlayer_hbm_enable instead of
  fp_index to activate fod dimming mode.

Co-authored-by: alk3pInjection <[email protected]>
Signed-off-by: alk3pInjection <[email protected]>
Change-Id: I8cd87ccab8e8dbbd0653ddbeadb5d8bafb72cd71

input: qpnp-power-on: Fix WARN_ON() after pressing the power button

Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8

techpack: oplus_chg: Fix function prototype related warning

Change-Id: I7b9107c9fd771b0c478fe0158e04327976f7476b
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Mar 4, 2022
…ePlus Nord N200 Oxygen 11.0.2.0.DE17AA

Change-Id: I5b330bd462725059b55db81268b91d274445af83

techpack: oneplus: Remove unnecessary debug info from pstore

Fails compilation on some environments + we don't need it.

Change-Id: Ib348bac230ae30b85de633ba58dfa7e9ce9f9254

disp: msm: sde: Rework PLANE_PROP_ALPHA handling

* matches with our z-order fix

Co-authored-by: alk3pInjection <[email protected]>
Signed-off-by: alk3pInjection <[email protected]>
Change-Id: Ic65ac6dc5489980ed9e2aebc4965b17886de6030

disp: msm: sde: Refactor fod dimming

* Check oneplus_dimlayer_hbm_enable instead of
  fp_index to activate fod dimming mode.

Co-authored-by: alk3pInjection <[email protected]>
Signed-off-by: alk3pInjection <[email protected]>
Change-Id: I8cd87ccab8e8dbbd0653ddbeadb5d8bafb72cd71

input: qpnp-power-on: Fix WARN_ON() after pressing the power button

Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8

techpack: oplus_chg: Fix function prototype related warning

Change-Id: I7b9107c9fd771b0c478fe0158e04327976f7476b
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Apr 14, 2022
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Apr 16, 2022
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Jun 18, 2022
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Jun 18, 2022
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Jun 18, 2022
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
elginsk8r pushed a commit to elginsk8r/android_kernel_oneplus_sm4350 that referenced this issue Jun 30, 2022
Maybe kthreads aren't supposed to be IRQ safe, but at the very
least this gets rid of warning every time power button is up.

Fixes: OnePlusOSS/android_kernel_oneplus_sm8350#2
Change-Id: Ib2030f730d3fc79663a77ae4a2b56a8a08da3ad8
SnowCore8 pushed a commit to SnowCore8/android_kernel_oneplus9pro_sm8350 that referenced this issue Jan 19, 2023
There's a potential deadlock with the following cycle:
wfs_lock --> device_links_lock --> kn->count

Fix this by simply dropping the lock around a list_empty() check that's
just exported to a sysfs file. The sysfs file output is an instantaneous
check anyway and the lock doesn't really add any protection.

Lockdep log:

[   48.808132]
[   48.808132] the existing dependency chain (in reverse order) is:
[   48.809069]
[   48.809069] -> OnePlusOSS#2 (kn->count){++++}:
[   48.809707]        __kernfs_remove.llvm.7860393000964815146+0x2d4/0x460
[   48.810537]        kernfs_remove_by_name_ns+0x54/0x9c
[   48.811171]        sysfs_remove_file_ns+0x18/0x24
[   48.811762]        device_del+0x2b8/0x5a8
[   48.812269]        __device_link_del+0x98/0xb8
[   48.812829]        device_links_driver_bound+0x210/0x2d8
[   48.813496]        driver_bound+0x44/0xf8
[   48.814000]        really_probe+0x340/0x6e0
[   48.814526]        driver_probe_device+0xb8/0x100
[   48.815117]        device_driver_attach+0x78/0xb8
[   48.815708]        __driver_attach+0xe0/0x194
[   48.816255]        bus_for_each_dev+0xa8/0x11c
[   48.816816]        driver_attach+0x24/0x30
[   48.817331]        bus_add_driver+0x100/0x1e0
[   48.817880]        driver_register+0x78/0x114
[   48.818427]        __platform_driver_register+0x44/0x50
[   48.819089]        0xffffffdbb3227038
[   48.819551]        do_one_initcall+0xd8/0x1e0
[   48.820099]        do_init_module+0xd8/0x298
[   48.820636]        load_module+0x3afc/0x44c8
[   48.821173]        __arm64_sys_finit_module+0xbc/0xf0
[   48.821807]        el0_svc_common+0xbc/0x1d0
[   48.822344]        el0_svc_handler+0x74/0x98
[   48.822882]        el0_svc+0x8/0xc
[   48.823310]
[   48.823310] -> #1 (device_links_lock){+.+.}:
[   48.824036]        __mutex_lock_common+0xe0/0xe44
[   48.824626]        mutex_lock_nested+0x28/0x34
[   48.825185]        device_link_add+0xd4/0x4ec
[   48.825734]        of_link_to_suppliers+0x158/0x204
[   48.826347]        of_fwnode_add_links+0x50/0x64
[   48.826928]        device_link_add_missing_supplier_links+0x90/0x11c
[   48.827725]        fw_devlink_resume+0x58/0x130
[   48.828296]        of_platform_default_populate_init+0xb4/0xd0
[   48.829030]        do_one_initcall+0xd8/0x1e0
[   48.829578]        do_initcall_level+0xb8/0xcc
[   48.830137]        do_basic_setup+0x60/0x7c
[   48.830662]        kernel_init_freeable+0x128/0x1ac
[   48.831275]        kernel_init+0x18/0x29c
[   48.831781]        ret_from_fork+0x10/0x18
[   48.832297]
[   48.832297] -> #0 (wfs_lock){+.+.}:
[   48.832922]        __lock_acquire+0xe04/0x2e20
[   48.833480]        lock_acquire+0xbc/0xec
[   48.833984]        __mutex_lock_common+0xe0/0xe44
[   48.834577]        mutex_lock_nested+0x28/0x34
[   48.835136]        waiting_for_supplier_show+0x3c/0x98
[   48.835781]        dev_attr_show+0x48/0xb4
[   48.836295]        sysfs_kf_seq_show+0xe8/0x184
[   48.836864]        kernfs_seq_show+0x48/0x8c
[   48.837401]        seq_read+0x1c8/0x600
[   48.837884]        kernfs_fop_read+0x68/0x204
[   48.838431]        __vfs_read+0x60/0x214
[   48.838925]        vfs_read+0xbc/0x15c
[   48.839397]        ksys_read+0x78/0xe4
[   48.839869]        __arm64_sys_read+0x1c/0x28
[   48.840416]        el0_svc_common+0xbc/0x1d0
[   48.840953]        el0_svc_handler+0x74/0x98
[   48.841490]        el0_svc+0x8/0xc
[   48.841917]
[   48.841917] other info that might help us debug this:
[   48.841917]
[   48.842920] Chain exists of:
[   48.842920]   wfs_lock --> device_links_lock --> kn->count
[   48.842920]
[   48.844152]  Possible unsafe locking scenario:
[   48.844152]
[   48.844895]        CPU0                    CPU1
[   48.845463]        ----                    ----
[   48.846032]   lock(kn->count);
[   48.846417]                                lock(device_links_lock);
[   48.847203]                                lock(kn->count);
[   48.847902]   lock(wfs_lock);
[   48.848276]
[   48.848276]  *** DEADLOCK ***

Reported-by: [email protected]
Signed-off-by: Saravana Kannan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Bug: 171536500
(cherry picked from commit 7008e58c63bc8468e8d16154e25d780198b3ecfc)
Change-Id: Icb98a270d6ff07bcc81a2162ac00493fae6fafe6
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

2 participants