Skip to content

Commit

Permalink
MLK-24045 drm/imx: sec-dsim: let host unregister later than device
Browse files Browse the repository at this point in the history
During the unind() procedure, drm_encoder_cleanup() will
detach the downstream DSI bridge if exists. And the DSI
bridge's detach() will detach itself from the DSI host.
So DSI host should be unregistered later than DSI device
detach. Otherwise, below kernel panic happens:

[    2.437740] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000007
[    2.446534] Mem abort info:
[    2.449327]   ESR = 0x96000004
[    2.452401]   EC = 0x25: DABT (current EL), IL = 32 bits
[    2.457717]   SET = 0, FnV = 0
[    2.460777]   EA = 0, S1PTW = 0
[    2.463921] Data abort info:
[    2.466808]   ISV = 0, ISS = 0x00000004
[    2.470649]   CM = 0, WnR = 0
[    2.473617] [0000000000000007] user address but active_mm is swapper
[    2.479978] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    2.485550] Modules linked in:
[    2.488609] CPU: 0 PID: 188 Comm: kworker/0:2 Not tainted 5.4.24-04902-g14319eb2bae3 #1683
[    2.496871] Hardware name: NXP i.MX8MPlus EVK board (DT)
[    2.502188] Workqueue: events deferred_probe_work_func
[    2.507328] pstate: 80000005 (Nzcv daif -PAN -UAO)
[    2.512121] pc : mipi_dsi_detach+0x10/0x38
[    2.516219] lr : adv7533_detach_dsi+0x18/0x30
[    2.520574] sp : ffff80001242b6e0
[    2.523885] x29: ffff80001242b6e0 x28: ffff8000119d6000
[    2.529196] x27: 0000000000000000 x26: 00000000fffffdfb
[    2.534507] x25: 0000000000000001 x24: ffff8000115159f0
[    2.539819] x23: ffff000176652120 x22: ffff800011b94000
[    2.545132] x21: ffff000177882000 x20: ffff0001778766e8
[    2.550444] x19: ffff000177876880 x18: 0000000000000000
[    2.555756] x17: ffff800011e0d000 x16: 0000000000000000
[    2.561068] x15: 0000000000000004 x14: ffffffffffffffff
[    2.566381] x13: 0000000000000000 x12: ffff0001745765c8
[    2.571694] x11: ffff000174576480 x10: 0000000000000040
[    2.577006] x9 : ffff000176020e98 x8 : ffff000176020e90
[    2.582318] x7 : 0000000000000001 x6 : 0000000000000001
[    2.587630] x5 : 0000000000000000 x4 : 0000000000000000
[    2.592943] x3 : ffff800011a398b0 x2 : ffffffffffffffff
[    2.598255] x1 : ffff0001778d5c00 x0 : ffff0001778d6400
[    2.603569] Call trace:
[    2.606018]  mipi_dsi_detach+0x10/0x38
[    2.609769]  adv7511_bridge_detach+0x6c/0x80
[    2.614041]  drm_bridge_detach+0x2c/0x50
[    2.617964]  drm_encoder_cleanup+0x2c/0xa0
[    2.622063]  imx_sec_dsim_unbind+0x50/0x68
[    2.626159]  component_unbind.isra.0+0x2c/0x50
[    2.630601]  component_bind_all+0x1e0/0x228
[    2.634784]  imx_drm_bind+0xb8/0x150
[    2.638357]  try_to_bring_up_master+0x164/0x1c0
[    2.642887]  __component_add+0xa0/0x168
[    2.646721]  component_add+0x10/0x18
[    2.650297]  lcdifv3_crtc_probe+0x4c/0x78
[    2.654309]  platform_drv_probe+0x50/0xa0
[    2.658317]  really_probe+0xd4/0x318
[    2.661891]  driver_probe_device+0x54/0xe8
[    2.665991]  __device_attach_driver+0x80/0xb8
[    2.670348]  bus_for_each_drv+0x74/0xc0
[    2.674183]  __device_attach+0xdc/0x138
[    2.678020]  device_initial_probe+0x10/0x18
[    2.682204]  bus_probe_device+0x90/0x98
[    2.686042]  device_add+0x378/0x648
[    2.689531]  platform_device_add+0xfc/0x228
[    2.693718]  imx_lcdifv3_probe+0x2b0/0x388
[    2.697814]  platform_drv_probe+0x50/0xa0
[    2.701825]  really_probe+0xd4/0x318
[    2.705403]  driver_probe_device+0x54/0xe8
[    2.709502]  __device_attach_driver+0x80/0xb8
[    2.713859]  bus_for_each_drv+0x74/0xc0
[    2.717696]  __device_attach+0xdc/0x138
[    2.721535]  device_initial_probe+0x10/0x18
[    2.725721]  bus_probe_device+0x90/0x98
[    2.729555]  deferred_probe_work_func+0x64/0x98
[    2.734089]  process_one_work+0x198/0x320
[    2.738100]  worker_thread+0x1f0/0x420
[    2.741850]  kthread+0xf0/0x120
[    2.744993]  ret_from_fork+0x10/0x18
[    2.748573] Code: aa0003e1 f9400000 f9400402 b4000102 (f9400442)
[    2.754667] ---[ end trace 756e3cdcc6c5557e ]---

Signed-off-by: Fancy Fang <[email protected]>
  • Loading branch information
fancyfly committed May 18, 2020
1 parent f2678ec commit ac04084
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/imx/sec_mipi_dsim-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ static void imx_sec_dsim_unbind(struct device *dev, struct device *master,

pm_runtime_disable(dev);

sec_mipi_dsim_unbind(dev, master, data);

drm_encoder_cleanup(&dsim_dev->encoder);

sec_mipi_dsim_unbind(dev, master, data);

sec_dsim_of_put_resets(dsim_dev);
}

Expand Down

0 comments on commit ac04084

Please sign in to comment.