1. 20 12月, 2018 2 次提交
  2. 17 12月, 2018 1 次提交
  3. 13 12月, 2018 5 次提交
  4. 08 12月, 2018 1 次提交
  5. 01 12月, 2018 3 次提交
  6. 27 11月, 2018 3 次提交
    • L
      drm/amd/amdgpu/dm: Fix dm_dp_create_fake_mst_encoder() · ea1de530
      Lyude Paul 提交于
      [ Upstream commit 63237f87 ]
      
      [why]
      Removing connector reusage from DM to match the rest of the tree ended
      up revealing an issue that was surprisingly subtle. The original amdgpu
      code for DC that was submitted appears to have left a chunk in
      dm_dp_create_fake_mst_encoder() that tries to find a "master encoder",
      the likes of which isn't actually used or stored anywhere. It does so at
      the wrong time as well by trying to access parts of the drm_connector
      from the encoder init before it's actually been initialized. This
      results in a NULL pointer deref on MST hotplugs:
      
      [  160.696613] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
      [  160.697234] PGD 0 P4D 0
      [  160.697814] Oops: 0010 [#1] SMP PTI
      [  160.698430] CPU: 2 PID: 64 Comm: kworker/2:1 Kdump: loaded Tainted: G           O      4.19.0Lyude-Test+ #2
      [  160.699020] Hardware name: HP HP ZBook 15 G4/8275, BIOS P70 Ver. 01.22 05/17/2018
      [  160.699672] Workqueue: events_long drm_dp_mst_link_probe_work [drm_kms_helper]
      [  160.700322] RIP: 0010:          (null)
      [  160.700920] Code: Bad RIP value.
      [  160.701541] RSP: 0018:ffffc9000029fc78 EFLAGS: 00010206
      [  160.702183] RAX: 0000000000000000 RBX: ffff8804440ed468 RCX: ffff8804440e9158
      [  160.702778] RDX: 0000000000000000 RSI: ffff8804556c5700 RDI: ffff8804440ed000
      [  160.703408] RBP: ffff880458e21800 R08: 0000000000000002 R09: 000000005fca0a25
      [  160.704002] R10: ffff88045a077a3d R11: ffff88045a077a3c R12: ffff8804440ed000
      [  160.704614] R13: ffff880458e21800 R14: ffff8804440e9000 R15: ffff8804440e9000
      [  160.705260] FS:  0000000000000000(0000) GS:ffff88045f280000(0000) knlGS:0000000000000000
      [  160.705854] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  160.706478] CR2: ffffffffffffffd6 CR3: 000000000200a001 CR4: 00000000003606e0
      [  160.707124] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  160.707724] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  160.708372] Call Trace:
      [  160.708998]  ? dm_dp_add_mst_connector+0xed/0x1d0 [amdgpu]
      [  160.709625]  ? drm_dp_add_port+0x2fa/0x470 [drm_kms_helper]
      [  160.710284]  ? wake_up_q+0x54/0x70
      [  160.710877]  ? __mutex_unlock_slowpath.isra.18+0xb3/0x110
      [  160.711512]  ? drm_dp_dpcd_access+0xe7/0x110 [drm_kms_helper]
      [  160.712161]  ? drm_dp_send_link_address+0x155/0x1e0 [drm_kms_helper]
      [  160.712762]  ? drm_dp_check_and_send_link_address+0xa3/0xd0 [drm_kms_helper]
      [  160.713408]  ? drm_dp_mst_link_probe_work+0x4b/0x80 [drm_kms_helper]
      [  160.714013]  ? process_one_work+0x1a1/0x3a0
      [  160.714667]  ? worker_thread+0x30/0x380
      [  160.715326]  ? wq_update_unbound_numa+0x10/0x10
      [  160.715939]  ? kthread+0x112/0x130
      [  160.716591]  ? kthread_create_worker_on_cpu+0x70/0x70
      [  160.717262]  ? ret_from_fork+0x35/0x40
      [  160.717886] Modules linked in: amdgpu(O) vfat fat snd_hda_codec_generic joydev i915 chash gpu_sched ttm i2c_algo_bit drm_kms_helper snd_hda_codec_hdmi hp_wmi syscopyarea iTCO_wdt sysfillrect sparse_keymap sysimgblt fb_sys_fops snd_hda_intel usbhid wmi_bmof drm snd_hda_codec btusb snd_hda_core intel_rapl btrtl x86_pkg_temp_thermal btbcm btintel coretemp snd_pcm crc32_pclmul bluetooth psmouse snd_timer snd pcspkr i2c_i801 mei_me i2c_core soundcore mei tpm_tis wmi tpm_tis_core hp_accel ecdh_generic lis3lv02d tpm video rfkill acpi_pad input_polldev hp_wireless pcc_cpufreq crc32c_intel serio_raw tg3 xhci_pci xhci_hcd [last unloaded: amdgpu]
      [  160.720141] CR2: 0000000000000000
      
      Somehow the connector reusage DM was using for MST connectors managed to
      paper over this issue entirely; hence why this was never caught until
      now.
      
      [how]
      Since this code isn't used anywhere and seems useless anyway, we can
      just drop it entirely. This appears to fix the issue on my HP ZBook with
      an AMD WX4150.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ea1de530
    • J
      drm/amd/display: Drop reusing drm connector for MST · b3db5d74
      Jerry (Fangzhi) Zuo 提交于
      [ Upstream commit 0e6613e4 ]
      
      [why]
      It is not safe to keep existing connector while entire topology
      has been removed. Could lead potential impact to uapi.
      Entirely unregister all the connectors on the topology,
      and use a new set of connectors when the topology is plugged back
      on.
      
      [How]
      Remove the drm connector entirely each time when the
      corresponding MST topology is gone.
      When hotunplug a connector (e.g., DP2)
      1. Remove connector from userspace.
      2. Drop it's reference.
      When hotplug back on:
      1. Detect new topology, and create new connectors.
      2. Notify userspace with sysfs hotplug event.
      3. Reprobe new connectors, and reassign CRTC from old (e.g., DP2)
      to new (e.g., DP3) connector.
      Signed-off-by: NJerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      b3db5d74
    • H
      drm/amd/display: Stop leaking planes · b352afaa
      Harry Wentland 提交于
      [ Upstream commit 02680efb ]
      
      [Why]
      drm_plane_cleanup does not free the plane.
      
      [How]
      Call drm_primary_helper_destroy which will also free the plane.
      Signed-off-by: NHarry Wentland <harry.wentland@amd.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      b352afaa
  7. 21 11月, 2018 10 次提交
  8. 04 10月, 2018 2 次提交
    • F
      drm/amdkfd: Fix incorrect use of process->mm · 11b29c9e
      Felix Kuehling 提交于
      This mm_struct pointer should never be dereferenced. If running in
      a user thread, just use current->mm. If running in a kernel worker
      use get_task_mm to get a safe reference to the mm_struct.
      Reviewed-by: NOded Gabbay <oded.gabbay@gmail.com>
      Acked-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      11b29c9e
    • S
      drm/amd/display: Signal hw_done() after waiting for flip_done() · 987bf116
      Shirish S 提交于
      In amdgpu_dm_commit_tail(), wait until flip_done() is signaled before
      we signal hw_done().
      
      [Why]
      
      This is to temporarily address a paging error that occurs when a
      nonblocking commit contends with another commit, particularly in a
      mirrored display configuration where at least 2 CRTCs are updated.
      The error occurs in drm_atomic_helper_wait_for_flip_done(), when we
      attempt to access the contents of new_crtc_state->commit.
      
      Here's the sequence for a mirrored 2 display setup (irrelevant steps
      left out for clarity):
      
      **THREAD 1**                        | **THREAD 2**
                                          |
      Initialize atomic state for flip    |
                                          |
      Queue worker                        |
                                         ...
      
                                          | Do work for flip
                                          |
                                          | Signal hw_done() on CRTC 1
                                          | Signal hw_done() on CRTC 2
                                          |
                                          | Wait for flip_done() on CRTC 1
      
                                      <---- **PREEMPTED BY THREAD 1**
      
      Initialize atomic state for cursor  |
      update (1)                          |
                                          |
      Do cursor update work on both CRTCs |
                                          |
      Clear atomic state (2)              |
      **DONE**                            |
                                         ...
                                          |
                                          | Wait for flip_done() on CRTC 2
                                          | *ERROR*
                                          |
      
      The issue starts with (1). When the atomic state is initialized, the
      current CRTC states are duplicated to be the new_crtc_states, and
      referenced to be the old_crtc_states. (The new_crtc_states are to be
      filled with update data.)
      
      Some things to note:
      
      * Due to the mirrored configuration, the cursor updates on both CRTCs.
      
      * At this point, the pflip IRQ has already been handled, and flip_done
        signaled on all CRTCs. The cursor commit can therefore continue.
      
      * The old_crtc_states used by the cursor update are the **same states**
        as the new_crtc_states used by the flip worker.
      
      At (2), the old_crtc_state is freed (*), and the cursor commit
      completes. We then context switch back to the flip worker, where we
      attempt to access the new_crtc_state->commit object. This is
      problematic, as this state has already been freed.
      
      (*) Technically, 'state->crtcs[i].state' is freed, which was made to
          reference old_crtc_state in drm_atomic_helper_swap_state()
      
      [How]
      
      By moving hw_done() after wait_for_flip_done(), we're guaranteed that
      the new_crtc_state (from the flip worker's perspective) still exists.
      This is because any other commit will be blocked, waiting for the
      hw_done() signal.
      
      Note that both the i915 and imx drivers have this sequence flipped
      already, masking this problem.
      Signed-off-by: NShirish S <shirish.s@amd.com>
      Signed-off-by: NLeo Li <sunpeng.li@amd.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      987bf116
  9. 27 9月, 2018 3 次提交
  10. 20 9月, 2018 4 次提交
  11. 12 9月, 2018 1 次提交
  12. 11 9月, 2018 3 次提交
  13. 29 8月, 2018 1 次提交
    • E
      drm/amdgpu: Need to set moved to true when evict bo · 6ddd9769
      Emily Deng 提交于
      Fix the VMC page fault when the running sequence is as below:
      1.amdgpu_gem_create_ioctl
      2.ttm_bo_swapout->amdgpu_vm_bo_invalidate, as not called
      amdgpu_vm_bo_base_init, so won't called
      list_add_tail(&base->bo_list, &bo->va). Even the bo was evicted,
      it won't set the bo_base->moved.
      3.drm_gem_open_ioctl->amdgpu_vm_bo_base_init, here only called
      list_move_tail(&base->vm_status, &vm->evicted), but not set the
      bo_base->moved.
      4.amdgpu_vm_bo_map->amdgpu_vm_bo_insert_map, as the bo_base->moved is
      not set true, the function amdgpu_vm_bo_insert_map will call
      list_move(&bo_va->base.vm_status, &vm->moved)
      5.amdgpu_cs_ioctl won't validate the swapout bo, as it is only in the
      moved list, not in the evict list. So VMC page fault occurs.
      Signed-off-by: NEmily Deng <Emily.Deng@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      6ddd9769
  14. 28 8月, 2018 1 次提交