Unbinding the msm_dpu component master and binding it again fails in several places on X1E80100. With the GPU firmware installed:
echo ae01000.display-controller > /sys/bus/platform/drivers/msm_dpu/unbind echo ae01000.display-controller > /sys/bus/platform/drivers/msm_dpu/bind By where the failure shows up: - unbind: the self-refresh entry work runs on the freed DRM device (patch 1), and buffers are freed while still pinned or vmapped: the fbdev buffer (patch 3), the SQE and shadow BOs (patches 4-5) - bind: the eDP panel was freed on unbind (patch 2), and the GPU fails to bind because leaked BOs keep its VM and SMMU context bank alive (patch 6) and the GMU rscc/PDC regions are never released (patch 7) - first GPU power-up after bind: the GMU is warm booted without its firmware (patch 8), and the PDC left asleep by the previous GPU instance is never woken up (patch 9) Each patch can be applied on its own, except patch 9 which needs patch 8. Not covered here: removing the DP controller device (rmmod msm) still crashes, as the devm AUX bus teardown from commit e2969ee30252 runs after msm_dp_display_remove() has freed the AUX channel and cleared the drvdata. With patch 2 this happens whenever an eDP panel is present. This is independent of unbind/bind and will be fixed separately. Tested on hamoa-iot-evk and hamoa-advantech-som-5830 (with [1]) [1] https://lore.kernel.org/r/[email protected] Signed-off-by: Yuanjie Yang <[email protected]> --- Yuanjie Yang (9): drm/msm/dpu: clean up the self-refresh helper on KMS teardown drm/msm/dp: don't depopulate the eDP AUX bus on component unbind drm/msm: unpin the fbdev buffer when the fbdev is destroyed drm/msm/a6xx: don't leak the SQE vmap in a6xx_ucode_check_version() drm/msm/a6xx: drop the shadow BO vmap on destroy drm/msm/a6xx: free the preemption and pwrup_reglist buffers on destroy drm/msm/a6xx: map the GMU rscc and PDC regions against the GPU device drm/msm/a6xx: cold boot the GMU on the first resume after bind drm/msm/a6xx: wake up a PDC left asleep by a previous GPU instance drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 41 +++++++++++++++++++++++++------ drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 1 + drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 16 +++++++----- drivers/gpu/drm/msm/adreno/a6xx_preempt.c | 9 ++++++- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +++++ drivers/gpu/drm/msm/dp/dp_display.c | 2 -- drivers/gpu/drm/msm/msm_fbdev.c | 3 +++ 7 files changed, 61 insertions(+), 17 deletions(-) --- base-commit: 9437046953b2fb3bf55b36582450ea0267df82a7 change-id: 20261126-dpu_unbind_rebind_display-db9931c173dc Best regards, -- Yuanjie Yang <[email protected]>
