1. 09 Jul, 2021 2 commits
  2. 30 Jun, 2021 1 commit
    • Mikel Rychliski's avatar
      drm/radeon: Fix NULL dereference when updating memory stats · f18f5801
      Mikel Rychliski authored
      radeon_ttm_bo_destroy() is attempting to access the resource object to
      update memory counters. However, the resource object is already freed when
      ttm calls this function via the destroy callback. This causes an oops when
      a bo is freed:
      
      	BUG: kernel NULL pointer dereference, address: 0000000000000010
      	RIP: 0010:radeon_ttm_bo_destroy+0x2c/0x100 [radeon]
      	Call Trace:
      	 radeon_bo_unref+0x1a/0x30 [radeon]
      	 radeon_gem_object_free+0x33/0x50 [radeon]
      	 drm_gem_object_release_handle+0x69/0x70 [drm]
      	 drm_gem_handle_delete+0x62/0xa0 [drm]
      	 ? drm_mode_destroy_dumb+0x40/0x40 [drm]
      	 drm_ioctl_kernel+0xb2/0xf0 [drm]
      	 drm_ioctl+0x30a/0x3c0 [drm]
      	 ? drm_mode_destroy_dumb+0x40/0x40 [drm]
      	 radeon_drm_ioctl+0x49/0x80 [radeon]
      	 __x64_sys_ioctl+0x8e/0xd0
      
      Avoid the issue by updating the counters in the delete_mem_notify callback
      instead. Also, fix memory statistic updating in radeon_bo_move() to
      identify the source type correctly. The source type needs to be saved
      before the move, because the moved from object may be altered by the move.
      
      Fixes: bfa3357e ("drm/ttm: allocate resource object instead of embedding it v2")
      Signed-off-by: default avatarMikel Rychliski <mikel@mikelr.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210624045121.15643-1-mikel@mikelr.com
      f18f5801
  3. 29 Jun, 2021 3 commits
  4. 21 Jun, 2021 1 commit
  5. 16 Jun, 2021 3 commits
    • José Roberto de Souza's avatar
      drm/dp_mst: Add missing drm parameters to recently added call to drm_dbg_kms() · 24ff3dc1
      José Roberto de Souza authored
      Commit 3769e4c0 ("drm/dp_mst: Avoid to mess up payload table by
      ports in stale topology") added to calls to drm_dbg_kms() but it
      missed the first parameter, the drm device breaking the build.
      
      Fixes: 3769e4c0 ("drm/dp_mst: Avoid to mess up payload table by ports in stale topology")
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210616194415.36926-1-jose.souza@intel.com
      24ff3dc1
    • Wayne Lin's avatar
      drm/dp_mst: Avoid to mess up payload table by ports in stale topology · 3769e4c0
      Wayne Lin authored
      [Why]
      After unplug/hotplug hub from the system, userspace might start to
      clear stale payloads gradually. If we call drm_dp_mst_deallocate_vcpi()
      to release stale VCPI of those ports which are not relating to current
      topology, we have chane to wrongly clear active payload table entry for
      current topology.
      
      E.g.
      We have allocated VCPI 1 in current payload table and we call
      drm_dp_mst_deallocate_vcpi() to clean VCPI 1 in stale topology. In
      drm_dp_mst_deallocate_vcpi(), it will call drm_dp_mst_put_payload_id()
      tp put VCPI 1 and which means ID 1 is available again. Thereafter, if we
      want to allocate a new payload stream, it will find ID 1 is available by
      drm_dp_mst_assign_payload_id(). However, ID 1 is being used
      
      [How]
      Check target sink is relating to current topology or not before doing
      any payload table update.
      Searching upward to find the target sink's relevant root branch device.
      If the found root branch device is not the same root of current
      topology, don't update payload table.
      
      Changes since v1:
      * Change debug macro to use drm_dbg_kms() instead
      * Amend the commit message to add Cc tag.
      Signed-off-by: default avatarWayne Lin <Wayne.Lin@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210616035501.3776-3-Wayne.Lin@amd.comReviewed-by: default avatarLyude Paul <lyude@redhat.com>
      3769e4c0
    • Wayne Lin's avatar
      drm/dp_mst: Do not set proposed vcpi directly · 35d3e8cb
      Wayne Lin authored
      [Why]
      When we receive CSN message to notify one port is disconnected, we will
      implicitly set its corresponding num_slots to 0. Later on, we will
      eventually call drm_dp_update_payload_part1() to arrange down streams.
      
      In drm_dp_update_payload_part1(), we iterate over all proposed_vcpis[]
      to do the update. Not specific to a target sink only. For example, if we
      light up 2 monitors, Monitor_A and Monitor_B, and then we unplug
      Monitor_B. Later on, when we call drm_dp_update_payload_part1() to try
      to update payload for Monitor_A, we'll also implicitly clean payload for
      Monitor_B at the same time. And finally, when we try to call
      drm_dp_update_payload_part1() to clean payload for Monitor_B, we will do
      nothing at this time since payload for Monitor_B has been cleaned up
      previously.
      
      For StarTech 1to3 DP hub, it seems like if we didn't update DPCD payload
      ID table then polling for "ACT Handled"(BIT_1 of DPCD 002C0h) will fail
      and this polling will last for 3 seconds.
      
      Therefore, guess the best way is we don't set the proposed_vcpi[]
      diretly. Let user of these herlper functions to set the proposed_vcpi
      directly.
      
      [How]
      1. Revert commit 7617e962 ("drm/dp_mst: clear time slots for ports
      invalid")
      2. Tackle the issue in previous commit by skipping those trasient
      proposed VCPIs. These stale VCPIs shoulde be explicitly cleared by
      user later on.
      
      Changes since v1:
      * Change debug macro to use drm_dbg_kms() instead
      * Amend the commit message to add Fixed & Cc tags
      Signed-off-by: default avatarWayne Lin <Wayne.Lin@amd.com>
      Fixes: 7617e962 ("drm/dp_mst: clear time slots for ports invalid")
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: dri-devel@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v5.5+
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210616035501.3776-2-Wayne.Lin@amd.comReviewed-by: default avatarLyude Paul <lyude@redhat.com>
      35d3e8cb
  6. 15 Jun, 2021 1 commit
  7. 11 Jun, 2021 5 commits
  8. 10 Jun, 2021 6 commits
  9. 09 Jun, 2021 6 commits
  10. 08 Jun, 2021 12 commits