1. 09 Jun, 2023 2 commits
    • Dmitry Baryshkov's avatar
      drm/msm/a6xx: initialize GMU mutex earlier · 12abd735
      Dmitry Baryshkov authored
      Move GMU mutex initialization earlier to make sure that it is always
      initialized. a6xx_destroy can be called from ther failure path before
      GMU initialization.
      
      This fixes the following backtrace:
      
      ------------[ cut here ]------------
      DEBUG_LOCKS_WARN_ON(lock->magic != lock)
      WARNING: CPU: 0 PID: 58 at kernel/locking/mutex.c:582 __mutex_lock+0x1ec/0x3d0
      Modules linked in:
      CPU: 0 PID: 58 Comm: kworker/u16:1 Not tainted 6.3.0-rc5-00155-g187c06436519 #565
      Hardware name: Qualcomm Technologies, Inc. SM8350 HDK (DT)
      Workqueue: events_unbound deferred_probe_work_func
      pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      pc : __mutex_lock+0x1ec/0x3d0
      lr : __mutex_lock+0x1ec/0x3d0
      sp : ffff800008993620
      x29: ffff800008993620 x28: 0000000000000002 x27: ffff47b253c52800
      x26: 0000000001000606 x25: ffff47b240bb2810 x24: fffffffffffffff4
      x23: 0000000000000000 x22: ffffc38bba15ac14 x21: 0000000000000002
      x20: ffff800008993690 x19: ffff47b2430cc668 x18: fffffffffffe98f0
      x17: 6f74616c75676572 x16: 20796d6d75642067 x15: 0000000000000038
      x14: 0000000000000000 x13: ffffc38bbba050b8 x12: 0000000000000666
      x11: 0000000000000222 x10: ffffc38bbba603e8 x9 : ffffc38bbba050b8
      x8 : 00000000ffffefff x7 : ffffc38bbba5d0b8 x6 : 0000000000000222
      x5 : 000000000000bff4 x4 : 40000000fffff222 x3 : 0000000000000000
      x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff47b240cb1880
      Call trace:
       __mutex_lock+0x1ec/0x3d0
       mutex_lock_nested+0x2c/0x38
       a6xx_destroy+0xa0/0x138
       a6xx_gpu_init+0x41c/0x618
       adreno_bind+0x188/0x290
       component_bind_all+0x118/0x248
       msm_drm_bind+0x1c0/0x670
       try_to_bring_up_aggregate_device+0x164/0x1d0
       __component_add+0xa8/0x16c
       component_add+0x14/0x20
       dsi_dev_attach+0x20/0x2c
       dsi_host_attach+0x9c/0x144
       devm_mipi_dsi_attach+0x34/0xac
       lt9611uxc_attach_dsi.isra.0+0x84/0xfc
       lt9611uxc_probe+0x5b8/0x67c
       i2c_device_probe+0x1ac/0x358
       really_probe+0x148/0x2ac
       __driver_probe_device+0x78/0xe0
       driver_probe_device+0x3c/0x160
       __device_attach_driver+0xb8/0x138
       bus_for_each_drv+0x84/0xe0
       __device_attach+0x9c/0x188
       device_initial_probe+0x14/0x20
       bus_probe_device+0xac/0xb0
       deferred_probe_work_func+0x8c/0xc8
       process_one_work+0x2bc/0x594
       worker_thread+0x228/0x438
       kthread+0x108/0x10c
       ret_from_fork+0x10/0x20
      irq event stamp: 299345
      hardirqs last  enabled at (299345): [<ffffc38bb9ba61e4>] put_cpu_partial+0x1c8/0x22c
      hardirqs last disabled at (299344): [<ffffc38bb9ba61dc>] put_cpu_partial+0x1c0/0x22c
      softirqs last  enabled at (296752): [<ffffc38bb9890434>] _stext+0x434/0x4e8
      softirqs last disabled at (296741): [<ffffc38bb989669c>] ____do_softirq+0x10/0x1c
      ---[ end trace 0000000000000000 ]---
      
      Fixes: 4cd15a3e ("drm/msm/a6xx: Make GPU destroy a bit safer")
      Cc: Douglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Patchwork: https://patchwork.freedesktop.org/patch/531540/Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      12abd735
    • Kuogee Hsieh's avatar
      drm/msm/dp: enable HDP plugin/unplugged interrupts at hpd_enable/disable · a8e981ac
      Kuogee Hsieh authored
      The internal_hpd flag is set to true by dp_bridge_hpd_enable() and set to
      false by dp_bridge_hpd_disable() to handle GPIO pinmuxed into DP controller
      case. HDP related interrupts can not be enabled until internal_hpd is set
      to true. At current implementation dp_display_config_hpd() will initialize
      DP host controller first followed by enabling HDP related interrupts if
      internal_hpd was true at that time. Enable HDP related interrupts depends on
      internal_hpd status may leave system with DP driver host is in running state
      but without HDP related interrupts being enabled. This will prevent external
      display from being detected. Eliminated this dependency by moving HDP related
      interrupts enable/disable be done at dp_bridge_hpd_enable/disable() directly
      regardless of internal_hpd status.
      
      Changes in V3:
      -- dp_catalog_ctrl_hpd_enable() and dp_catalog_ctrl_hpd_disable()
      -- rewording ocmmit text
      
      Changes in V4:
      -- replace dp_display_config_hpd() with dp_display_host_start()
      -- move enable_irq() at dp_display_host_start();
      
      Changes in V5:
      -- replace dp_display_host_start() with dp_display_host_init()
      
      Changes in V6:
      -- squash remove enable_irq() and disable_irq()
      
      Fixes: cd198cad ("drm/msm/dp: Rely on hpd_enable/disable callbacks")
      Signed-off-by: default avatarKuogee Hsieh <quic_khsieh@quicinc.com>
      Tested-by: Leonard Lausen <leonard@lausen.nl> # on sc7180 lazor
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Reviewed-by: default avatarBjorn Andersson <andersson@kernel.org>
      Tested-by: default avatarBjorn Andersson <andersson@kernel.org>
      Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
      Link: https://lore.kernel.org/r/1684878756-17830-1-git-send-email-quic_khsieh@quicinc.comSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
      a8e981ac
  2. 25 May, 2023 2 commits
    • Abhinav Kumar's avatar
      drm/msm/dp: add module parameter for PSR · b78c7727
      Abhinav Kumar authored
      On sc7280 where eDP is the primary display, PSR is causing
      IGT breakage even for basic test cases like kms_atomic and
      kms_atomic_transition. Most often the issue starts with below
      stack so providing that as reference
      
      Call trace:
       dpu_encoder_assign_crtc+0x64/0x6c
       dpu_crtc_enable+0x188/0x204
       drm_atomic_helper_commit_modeset_enables+0xc0/0x274
       msm_atomic_commit_tail+0x1a8/0x68c
       commit_tail+0xb0/0x160
       drm_atomic_helper_commit+0x11c/0x124
       drm_atomic_commit+0xb0/0xdc
       drm_atomic_connector_commit_dpms+0xf4/0x110
       drm_mode_obj_set_property_ioctl+0x16c/0x3b0
       drm_connector_property_set_ioctl+0x4c/0x74
       drm_ioctl_kernel+0xec/0x15c
       drm_ioctl+0x264/0x408
       __arm64_sys_ioctl+0x9c/0xd4
       invoke_syscall+0x4c/0x110
       el0_svc_common+0x94/0xfc
       do_el0_svc+0x3c/0xb0
       el0_svc+0x2c/0x7c
       el0t_64_sync_handler+0x48/0x114
       el0t_64_sync+0x190/0x194
      ---[ end trace 0000000000000000 ]---
      [drm-dp] dp_ctrl_push_idle: PUSH_IDLE pattern timedout
      
      Other basic use-cases still seem to work fine hence add a
      a module parameter to allow toggling psr enable/disable till
      PSR related issues are hashed out with IGT.
      Signed-off-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Acked-by: default avatarRob Clark <robdclark@gmail.com>
      Patchwork: https://patchwork.freedesktop.org/patch/534420/
      Link: https://lore.kernel.org/r/20230427232848.5200-1-quic_abhinavk@quicinc.comSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
      b78c7727
    • Rob Clark's avatar
      drm/msm: Set max segment size earlier · 173d4272
      Rob Clark authored
      Fixes the following splat on a6xx gen2+ (a640, a650, a660 families),
      a6xx gen1 has smaller GMU allocations so they fit under the default
      64K max segment size.
      
         ------------[ cut here ]------------
         DMA-API: msm_dpu ae01000.display-controller: mapping sg segment longer than device claims to support [len=126976] [max=65536]
         WARNING: CPU: 5 PID: 9 at kernel/dma/debug.c:1160 debug_dma_map_sg+0x288/0x314
         Modules linked in:
         CPU: 5 PID: 9 Comm: kworker/u16:0 Not tainted 6.3.0-rc2-debug+ #629
         Hardware name: Google Villager (rev1+) with LTE (DT)
         Workqueue: events_unbound deferred_probe_work_func
         pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
         pc : debug_dma_map_sg+0x288/0x314
         lr : debug_dma_map_sg+0x288/0x314
         sp : ffffffc00809b560
         x29: ffffffc00809b560 x28: 0000000000000060 x27: 0000000000000000
         x26: 0000000000010000 x25: 0000000000000004 x24: 0000000000000004
         x23: ffffffffffffffff x22: ffffffdb31693cc0 x21: ffffff8080935800
         x20: ffffff8087417400 x19: ffffff8087a45010 x18: 0000000000000000
         x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000010000
         x14: 0000000000000001 x13: ffffffffffffffff x12: ffffffffffffffff
         x11: 0000000000000000 x10: 000000000000000a x9 : ffffffdb2ff05e14
         x8 : ffffffdb31275000 x7 : ffffffdb2ff08908 x6 : 0000000000000000
         x5 : 0000000000000001 x4 : ffffffdb2ff08a74 x3 : ffffffdb31275008
         x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff80803a9a80
         Call trace:
          debug_dma_map_sg+0x288/0x314
          __dma_map_sg_attrs+0x80/0xe4
          dma_map_sgtable+0x30/0x4c
          get_pages+0x1d4/0x1e4
          msm_gem_pin_pages_locked+0xbc/0xf8
          msm_gem_pin_vma_locked+0x58/0xa0
          msm_gem_get_and_pin_iova_range+0x98/0xac
          a6xx_gmu_memory_alloc+0x7c/0x128
          a6xx_gmu_init+0x16c/0x9b0
          a6xx_gpu_init+0x38c/0x3e4
          adreno_bind+0x214/0x264
          component_bind_all+0x128/0x1f8
          msm_drm_bind+0x2b8/0x608
          try_to_bring_up_aggregate_device+0x88/0x1a4
          __component_add+0xec/0x13c
          component_add+0x1c/0x28
          dp_display_probe+0x3f8/0x43c
          platform_probe+0x70/0xc4
          really_probe+0x148/0x280
          __driver_probe_device+0xc8/0xe0
          driver_probe_device+0x44/0x100
          __device_attach_driver+0x64/0xdc
          bus_for_each_drv+0xb0/0xd8
          __device_attach+0xd8/0x168
          device_initial_probe+0x1c/0x28
          bus_probe_device+0x44/0xb0
          deferred_probe_work_func+0xc8/0xe0
          process_one_work+0x2e0/0x488
          process_scheduled_works+0x4c/0x50
          worker_thread+0x218/0x274
          kthread+0xf0/0x100
          ret_from_fork+0x10/0x20
         irq event stamp: 293712
         hardirqs last  enabled at (293711): [<ffffffdb2ff0893c>] vprintk_emit+0x160/0x25c
         hardirqs last disabled at (293712): [<ffffffdb30b48130>] el1_dbg+0x24/0x80
         softirqs last  enabled at (279520): [<ffffffdb2fe10420>] __do_softirq+0x21c/0x4bc
         softirqs last disabled at (279515): [<ffffffdb2fe16708>] ____do_softirq+0x18/0x24
         ---[ end trace 0000000000000000 ]---
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Fixes: db735fc4 ("drm/msm: Set dma maximum segment size for mdss")
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Patchwork: https://patchwork.freedesktop.org/patch/534892/
      Link: https://lore.kernel.org/r/20230501204441.1642741-1-robdclark@gmail.com
      173d4272
  3. 17 May, 2023 2 commits
  4. 11 May, 2023 2 commits
  5. 28 Apr, 2023 1 commit
  6. 26 Apr, 2023 12 commits
  7. 24 Apr, 2023 2 commits
    • Rob Clark's avatar
      drm/msm: Fix vmap madv warning · 16eb51ab
      Rob Clark authored
      Commit d6ae7d1c ("drm/msm/gem: Simplify vmap vs LRU tracking")
      introduced a splat in the pin_pages_locked() path for buffers that
      had been MADV_DONTNEED.
      
         ------------[ cut here ]------------
         msm_obj->madv != 0
         WARNING: CPU: 1 PID: 144 at drivers/gpu/drm/msm/msm_gem.c:230 msm_gem_pin_pages_locked+0x9c/0xd4
         Modules linked in: lzo_rle cros_ec_lid_angle cros_ec_sensors cros_ec_sensors_core venus_dec venus_enc videobuf2_dma_contig cdc_ether usbnet mii uvcvideo videobuf2_vmalloc hci_uart btqca qcom_spmi_adc5 uvc qcom_spmi_temp_alarm qcom_vadc_common cros_ec_sensorhub videobuf2_memops cros_ec_typec sx9324 sx_common typec joydev bluetooth industrialio_triggered_buffer ecdh_generic kfifo_buf ecc venus_core qcom_stats v4l2_mem2mem videobuf2_v4l2 videobuf2_common ath11k_ahb ath11k mac80211 cfg80211 fuse zram zsmalloc
         CPU: 1 PID: 144 Comm: ring0 Tainted: G        W          6.3.0-rc2-debug+ #622
         Hardware name: Google Villager (rev1+) with LTE (DT)
         pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
         pc : msm_gem_pin_pages_locked+0x9c/0xd4
         lr : msm_gem_pin_pages_locked+0x9c/0xd4
         sp : ffffffc009ffbab0
         x29: ffffffc009ffbab0 x28: ffffffee8da75008 x27: ffffff80a10274d0
         x26: ffffff8087fe3bf8 x25: ffffff8087fe3c08 x24: 0000000000000001
         x23: ffffff80891d5800 x22: ffffff809d0de480 x21: ffffff8081e5a080
         x20: 0000000000000002 x19: ffffff80a3564c00 x18: 0000000000000000
         x17: 0000000000000000 x16: 0000000000000000 x15: 00000000000a9620
         x14: 0000000000000000 x13: 2d2d2d2d2d2d2d2d x12: 2d2d2d2d5d206572
         x11: 656820747563205b x10: 2d2d2d2d2d2d2d2d x9 : ffffffee8c705dfc
         x8 : ffffffee8da75000 x7 : ffffffee8d34e6d0 x6 : 0000000000000000
         x5 : 00000000000affa8 x4 : 000000000000000d x3 : ffffffee8da75008
         x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff8088048040
         Call trace:
          msm_gem_pin_pages_locked+0x9c/0xd4
          get_vaddr+0xb0/0x150
          msm_gem_get_vaddr_active+0x1c/0x28
          snapshot_buf+0x90/0x10c
          msm_rd_dump_submit+0x30c/0x380
          msm_gpu_submit+0x88/0x174
          msm_job_run+0x68/0x118
          drm_sched_main+0x2b8/0x3a0
          kthread+0xf0/0x100
          ret_from_fork+0x10/0x20
         irq event stamp: 3358
         hardirqs last  enabled at (3357): [<ffffffee8c7051f4>] __up_console_sem+0x7c/0x80
         hardirqs last disabled at (3358): [<ffffffee8d3480b0>] el1_dbg+0x24/0x80
         softirqs last  enabled at (3330): [<ffffffee8c610420>] __do_softirq+0x21c/0x4bc
         softirqs last disabled at (3325): [<ffffffee8c616708>] ____do_softirq+0x18/0x24
         ---[ end trace 0000000000000000 ]---
      
      But, as with msm_gem_get_vaddr_active(), this is a special case
      because we know that the buffer won't be purged evicted until it's
      fence is signaled.  We just forgot to propagate the logic get_vaddr()
      to pin_pages_locked().
      
      Fixes: d6ae7d1c ("drm/msm/gem: Simplify vmap vs LRU tracking")
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Patchwork: https://patchwork.freedesktop.org/patch/532616/
      Link: https://lore.kernel.org/r/20230417225504.494934-1-robdclark@gmail.com
      16eb51ab
    • Rob Clark's avatar
      drm/msm/atomic: Don't try async if crtc not active · ce902336
      Rob Clark authored
      For a similar reason as commit f2c7ca89 ("drm/atomic-helper: Don't
      set deadline for modesets"), we need the crtc to be already active in
      order to compute a target vblank time for an async commit.  Otherwise
      we get this splat reminding us that we are doing it wrong:
      
         ------------[ cut here ]------------
         msm_dpu ae01000.mdp: drm_WARN_ON_ONCE(drm_drv_uses_atomic_modeset(dev))
         WARNING: CPU: 7 PID: 1923 at drivers/gpu/drm/drm_vblank.c:728 drm_crtc_vblank_helper_get_vblank_timestamp_internal+0x148/0x370
         Modules linked in: snd_seq_dummy snd_seq snd_seq_device bridge stp llc tun vhost_vsock vhost vhost_iotlb vmw_vsock_virtio_transport_common vsock uinput rfcomm algif_hash algif_skcipher af_alg veth venus_dec venus_enc cros_ec_typec typec qcom_spmi_temp_alarm qcom_spmi_adc_tm5 qcom_spmi_adc5 xt_cgroup qcom_vadc_common qcom_stats hci_uart btqca xt_MASQUERADE venus_core 8021q coresight_tmc coresight_funnel coresight_etm4x coresight_replicator snd_soc_lpass_sc7180 coresight snd_soc_sc7180 ip6table_nat fuse ath10k_snoc ath10k_core ath mac80211 iio_trig_sysfs bluetooth cfg80211 cros_ec_sensors cros_ec_sensors_core ecdh_generic industrialio_triggered_buffer ecc kfifo_buf cros_ec_sensorhub r8153_ecm cdc_ether usbnet r8152 mii lzo_rle lzo_compress zram hid_vivaldi hid_google_hammer hid_vivaldi_common joydev
         CPU: 7 PID: 1923 Comm: DrmThread Not tainted 5.15.107-18853-g3be267609a0b-dirty #16 a1ffc1a66e79c21c3536d8c9a42e819236e39714
         Hardware name: Google Wormdingler rev1+ BOE panel board (DT)
         pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
         pc : drm_crtc_vblank_helper_get_vblank_timestamp_internal+0x148/0x370
         lr : drm_crtc_vblank_helper_get_vblank_timestamp_internal+0x144/0x370
         sp : ffffffc012e2b800
         x29: ffffffc012e2b840 x28: ffffff8083676094 x27: ffffffc012e2bb28
         x26: ffffff8084539800 x25: 0000000000000000 x24: ffffff8083676000
         x23: ffffffd3c8cdc5a0 x22: ffffff80845b9d00 x21: ffffffc012e2b8b4
         x20: ffffffc012e2b910 x19: 0000000000000001 x18: 0000000000000000
         x17: 0000000000000000 x16: 0000000000000010 x15: ffffffd3c8451a88
         x14: 0000000000000003 x13: 0000000000000004 x12: 0000000000000001
         x11: c0000000ffffdfff x10: ffffffd3c973ef58 x9 : 8ea3526b3cc95900
         x8 : 8ea3526b3cc95900 x7 : 0000000000000000 x6 : 000000000000003a
         x5 : ffffffd3c99676cd x4 : 0000000000000000 x3 : ffffffc012e2b4b8
         x2 : ffffffc012e2b4c0 x1 : 00000000ffffdfff x0 : 0000000000000000
         Call trace:
          drm_crtc_vblank_helper_get_vblank_timestamp_internal+0x148/0x370
          drm_crtc_vblank_helper_get_vblank_timestamp+0x20/0x30
          drm_crtc_get_last_vbltimestamp+0x68/0xb0
          drm_crtc_next_vblank_start+0x5c/0xa8
          msm_atomic_commit_tail+0x264/0x664
          commit_tail+0xac/0x160
          drm_atomic_helper_commit+0x160/0x168
          drm_atomic_commit+0xfc/0x128
          drm_atomic_helper_disable_plane+0x8c/0x110
          __setplane_atomic+0x10c/0x138
          drm_mode_cursor_common+0x3a8/0x410
          drm_mode_cursor_ioctl+0x48/0x70
          drm_ioctl_kernel+0xe0/0x158
          drm_ioctl+0x25c/0x4d8
          __arm64_sys_ioctl+0x98/0xd0
          invoke_syscall+0x4c/0x100
          el0_svc_common+0x98/0x104
          do_el0_svc+0x30/0x90
          el0_svc+0x20/0x50
          el0t_64_sync_handler+0x78/0x108
          el0t_64_sync+0x1a4/0x1a8
         ---[ end trace a0f587e1ab9589e8 ]---
      
      Fixes: 52ff0d30 ("drm/msm/atomic: Switch to vblank_start helper")
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
      Patchwork: https://patchwork.freedesktop.org/patch/532727/
      Link: https://lore.kernel.org/r/20230418164158.549873-1-robdclark@gmail.com
      ce902336
  8. 07 Apr, 2023 17 commits