1. 11 1月, 2023 1 次提交
    • Y
      drm/amdgpu: Fixed bug on error when unloading amdgpu · 40794dfd
      YiPeng Chai 提交于
      Fixed bug on error when unloading amdgpu.
      
      The error message is as follows:
      [  377.706202] kernel BUG at drivers/gpu/drm/drm_buddy.c:278!
      [  377.706215] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
      [  377.706222] CPU: 4 PID: 8610 Comm: modprobe Tainted: G          IOE      6.0.0-thomas #1
      [  377.706231] Hardware name: ASUS System Product Name/PRIME Z390-A, BIOS 2004 11/02/2021
      [  377.706238] RIP: 0010:drm_buddy_free_block+0x26/0x30 [drm_buddy]
      [  377.706264] Code: 00 00 00 90 0f 1f 44 00 00 48 8b 0e 89 c8 25 00 0c 00 00 3d 00 04 00 00 75 10 48 8b 47 18 48 d3 e0 48 01 47 28 e9 fa fe ff ff <0f> 0b 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 54 55 48 89 f5 53
      [  377.706282] RSP: 0018:ffffad2dc4683cb8 EFLAGS: 00010287
      [  377.706289] RAX: 0000000000000000 RBX: ffff8b1743bd5138 RCX: 0000000000000000
      [  377.706297] RDX: ffff8b1743bd5160 RSI: ffff8b1743bd5c78 RDI: ffff8b16d1b25f70
      [  377.706304] RBP: ffff8b1743bd59e0 R08: 0000000000000001 R09: 0000000000000001
      [  377.706311] R10: ffff8b16c8572400 R11: ffffad2dc4683cf0 R12: ffff8b16d1b25f70
      [  377.706318] R13: ffff8b16d1b25fd0 R14: ffff8b1743bd59c0 R15: ffff8b16d1b25f70
      [  377.706325] FS:  00007fec56c72c40(0000) GS:ffff8b1836500000(0000) knlGS:0000000000000000
      [  377.706334] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  377.706340] CR2: 00007f9b88c1ba50 CR3: 0000000110450004 CR4: 00000000003706e0
      [  377.706347] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  377.706354] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  377.706361] Call Trace:
      [  377.706365]  <TASK>
      [  377.706369]  drm_buddy_free_list+0x2a/0x60 [drm_buddy]
      [  377.706376]  amdgpu_vram_mgr_fini+0xea/0x180 [amdgpu]
      [  377.706572]  amdgpu_ttm_fini+0x12e/0x1a0 [amdgpu]
      [  377.706650]  amdgpu_bo_fini+0x22/0x90 [amdgpu]
      [  377.706727]  gmc_v11_0_sw_fini+0x26/0x30 [amdgpu]
      [  377.706821]  amdgpu_device_fini_sw+0xa1/0x3c0 [amdgpu]
      [  377.706897]  amdgpu_driver_release_kms+0x12/0x30 [amdgpu]
      [  377.706975]  drm_dev_release+0x20/0x40 [drm]
      [  377.707006]  release_nodes+0x35/0xb0
      [  377.707014]  devres_release_all+0x8b/0xc0
      [  377.707020]  device_unbind_cleanup+0xe/0x70
      [  377.707027]  device_release_driver_internal+0xee/0x160
      [  377.707033]  driver_detach+0x44/0x90
      [  377.707039]  bus_remove_driver+0x55/0xe0
      [  377.707045]  pci_unregister_driver+0x3b/0x90
      [  377.707052]  amdgpu_exit+0x11/0x6c [amdgpu]
      [  377.707194]  __x64_sys_delete_module+0x142/0x2b0
      [  377.707201]  ? fpregs_assert_state_consistent+0x22/0x50
      [  377.707208]  ? exit_to_user_mode_prepare+0x3e/0x190
      [  377.707215]  do_syscall_64+0x38/0x90
      [  377.707221]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
      Signed-off-by: NYiPeng Chai <YiPeng.Chai@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      40794dfd
  2. 08 11月, 2022 1 次提交
  3. 27 10月, 2022 1 次提交
  4. 23 9月, 2022 1 次提交
  5. 22 8月, 2022 1 次提交
  6. 15 7月, 2022 3 次提交
  7. 11 7月, 2022 2 次提交
  8. 08 7月, 2022 1 次提交
  9. 11 5月, 2022 2 次提交
  10. 08 4月, 2022 1 次提交
    • A
      drm/amdgpu: add drm buddy support to amdgpu · c9cad937
      Arunpravin Paneer Selvam 提交于
      - Switch to drm buddy allocator
      - Add resource cursor support for drm buddy
      
      v2(Matthew Auld):
        - replace spinlock with mutex as we call kmem_cache_zalloc
          (..., GFP_KERNEL) in drm_buddy_alloc() function
      
        - lock drm_buddy_block_trim() function as it calls
          mark_free/mark_split are all globally visible
      
      v3(Matthew Auld):
        - remove trim method error handling as we address the failure case
          at drm_buddy_block_trim() function
      
      v4:
        - fix warnings reported by kernel test robot <lkp@intel.com>
      
      v5:
        - fix merge conflict issue
      
      v6:
        - fix warnings reported by kernel test robot <lkp@intel.com>
      
      v7:
        - remove DRM_BUDDY_RANGE_ALLOCATION flag usage
      
      v8:
        - keep DRM_BUDDY_RANGE_ALLOCATION flag usage
        - resolve conflicts created by drm/amdgpu: remove VRAM accounting v2
      
      v9(Christian):
        - merged the below patch
           - drm/amdgpu: move vram inline functions into a header
        - rename label name as fallback
        - move struct amdgpu_vram_mgr to amdgpu_vram_mgr.h
        - remove unnecessary flags from struct amdgpu_vram_reservation
        - rewrite block NULL check condition
        - change else style as per coding standard
        - rewrite the node max size
        - add a helper function to fetch the first entry from the list
      
      v10(Christian):
         - rename amdgpu_get_node() function name as amdgpu_vram_mgr_first_block
      
      v11:
         - if size is not aligned with min_page_size, enable is_contiguous flag,
           therefore, the size round up to the power of two and trimmed to the
           original size.
      v12:
         - rename the function names having prefix as amdgpu_vram_mgr_*()
         - modify the round_up() logic conforming to contiguous flag enablement
           or if size is not aligned to min_block_size
         - modify the trim logic
         - rename node as block wherever applicable
      Signed-off-by: NArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
      Acked-by: NChristian König <christian.koenig@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220407224843.2416-1-Arunpravin.PaneerSelvam@amd.comSigned-off-by: NChristian König <christian.koenig@amd.com>
      c9cad937
  11. 14 2月, 2022 1 次提交
  12. 08 2月, 2022 1 次提交
  13. 26 1月, 2022 2 次提交
  14. 12 1月, 2022 1 次提交
  15. 31 8月, 2021 1 次提交
  16. 01 7月, 2021 1 次提交
    • O
      drm/amdgpu: Set ttm caching flags during bo allocation · 8dbe43e9
      Oak Zeng 提交于
      The ttm caching flags (ttm_cached, ttm_write_combined etc) are
      used to determine a buffer object's mapping attributes in both
      CPU page table and GPU page table (when that buffer is also
      accessed by GPU). Currently the ttm caching flags are set in
      function amdgpu_ttm_io_mem_reserve which is called during
      DRM_AMDGPU_GEM_MMAP ioctl. This has a problem since the GPU
      mapping of the buffer object (ioctl DRM_AMDGPU_GEM_VA) can
      happen earlier than the mmap time, thus the GPU page table
      update code can't pick up the right ttm caching flags to
      decide the right GPU page table attributes.
      
      This patch moves the ttm caching flags setting to function
      amdgpu_vram_mgr_new - this function is called during the
      first step of a buffer object create (eg, DRM_AMDGPU_GEM_CREATE)
      so the later both CPU and GPU mapping function calls will
      pick up this flag for CPU/GPU page table set up.
      
      v2: rebase (Alex)
      Signed-off-by: NOak Zeng <Oak.Zeng@amd.com>
      Suggested-by: NChristian Koenig <Christian.Koenig@amd.com>
      Reviewed-by: NChristian Koenig <Christian.Koenig@amd.com>
      Reviewed-by: NFeifei Xu <Feifei.Xu@amd.com>
      Tested-by: NPo Huang <Po.Huang@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      8dbe43e9
  17. 10 6月, 2021 1 次提交
  18. 04 6月, 2021 2 次提交
  19. 02 6月, 2021 1 次提交
  20. 20 5月, 2021 3 次提交
  21. 29 4月, 2021 1 次提交
  22. 24 4月, 2021 1 次提交
  23. 23 4月, 2021 1 次提交
  24. 16 4月, 2021 1 次提交
  25. 10 4月, 2021 1 次提交
    • T
      drm/amdgpu: Convert sysfs sprintf/snprintf family to sysfs_emit · 36000c7a
      Tian Tao 提交于
      Fix the following coccicheck warning:
      drivers/gpu//drm/amd/amdgpu/amdgpu_ras.c:434:9-17: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_xgmi.c:220:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_xgmi.c:249:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/df_v3_6.c:208:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_psp.c:2973:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_vram_mgr.c:75:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_vram_mgr.c:112:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_vram_mgr.c:58:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_vram_mgr.c:93:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_vram_mgr.c:125:9-17: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_gtt_mgr.c:52:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_gtt_mgr.c:71:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_device.c:140:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_device.c:164:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_device.c:186:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_device.c:208:8-16: WARNING:
      use scnprintf or sprintf
      drivers/gpu//drm/amd/amdgpu/amdgpu_atombios.c:1916:8-16: WARNING:
      use scnprintf or sprintf
      Signed-off-by: NTian Tao <tiantao6@hisilicon.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      36000c7a
  26. 24 3月, 2021 1 次提交
  27. 27 2月, 2021 2 次提交
  28. 03 2月, 2021 1 次提交
  29. 14 11月, 2020 1 次提交
    • L
      drm/amd/amdgpu/amdgpu_vram_mgr: Add missing descriptions for 'dev' and 'dir' · 2c8645b7
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c:648: warning: Function parameter or member 'dev' not described in 'amdgpu_vram_mgr_free_sgt'
       drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c:648: warning: Function parameter or member 'dir' not described in 'amdgpu_vram_mgr_free_sgt'
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      2c8645b7
  30. 03 11月, 2020 1 次提交
  31. 30 10月, 2020 1 次提交
    • D
      drm/amdgpu: fix the issue of reserving bad pages failed · 676deb38
      Dennis Li 提交于
      In amdgpu_ras_reset_gpu, because bad pages may not be freed,
      it has high probability to reserve bad pages failed.
      
      Change to reserve bad pages when freeing VRAM.
      
      v2:
      1. avoid allocating the drm_mm node outside of amdgpu_vram_mgr.c
      2. move bad page reserving into amdgpu_ras_add_bad_pages, if vram mgr
         reserve bad page failed, it will put it into pending list, otherwise
         put it into processed list;
      3. remove amdgpu_ras_release_bad_pages, because retired page's info has
         been moved into amdgpu_vram_mgr
      
      v3:
      1. formate code style;
      2. rename amdgpu_vram_reserve_scope as amdgpu_vram_reservation;
      3. rename scope_pending as reservations_pending;
      4. rename scope_processed as reserved_pages;
      5. change to iterate over all the pending ones and try to insert them
         with drm_mm_reserve_node();
      
      v4:
      1. rename amdgpu_vram_mgr_reserve_scope as
      amdgpu_vram_mgr_reserve_range;
      2. remove unused include "amdgpu_ras.h";
      3. rename amdgpu_vram_mgr_check_and_reserve as
      amdgpu_vram_mgr_do_reserve;
      4. refine amdgpu_vram_mgr_reserve_range to call
      amdgpu_vram_mgr_do_reserve.
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Reviewed-by: NHawking Zhang <hawking.zhang@amd.com>
      Signed-off-by: NDennis Li <Dennis.Li@amd.com>
      Signed-off-by: NWenhui Sheng <Wenhui.Sheng@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      676deb38