1. 06 8月, 2021 2 次提交
    • C
      drm/amdgpu: add DID for beige goby · e00f543d
      Chengming Gui 提交于
      Add device ids.
      Signed-off-by: NChengming Gui <Jack.Gui@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      e00f543d
    • R
      drm/amdgpu: fix checking pmops when PM_SLEEP is not enabled · 5706cb3c
      Randy Dunlap 提交于
      'pm_suspend_target_state' is only available when CONFIG_PM_SLEEP
      is set/enabled. OTOH, when both SUSPEND and HIBERNATION are not set,
      PM_SLEEP is not set, so this variable cannot be used.
      
      ../drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c: In function ‘amdgpu_acpi_is_s0ix_active’:
      ../drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:1046:11: error: ‘pm_suspend_target_state’ undeclared (first use in this function); did you mean ‘__KSYM_pm_suspend_target_state’?
          return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
                 ^~~~~~~~~~~~~~~~~~~~~~~
                 __KSYM_pm_suspend_target_state
      
      Also use shorter IS_ENABLED(CONFIG_foo) notation for checking the
      2 config symbols.
      
      Fixes: 91e27371 ("drm/amdgpu: Check pmops for desired suspend state")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-next@vger.kernel.org
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      5706cb3c
  2. 30 7月, 2021 2 次提交
    • Y
      drm/amdgpu: fix the doorbell missing when in CGPG issue for renoir. · 1c0539a6
      Yifan Zhang 提交于
      If GC has entered CGPG, ringing doorbell > first page doesn't wakeup GC.
      Enlarge CP_MEC_DOORBELL_RANGE_UPPER to workaround this issue.
      Signed-off-by: NYifan Zhang <yifan1.zhang@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      1c0539a6
    • X
      drm/amdgpu: Fix out-of-bounds read when update mapping · 4d77f36f
      xinhui pan 提交于
      If one GTT BO has been evicted/swapped out, it should sit in CPU domain.
      TTM only alloc struct ttm_resource instead of struct ttm_range_mgr_node
      for sysMem.
      
      Now when we update mapping for such invalidated BOs, we might walk out
      of bounds of struct ttm_resource.
      
      Three possible fix:
      1) Let sysMem manager alloc struct ttm_range_mgr_node, like
      ttm_range_manager does.
      2) Pass pages_addr to update_mapping function too, but need memset
      pages_addr[] to zero when unpopulate.
      3) Init amdgpu_res_cursor directly.
      
      bug is detected by kfence.
      ==================================================================
      BUG: KFENCE: out-of-bounds read in amdgpu_vm_bo_update_mapping+0x564/0x6e0
      
      Out-of-bounds read at 0x000000008ea93fe9 (64B right of kfence-#167):
       amdgpu_vm_bo_update_mapping+0x564/0x6e0 [amdgpu]
       amdgpu_vm_bo_update+0x282/0xa40 [amdgpu]
       amdgpu_vm_handle_moved+0x19e/0x1f0 [amdgpu]
       amdgpu_cs_vm_handling+0x4e4/0x640 [amdgpu]
       amdgpu_cs_ioctl+0x19e7/0x23c0 [amdgpu]
       drm_ioctl_kernel+0xf3/0x180 [drm]
       drm_ioctl+0x2cb/0x550 [drm]
       amdgpu_drm_ioctl+0x5e/0xb0 [amdgpu]
      
      kfence-#167 [0x000000008e11c055-0x000000001f676b3e
       ttm_sys_man_alloc+0x35/0x80 [ttm]
       ttm_resource_alloc+0x39/0x50 [ttm]
       ttm_bo_swapout+0x252/0x5a0 [ttm]
       ttm_device_swapout+0x107/0x180 [ttm]
       ttm_global_swapout+0x6f/0x130 [ttm]
       ttm_tt_populate+0xb1/0x2a0 [ttm]
       ttm_bo_handle_move_mem+0x17e/0x1d0 [ttm]
       ttm_mem_evict_first+0x59d/0x9c0 [ttm]
       ttm_bo_mem_space+0x39f/0x400 [ttm]
       ttm_bo_validate+0x13c/0x340 [ttm]
       ttm_bo_init_reserved+0x269/0x540 [ttm]
       amdgpu_bo_create+0x1d1/0xa30 [amdgpu]
       amdgpu_bo_create_user+0x40/0x80 [amdgpu]
       amdgpu_gem_object_create+0x71/0xc0 [amdgpu]
       amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu+0x2f2/0xcd0 [amdgpu]
       kfd_ioctl_alloc_memory_of_gpu+0xe2/0x330 [amdgpu]
       kfd_ioctl+0x461/0x690 [amdgpu]
      Signed-off-by: Nxinhui pan <xinhui.pan@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      4d77f36f
  3. 28 7月, 2021 1 次提交
  4. 27 7月, 2021 2 次提交
    • J
      drm/amdgpu: Avoid printing of stack contents on firmware load error · 6aade587
      Jiri Kosina 提交于
      In case when psp_init_asd_microcode() fails to load ASD microcode file,
      psp_v12_0_init_microcode() tries to print the firmware filename that
      failed to load before bailing out.
      
      This is wrong because:
      
      - the firmware filename it would want it print is an incorrect one as
        psp_init_asd_microcode() and psp_v12_0_init_microcode() are loading
        different filenames
      - it tries to print fw_name, but that's not yet been initialized by that
        time, so it prints random stack contents, e.g.
      
          amdgpu 0000:04:00.0: Direct firmware load for amdgpu/renoir_asd.bin failed with error -2
          amdgpu 0000:04:00.0: amdgpu: fail to initialize asd microcode
          amdgpu 0000:04:00.0: amdgpu: psp v12.0: Failed to load firmware "\xfeTO\x8e\xff\xff"
      
      Fix that by bailing out immediately, instead of priting the bogus error
      message.
      Reported-by: NVojtech Pavlik <vojtech@ucw.cz>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      6aade587
    • J
      drm/amdgpu: Fix resource leak on probe error path · d47255d3
      Jiri Kosina 提交于
      This reverts commit 4192f7b5.
      
      It is not true (as stated in the reverted commit changelog) that we never
      unmap the BAR on failure; it actually does happen properly on
      amdgpu_driver_load_kms() -> amdgpu_driver_unload_kms() ->
      amdgpu_device_fini() error path.
      
      What's worse, this commit actually completely breaks resource freeing on
      probe failure (like e.g. failure to load microcode), as
      amdgpu_driver_unload_kms() notices adev->rmmio being NULL and bails too
      early, leaving all the resources that'd normally be freed in
      amdgpu_acpi_fini() and amdgpu_device_fini() still hanging around, leading
      to all sorts of oopses when someone tries to, for example, access the
      sysfs and procfs resources which are still around while the driver is
      gone.
      
      Fixes: 4192f7b5 ("drm/amdgpu: unmap register bar on device init failure")
      Reported-by: NVojtech Pavlik <vojtech@ucw.cz>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      d47255d3
  5. 22 7月, 2021 3 次提交
  6. 17 7月, 2021 5 次提交
  7. 16 7月, 2021 1 次提交
  8. 15 7月, 2021 1 次提交
  9. 13 7月, 2021 8 次提交
  10. 01 7月, 2021 6 次提交
  11. 30 6月, 2021 9 次提交