1. 26 Aug, 2020 33 commits
  2. 24 Aug, 2020 7 commits
    • Luben Tuikov's avatar
      drm/amdgpu: Get DRM dev from adev by inline-f · 4a580877
      Luben Tuikov authored
      Add a static inline adev_to_drm() to obtain
      the DRM device pointer from an amdgpu_device pointer.
      Signed-off-by: default avatarLuben Tuikov <luben.tuikov@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      4a580877
    • Luben Tuikov's avatar
      drm/amdgpu: drm_device to amdgpu_device by inline-f (v2) · 1348969a
      Luben Tuikov authored
      Get the amdgpu_device from the DRM device by use
      of an inline function, drm_to_adev(). The inline
      function resolves a pointer to struct drm_device
      to a pointer to struct amdgpu_device.
      
      v2: Use a typed visible static inline function
          instead of an invisible macro.
      Signed-off-by: default avatarLuben Tuikov <luben.tuikov@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      1348969a
    • Prike.Liang's avatar
      drm/amdgpu: enable HDP clock gatting · 50166d1c
      Prike.Liang authored
      Enabe HDP SD/DS clock gatting in Renoir series.
      Signed-off-by: default avatarPrike.Liang <Prike.Liang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      50166d1c
    • Prike.Liang's avatar
      drm/amdgpu: enable ATHUB clock gatting · d844812b
      Prike.Liang authored
      Enable ATHUB clock gatting set in Renoir series.
      Signed-off-by: default avatarPrike.Liang <Prike.Liang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      d844812b
    • Jiansong Chen's avatar
      drm/amd/pm: set VCN pg per instances · 6ec46653
      Jiansong Chen authored
      When deciding whether to set pg for vcn1, instances
      number is more generic than chip name.
      Signed-off-by: default avatarJiansong Chen <Jiansong.Chen@amd.com>
      Reviewed-by: default avatarTao Zhou <tao.zhou1@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      6ec46653
    • Dennis Li's avatar
      drm/amdgpu: annotate a false positive recursive locking · 08ebb485
      Dennis Li authored
      Re-apply commit 72e14ebf
      
      [  584.110304] ============================================
      [  584.110590] WARNING: possible recursive locking detected
      [  584.110876] 5.6.0-deli-v5.6-2848-g3f3109b0e75f #1 Tainted: G           OE
      [  584.111164] --------------------------------------------
      [  584.111456] kworker/38:1/553 is trying to acquire lock:
      [  584.111721] ffff9b15ff0a47a0 (&adev->reset_sem){++++}, at: amdgpu_device_gpu_recover+0x262/0x1030 [amdgpu]
      [  584.112112]
                     but task is already holding lock:
      [  584.112673] ffff9b1603d247a0 (&adev->reset_sem){++++}, at: amdgpu_device_gpu_recover+0x262/0x1030 [amdgpu]
      [  584.113068]
                     other info that might help us debug this:
      [  584.113689]  Possible unsafe locking scenario:
      
      [  584.114350]        CPU0
      [  584.114685]        ----
      [  584.115014]   lock(&adev->reset_sem);
      [  584.115349]   lock(&adev->reset_sem);
      [  584.115678]
                      *** DEADLOCK ***
      
      [  584.116624]  May be due to missing lock nesting notation
      
      [  584.117284] 4 locks held by kworker/38:1/553:
      [  584.117616]  #0: ffff9ad635c1d348 ((wq_completion)events){+.+.}, at: process_one_work+0x21f/0x630
      [  584.117967]  #1: ffffac708e1c3e58 ((work_completion)(&con->recovery_work)){+.+.}, at: process_one_work+0x21f/0x630
      [  584.118358]  #2: ffffffffc1c2a5d0 (&tmp->hive_lock){+.+.}, at: amdgpu_device_gpu_recover+0xae/0x1030 [amdgpu]
      [  584.118786]  #3: ffff9b1603d247a0 (&adev->reset_sem){++++}, at: amdgpu_device_gpu_recover+0x262/0x1030 [amdgpu]
      [  584.119222]
                     stack backtrace:
      [  584.119990] CPU: 38 PID: 553 Comm: kworker/38:1 Kdump: loaded Tainted: G           OE     5.6.0-deli-v5.6-2848-g3f3109b0e75f #1
      [  584.120782] Hardware name: Supermicro SYS-7049GP-TRT/X11DPG-QT, BIOS 3.1 05/23/2019
      [  584.121223] Workqueue: events amdgpu_ras_do_recovery [amdgpu]
      [  584.121638] Call Trace:
      [  584.122050]  dump_stack+0x98/0xd5
      [  584.122499]  __lock_acquire+0x1139/0x16e0
      [  584.122931]  ? trace_hardirqs_on+0x3b/0xf0
      [  584.123358]  ? cancel_delayed_work+0xa6/0xc0
      [  584.123771]  lock_acquire+0xb8/0x1c0
      [  584.124197]  ? amdgpu_device_gpu_recover+0x262/0x1030 [amdgpu]
      [  584.124599]  down_write+0x49/0x120
      [  584.125032]  ? amdgpu_device_gpu_recover+0x262/0x1030 [amdgpu]
      [  584.125472]  amdgpu_device_gpu_recover+0x262/0x1030 [amdgpu]
      [  584.125910]  ? amdgpu_ras_error_query+0x1b8/0x2a0 [amdgpu]
      [  584.126367]  amdgpu_ras_do_recovery+0x159/0x190 [amdgpu]
      [  584.126789]  process_one_work+0x29e/0x630
      [  584.127208]  worker_thread+0x3c/0x3f0
      [  584.127621]  ? __kthread_parkme+0x61/0x90
      [  584.128014]  kthread+0x12f/0x150
      [  584.128402]  ? process_one_work+0x630/0x630
      [  584.128790]  ? kthread_park+0x90/0x90
      [  584.129174]  ret_from_fork+0x3a/0x50
      
      Each adev has owned lock_class_key to avoid false positive
      recursive locking.
      
      v2:
      1. register adev->lock_key into lockdep, otherwise lockdep will
      report the below warning
      
      [ 1216.705820] BUG: key ffff890183b647d0 has not been registered!
      [ 1216.705924] ------------[ cut here ]------------
      [ 1216.705972] DEBUG_LOCKS_WARN_ON(1)
      [ 1216.705997] WARNING: CPU: 20 PID: 541 at kernel/locking/lockdep.c:3743 lockdep_init_map+0x150/0x210
      
      v3:
      change to use down_write_nest_lock to annotate the false dead-lock
      warning.
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDennis Li <Dennis.Li@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      08ebb485
    • Dennis Li's avatar
      drm/amdgpu: refine create and release logic of hive info · d95e8e97
      Dennis Li authored
      Change to dynamically create and release hive info object,
      which help driver support more hives in the future.
      
      v2:
      Change to save hive object pointer in adev, to avoid locking
      xgmi_mutex every time when calling amdgpu_get_xgmi_hive.
      
      v3:
      1. Change type of hive object pointer in adev from void* to
      amdgpu_hive_info*.
      2. remove unnecessary variable initialization.
      Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
      Signed-off-by: default avatarDennis Li <Dennis.Li@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      d95e8e97