Skip to content

BL_INTERNAL: power_supply: bq27xxx: fix probe crash without battery

continue the battery setup even if the Battery is not connected. This will allocate missing structures and avoid a boot crash

crash trace:

[    0.978717] Unable to handle kernel read from unreadable memory at virtual address ffff800011c65060
[    0.980414] Mem abort info:
[    0.981314]   ESR = 0x8600000f
[    0.986888] Internal error: Oops: 8600000f [#1] PREEMPT SMP
[    0.988340] Modules linked in:
[    0.989407] CPU: 0 PID: 35 Comm: kworker/0:1 Not tainted 5.4.184-android12-9-g5d6de8f841b1 #1
[    0.990478] Hardware name: MT8365 H200 (DT)
[    0.993471] pc : mtk_thermal_driver+0x28/0xf0
[    0.994411] lr : power_supply_get_property+0x24/0x48
[    0.995035] sp : ffff8000101e3d10
[    0.995037] x29: ffff8000101e3d10 x28: 0000000000000402
[    0.995042] x27: ffff00007bb7d120 x26: 000000007bb80e05
[    0.995046] x25: 0000000000000000 x24: ffff000078de0210
[    0.995049] x23: ffff000076e60be8 x22: ffff00007bb7d100
[    0.995053] x21: 0000000000000000 x20: ffff000076e60800
[    0.995057] x19: ffff000076e60800 x18: ffff8000101a5030
[    0.996185] mtk_vpu-rproc 19180000.vpu0: assigned reserved memory node vpu_ram@0x60000000
[    0.996234] x17: 000000000000057d x16: 00000000000000f1
[    0.996973] remoteproc remoteproc0: apu is available
[    0.997570] x15: 0000000000000000 x14: 0000000000100000
[    0.999978] mtk-iommu 10205000.iommu: bound 14003000.larb (ops mtk_smi_larb_component_ops)
[    1.000239] x13: 0000000000000400 x12: 0000000000000010
[    1.001273] mtk-iommu 10205000.iommu: bound 17010000.larb (ops mtk_smi_larb_component_ops)
[    1.001934] x11: 0000000000000000 x10: 0000000000000001
[    1.002561] mtk-iommu 10205000.iommu: bound 15001000.larb (ops mtk_smi_larb_component_ops)
[    1.003222] x9 : fde181e0fd6d6e00 x8 : ffff800011c65060
[    1.003226] x7 : 0000000000000000 x6 : 000000000000003f
[    1.003229] x5 : 0000000000000040 x4 : 0000000000000004
[    1.003233] x3 : ffff800010b9f664 x2 : ffff8000101e3d30
[    1.003237] x1 : 0000000000000004 x0 : ffff000076e60800
[    1.004943] Call trace:
[    1.008352]  mtk_thermal_driver+0x28/0xf0
[    1.009689]  power_supply_update_leds+0xa0/0x150
[    1.011020]  power_supply_changed_work+0x68/0xcc
[    1.011026]  process_one_work+0x1f8/0x494
[    1.011030]  worker_thread+0x280/0x50c
[    1.011035]  kthread+0x138/0x154
[    1.011040]  ret_from_fork+0x10/0x18
[    1.012404] ---[ end trace c7e8a2dd3fe8df22 ]---

Signed-off-by: Riadh Ghaddab rghaddab@baylibre.com

Edited by Riadh Ghaddab

Merge request reports