msm8226-mainline / linux

Mainline Kernel fork for MSM8x26 devices
Other
2 stars 5 forks source link

milletwifi: DSI causes kernel error #13

Open NekoCWD opened 3 months ago

NekoCWD commented 3 months ago

What's wrong?

When i enable mdss in dts, tablet doesn't boot

Error log

[    1.922228] platform fd900100.display-controller: Fixed dependency cycle(s) with /soc/display-subsystem@fd900000/dsi@fd922800
[    1.928493] platform fd900100.display-controller: Fixed dependency cycle(s) with /soc/display-subsystem@fd900000/dsi@fd922800
[    1.939164] platform fd922800.dsi: Fixed dependency cycle(s) with /soc/display-subsystem@fd900000/dsi@fd922800/panel@0
[    1.950290] platform fd922800.dsi: Fixed dependency cycle(s) with /soc/display-subsystem@fd900000/display-controller@fd900000
[    1.963003] 8<--- cut here ---
[    1.972183] Unhandled fault: external abort on non-linefetch (0x008) at 0xf0dcba00
[    1.975140] [f0dcba00] *pgd=016f1811, *pte=fd922653, *ppte=fd922453
[    1.982694] Internal error: : 8 [#1] PREEMPT SMP ARM
[    1.988853] Modules linked in:
[    1.994060] CPU: 3 PID: 82 Comm: kworker/u11:1 Not tainted 6.8.1 #1
[    1.996926] Hardware name: Generic DT based system
[    2.003090] Workqueue: events_unbound deferred_probe_work_func
[    2.007951] PC is at dsi_pll_28nm_clk_recalc_rate+0xc/0x100
[    2.013765] LR is at __clk_register+0x564/0x8c4
[    2.019234] pc : [<c06e92c8>]    lr : [<c05a4810>]    psr: a0000013
[    2.023749] sp : f0c39af8  ip : 00000000  fp : 00000001
[    2.029998] r10: c0ff2370  r9 : c1656ec0  r8 : 00000000
[    2.035205] r7 : f0c39bb0  r6 : f0dcba00  r5 : c1693000  r4 : c2932300
[    2.040415] r3 : c1690040  r2 : 00000001  r1 : 0124f800  r0 : c1656ec0
[    2.047014] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[    2.053527] Control: 10c5387d  Table: 0000406a  DAC: 00000051
[    2.060728] Register r0 information: slab kmalloc-128 start c1656e80 pointer offset 64 size 128
[    2.066460] Register r1 information: non-paged memory
[    2.074964] Register r2 information: non-paged memory
[    2.080171] Register r3 information: slab kmalloc-256 start c1690000 pointer offset 64 size 256
[    2.085210] Register r4 information: slab kmalloc-192 start c2932300 pointer offset 0 size 192
[    2.093717] Register r5 information: slab kmalloc-192 start c1693000 pointer offset 0 size 192
[    2.102398] Register r6 information: 0-page vmalloc region starting at 0xf0dcb000 allocated at devm_ioremap+0x4c/0x88
[    2.110995] Register r7 information: 2-page vmalloc region starting at 0xf0c38000 allocated at kernel_clone+0xa4/0x33c
[    2.121672] Register r8 information: NULL pointer
[    2.132255] Register r9 information: slab kmalloc-128 start c1656e80 pointer offset 64 size 128
[    2.137034] Register r10 information: non-slab/vmalloc memory
[    2.145536] Register r11 information: non-paged memory
[    2.151439] Register r12 information: NULL pointer
[    2.156473] Process kworker/u11:1 (pid: 82, stack limit = 0x(ptrval))
[    2.161249] Stack: (0xf0c39af8 to 0xf0c3a000)
[    2.167760] 9ae0:                                                       c2932300 c1693000
[    2.172110] 9b00: 00000000 f0c39bb0 00000000 c05a4810 ffffffff c05a4cf4 fffffff3 f0c39ba0
[    2.180269] 9b20: 00000000 c1692180 c1656ec0 c0ff2370 c16569c0 c2465c10 c1656f40 c1656ec0
[    2.188428] 9b40: f0c39bd4 c2465c10 c16569c0 00000000 c12ccaa8 c05a4d1c c0f562d4 6f1056cf
[    2.196588] 9b60: c1690040 c1656ec0 c1690040 c06e9524 00000003 f0c39bbc c26a0000 c0163ee4
[    2.204749] 9b80: c15b5094 c01647f0 c2465c10 c070fe6c c2465c10 c15b5010 00000000 c2465c10
[    2.212908] 9ba0: 00000000 c0f52144 c0f56f08 00000000 f0c39bd4 c0db1f34 00000000 f0c39ba0
[    2.221068] 9bc0: 00000000 00000001 00000008 c2465c10 60000013 30697364 5f6f6376 006b6c63
[    2.229226] 9be0: 00000000 00000000 00000000 00000000 00000000 6f1056cf c2465c00 c1690040
[    2.237386] 9c00: c2465c00 00000000 c2465c10 00000000 ef3f593c 00000000 c12ccaa8 c06e6fb8
[    2.245547] 9c20: 00000000 6f1056cf 00000000 6f1056cf 00000000 c2465c10 c12cc388 c12f1080
[    2.253706] 9c40: 00000000 c0703038 c2465c10 00000000 c12cc388 c12f1080 00000000 c07004a4
[    2.261866] 9c60: c2465c94 c070f3a4 c2465c10 c12cc388 c2465c10 00000019 c12f0d50 c0700858
[    2.270027] 9c80: 60000013 ef3f593c c13473e4 c12cc388 c2465c10 00000019 c12f0d50 c07009e0
[    2.278186] 9ca0: 00000001 c12cc388 f0c39cfc c2465c10 c12f0d50 c0700b18 00000000 c141cf00
[    2.286345] 9cc0: f0c39cfc c0700a70 c12f0d50 c06fe478 c141cf00 c141cf6c c253d138 6f1056cf
[    2.294505] 9ce0: c12ccaa8 c2465c10 00000001 c2465c54 c141cf00 c0700f7c ef3f5938 c2465c10
[    2.302665] 9d00: 00000001 6f1056cf c2465c10 00000000 c2465c10 c06ff478 c2465c10 00000000
[    2.310824] 9d20: c13473b4 c15b5010 c12f0d50 c06fcd1c 00000000 00000000 00000000 00000000
[    2.318985] 9d40: 00000000 6f1056cf 00000000 c2465c00 00000000 ef3f5994 ef3f5930 00000000
[    2.327143] 9d60: 00000001 00000000 ef3f5994 c08eb904 ef3f5930 00000000 00000000 00000000
[    2.335303] 9d80: c15b5010 c08ebb20 c2941218 c132c0f0 00000000 c2941200 c0d412ac 00000000
[    2.343463] 9da0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6f1056cf
[    2.351624] 9dc0: 00000160 ef3f5930 ef3f4400 00000000 00000000 c15b5010 00000001 00000000
[    2.359782] 9de0: 00000000 c08ebfb8 00000001 c15b5010 c29ed2c0 c15b5000 c15b5010 00000031
[    2.367942] 9e00: c15b5010 c29ed540 00000160 c06bd24c c0dabdb4 c29ed2c0 c15b5010 00000000
[    2.376103] 9e20: c15b5010 c12cbae4 c12f1080 00000000 c141cd0d c0703038 c15b5010 00000000
[    2.384262] 9e40: c12cbae4 c12f1080 00000000 c07004a4 c15b5094 c070f3a4 c15b5010 c12cbae4
[    2.392423] 9e60: c15b5010 00000019 00000000 c0700858 60000013 c141cd0d c13473e4 c12cbae4
[    2.400581] 9e80: c15b5010 00000019 00000000 c07009e0 00000001 c12cbae4 f0c39eec c15b5010
[    2.408742] 9ea0: 00000000 c0700b18 00000000 c141cf00 f0c39eec c0700a70 00000000 c06fe478
[    2.416901] 9ec0: c141cf00 c141cf6c c253d4b8 6f1056cf 00000000 c15b5010 00000001 c15b5054
[    2.425060] 9ee0: c141cf00 c0700f7c 00000001 c15b5010 00000001 6f1056cf c15b5010 c12ccd28
[    2.433221] 9f00: c15b5010 c06ff478 c15b5010 c12ccd28 c12ccd3c c12f1080 00000000 c06ff994
[    2.441380] 9f20: c1463100 c12ccd60 c141cd00 c1407000 c26a0000 c0139b10 c1407020 61c88647
[    2.449540] 9f40: c1463100 c1407000 c1203d40 c1407020 61c88647 c146312c c26a0000 c0139ee4
[    2.457699] 9f60: f08b9ec8 00000000 f0c39f7c c14430c0 c26a0000 c0139c68 c1463100 c16f30c0
[    2.465860] 9f80: f08b9ec8 00000000 00000000 c014285c c14430c0 c014274c 00000000 00000000
[    2.474019] 9fa0: 00000000 00000000 00000000 c010014c 00000000 00000000 00000000 00000000
[    2.482178] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.490337] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[    2.498501]  dsi_pll_28nm_clk_recalc_rate from __clk_register+0x564/0x8c4
[    2.506652]  __clk_register from devm_clk_hw_register+0x5c/0xc0
[    2.513420]  devm_clk_hw_register from dsi_pll_28nm_init+0x114/0x38c
[    2.519150]  dsi_pll_28nm_init from dsi_phy_driver_probe+0x25c/0x3e4
[    2.525748]  dsi_phy_driver_probe from platform_probe+0x5c/0xb0
[    2.532084]  platform_probe from really_probe+0xe0/0x3f8
[    2.537725]  really_probe from __driver_probe_device+0x9c/0x1f4
[    2.543281]  __driver_probe_device from driver_probe_device+0x30/0xc0
[    2.548925]  driver_probe_device from __device_attach_driver+0xa8/0x120
[    2.555522]  __device_attach_driver from bus_for_each_drv+0x90/0xe4
[    2.561946]  bus_for_each_drv from __device_attach+0xa8/0x1d8
[    2.568194]  __device_attach from bus_probe_device+0x88/0x8c
[    2.574098]  bus_probe_device from device_add+0x624/0x830
[    2.579827]  device_add from of_platform_device_create_pdata+0x94/0xc0
[    2.585123]  of_platform_device_create_pdata from of_platform_bus_create+0x1e4/0x4c8
[    2.591548]  of_platform_bus_create from of_platform_populate+0x88/0x10c
[    2.599446]  of_platform_populate from mdss_probe+0x220/0x350
[    2.606129]  mdss_probe from platform_probe+0x5c/0xb0
[    2.611770]  platform_probe from really_probe+0xe0/0x3f8
[    2.616804]  really_probe from __driver_probe_device+0x9c/0x1f4
[    2.622188]  __driver_probe_device from driver_probe_device+0x30/0xc0
[    2.627830]  driver_probe_device from __device_attach_driver+0xa8/0x120
[    2.634428]  __device_attach_driver from bus_for_each_drv+0x90/0xe4
[    2.640851]  bus_for_each_drv from __device_attach+0xa8/0x1d8
[    2.647100]  __device_attach from bus_probe_device+0x88/0x8c
[    2.653003]  bus_probe_device from deferred_probe_work_func+0x8c/0xd4
[    2.658733]  deferred_probe_work_func from process_one_work+0x140/0x298
[    2.665071]  process_one_work from worker_thread+0x27c/0x4ac
[    2.671493]  worker_thread from kthread+0x110/0x12c
[    2.677396]  kthread from ret_from_fork+0x14/0x28
[    2.681995] Exception stack(0xf0c39fb0 to 0xf0c39ff8)
[    2.686859] 9fa0:                                     00000000 00000000 00000000 00000000
[    2.691900] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.700058] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    2.708220] Code: e8bd8070 e92d41f0 e590300c e5936008 (e5964000) 
[    2.714636] ---[ end trace 0000000000000000 ]---
[    2.720883] note: kworker/u11:1[82] exited with irqs disabled

