1. 23 Jun, 2022 2 commits
    • Kuogee Hsieh's avatar
      drm/msm/dp: reset drm_dev to NULL at dp_display_unbind() · 0769d0a7
      Kuogee Hsieh authored
      During msm initialize phase, dp_display_unbind() will be called to undo
      initializations had been done by dp_display_bind() previously if there is
      error happen at msm_drm_bind. Under this kind of circumstance, drm_device
      may not be populated completed which causes system crash at drm_dev_dbg().
      This patch reset drm_dev to NULL so that following drm_dev_dbg() will not
      refer to any internal fields of drm_device to prevent system from crashing.
      Below are panic stack trace,
      
      [   53.584904] Unable to handle kernel paging request at virtual address 0000000070018001
      .
      [   53.702212] Hardware name: Qualcomm Technologies, Inc. sc7280 CRD platform (rev5+) (DT)
      [   53.710445] pstate: 20400009 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [   53.717596] pc : string_nocheck+0x1c/0x64
      [   53.721738] lr : string+0x54/0x60
      [   53.725162] sp : ffffffc013d6b650
      [   53.728590] pmr_save: 000000e0
      [   53.731743] x29: ffffffc013d6b650 x28: 0000000000000002 x27: 0000000000ffffff
      [   53.739083] x26: ffffffc013d6b710 x25: ffffffd07a066ae0 x24: ffffffd07a419f97
      [   53.746420] x23: ffffffd07a419f99 x22: ffffff81fef360d4 x21: ffffff81fef364d4
      [   53.753760] x20: ffffffc013d6b6f8 x19: ffffffd07a06683c x18: 0000000000000000
      [   53.761093] x17: 4020386678302f30 x16: 00000000000000b0 x15: ffffffd0797523c8
      [   53.768429] x14: 0000000000000004 x13: ffff0000ffffff00 x12: ffffffd07a066b2c
      [   53.775780] x11: 0000000000000000 x10: 000000000000013c x9 : 0000000000000000
      [   53.783117] x8 : ffffff81fef364d4 x7 : 0000000000000000 x6 : 0000000000000000
      [   53.790445] x5 : 0000000000000000 x4 : ffff0a00ffffff04 x3 : ffff0a00ffffff04
      [   53.797783] x2 : 0000000070018001 x1 : ffffffffffffffff x0 : ffffff81fef360d4
      [   53.805136] Call trace:
      [   53.807667]  string_nocheck+0x1c/0x64
      [   53.811439]  string+0x54/0x60
      [   53.814498]  vsnprintf+0x374/0x53c
      [   53.818009]  pointer+0x3dc/0x40c
      [   53.821340]  vsnprintf+0x398/0x53c
      [   53.824854]  vscnprintf+0x3c/0x88
      [   53.828274]  __trace_array_vprintk+0xcc/0x2d4
      [   53.832768]  trace_array_printk+0x8c/0xb4
      [   53.836900]  drm_trace_printf+0x74/0x9c
      [   53.840875]  drm_dev_dbg+0xfc/0x1b8
      [   53.844480]  dp_pm_suspend+0x70/0xf8
      [   53.848164]  dpm_run_callback+0x60/0x1a0
      [   53.852222]  __device_suspend+0x304/0x3f4
      [   53.856363]  dpm_suspend+0xf8/0x3a8
      [   53.859959]  dpm_suspend_start+0x8c/0xc0
      
      Fixes: 570d3e5d ("drm/msm/dp: stop event kernel thread when DP unbind")
      Signed-off-by: default avatarKuogee Hsieh <quic_khsieh@quicinc.com>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
      Patchwork: https://patchwork.freedesktop.org/patch/490756/
      Link: https://lore.kernel.org/r/1655927731-22396-1-git-send-email-quic_khsieh@quicinc.comSigned-off-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
      0769d0a7
    • Stephen Boyd's avatar
      drm/msm/dpu: Increment vsync_cnt before waking up userspace · c28d76d3
      Stephen Boyd authored
      The 'vsync_cnt' is used to count the number of frames for a crtc.
      Unfortunately, we increment the count after waking up userspace via
      dpu_crtc_vblank_callback() calling drm_crtc_handle_vblank().
      drm_crtc_handle_vblank() wakes up userspace processes that have called
      drm_wait_vblank_ioctl(), and if that ioctl is expecting the count to
      increase it won't.
      
      Increment the count before calling into the drm APIs so that we don't
      have to worry about ordering the increment with anything else in drm.
      This fixes a software video decode test that fails to see frame counts
      increase on Trogdor boards.
      
      Cc: Mark Yacoub <markyacoub@chromium.org>
      Cc: Jessica Zhang <quic_jesszhan@quicinc.com>
      Fixes: 885455d6 ("drm/msm: Change dpu_crtc_get_vblank_counter to use vsync count.")
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # Trogdor (sc7180)
      Patchwork: https://patchwork.freedesktop.org/patch/490531/
      Link: https://lore.kernel.org/r/20220622023855.2970913-1-swboyd@chromium.orgSigned-off-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
      c28d76d3
  2. 18 Jun, 2022 6 commits
  3. 15 Jun, 2022 2 commits
  4. 14 Jun, 2022 1 commit
  5. 13 Jun, 2022 1 commit
  6. 07 Jun, 2022 1 commit
    • Maximilian Luz's avatar
      drm/msm: Fix double pm_runtime_disable() call · ce0db505
      Maximilian Luz authored
      Following commit 17e822f7 ("drm/msm: fix unbalanced
      pm_runtime_enable in adreno_gpu_{init, cleanup}"), any call to
      adreno_unbind() will disable runtime PM twice, as indicated by the call
      trees below:
      
        adreno_unbind()
         -> pm_runtime_force_suspend()
         -> pm_runtime_disable()
      
        adreno_unbind()
         -> gpu->funcs->destroy() [= aNxx_destroy()]
         -> adreno_gpu_cleanup()
         -> pm_runtime_disable()
      
      Note that pm_runtime_force_suspend() is called right before
      gpu->funcs->destroy() and both functions are called unconditionally.
      
      With recent addition of the eDP AUX bus code, this problem manifests
      itself when the eDP panel cannot be found yet and probing is deferred.
      On the first probe attempt, we disable runtime PM twice as described
      above. This then causes any later probe attempt to fail with
      
        [drm:adreno_load_gpu [msm]] *ERROR* Couldn't power up the GPU: -13
      
      preventing the driver from loading.
      
      As there seem to be scenarios where the aNxx_destroy() functions are not
      called from adreno_unbind(), simply removing pm_runtime_disable() from
      inside adreno_unbind() does not seem to be the proper fix. This is what
      commit 17e822f7 ("drm/msm: fix unbalanced pm_runtime_enable in
      adreno_gpu_{init, cleanup}") intended to fix. Therefore, instead check
      whether runtime PM is still enabled, and only disable it in that case.
      
      Fixes: 17e822f7 ("drm/msm: fix unbalanced pm_runtime_enable in adreno_gpu_{init, cleanup}")
      Signed-off-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
      Tested-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      Link: https://lore.kernel.org/r/20220606211305.189585-1-luzmaximilian@gmail.comSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
      ce0db505
  7. 02 Jun, 2022 2 commits
  8. 01 Jun, 2022 5 commits
  9. 19 May, 2022 2 commits
  10. 18 May, 2022 7 commits
  11. 07 May, 2022 3 commits
  12. 06 May, 2022 8 commits