https://pastebin.com/LAVzpGL2`

z3ntu commented 3 months ago

Copying some text from Matrix:

void __iomem *base = pll_28nm->phy->pll_base;

and error accured when any read called. example:

dsi_phy_read(base + REG_DSI_28nm_PHY_PLL_REFCLK_CFG)

dsi pll reg should be coming from here https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi#L1005 plus whatever offsets the driver might have

Yeah so phy->pll_base = msm_ioremap_size(pdev, "dsi_pll", &phy->pll_size); so that should be 0xfd922a00 and since REG_DSI_28nm_PHY_PLL_REFCLK_CFG is 0x0 it's just that value

Can you run this in lk2nd?

$ fastboot oem readl 0xfd922a00

For me the output is

(bootloader) 0x00000001

But this also works on the Samsung:

For me also

(bootloader) 0x00000001

And for reference, with this patch I get the following print

[    1.160583] dsi_pll_28nm_clk_recalc_rate:253 DBG base=f0e72a00
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
index ceec7bb87bf1..9ed29cd224a0 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
@@ -250,6 +250,7 @@ static unsigned long dsi_pll_28nm_clk_recalc_rate(struct clk_hw *hw,
    VERB("parent_rate=%lu", parent_rate);

    /* Check to see if the ref clk doubler is enabled */
+   printk(KERN_ERR "%s:%d DBG base=%px\n", __func__, __LINE__, base);
    doubler = dsi_phy_read(base + REG_DSI_28nm_PHY_PLL_REFCLK_CFG) &
            DSI_28nm_PHY_PLL_REFCLK_CFG_DBLR;
    ref_clk += (doubler * VCO_REF_CLK_RATE);
Susurrus commented 3 months ago

Were there any DTS changes necessary to get this working?

z3ntu commented 3 months ago

@NekoCWD Would have to share what they did, I don't have that diff/branch.

NekoCWD commented 3 months ago

https://github.com/NekoCWD/msm8226-linux/tree/milletwifi-display-debug-8.8.y