1. 10 Apr, 2024 5 commits
  2. 27 Mar, 2024 30 commits
  3. 22 Mar, 2024 5 commits
    • Mario Limonciello's avatar
      drm/amd: Flush GFXOFF requests in prepare stage · 0355b24b
      Mario Limonciello authored
      If the system hasn't entered GFXOFF when suspend starts it can cause
      hangs accessing GC and RLC during the suspend stage.
      
      Cc: <stable@vger.kernel.org> # 6.1.y: 5095d541 ("drm/amd: Evict resources during PM ops prepare() callback")
      Cc: <stable@vger.kernel.org> # 6.1.y: cb11ca32 ("drm/amd: Add concept of running prepare_suspend() sequence for IP blocks")
      Cc: <stable@vger.kernel.org> # 6.1.y: 2ceec37b ("drm/amd: Add missing kernel doc for prepare_suspend()")
      Cc: <stable@vger.kernel.org> # 6.1.y: 3a9626c8 ("drm/amd: Stop evicting resources on APUs in suspend")
      Cc: <stable@vger.kernel.org> # 6.6.y: 5095d541 ("drm/amd: Evict resources during PM ops prepare() callback")
      Cc: <stable@vger.kernel.org> # 6.6.y: cb11ca32 ("drm/amd: Add concept of running prepare_suspend() sequence for IP blocks")
      Cc: <stable@vger.kernel.org> # 6.6.y: 2ceec37b ("drm/amd: Add missing kernel doc for prepare_suspend()")
      Cc: <stable@vger.kernel.org> # 6.6.y: 3a9626c8 ("drm/amd: Stop evicting resources on APUs in suspend")
      Cc: <stable@vger.kernel.org> # 6.1+
      Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3132
      Fixes: ab475033 ("drm/amdgpu/sdma5.2: add begin/end_use ring callbacks")
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      0355b24b
    • Srinivasan Shanmugam's avatar
      drm/amdgpu: Fix truncations in gfx_v11_0_init_microcode() · eb4f6eca
      Srinivasan Shanmugam authored
      Reducing the size of ucode_prefix to 25 in the gfx_v11_0_init_microcode
      function. This would ensure that the total number of characters being
      written into fw_name does not exceed its size of 40.
      
      Fixes the below with gcc W=1:
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c: In function ‘gfx_v11_0_early_init’:
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:523:54: warning: ‘_pfp.bin’ directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Wformat-truncation=]
        523 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", ucode_prefix);
            |                                                      ^~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:523:9: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 40
        523 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", ucode_prefix);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:540:54: warning: ‘_me.bin’ directive output may be truncated writing 7 bytes into a region of size between 4 and 33 [-Wformat-truncation=]
        540 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", ucode_prefix);
            |                                                      ^~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:540:9: note: ‘snprintf’ output between 15 and 44 bytes into a destination of size 40
        540 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", ucode_prefix);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:557:70: warning: ‘_rlc.bin’ directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Wformat-truncation=]
        557 |                         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", ucode_prefix);
            |                                                                      ^~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:557:25: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 40
        557 |                         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", ucode_prefix);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:569:54: warning: ‘_mec.bin’ directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Wformat-truncation=]
        569 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", ucode_prefix);
            |                                                      ^~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:569:9: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 40
        569 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", ucode_prefix);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        CC [M]  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_clockpowergating.o
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Suggested-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      eb4f6eca
    • Srinivasan Shanmugam's avatar
      drm/amdgpu: Fix truncation in smu_v11_0_init_microcode · 730dd50f
      Srinivasan Shanmugam authored
      Reducing the size of ucode_prefix to 25 in the smu_v11_0_init_microcode
      function. we ensure that fw_name can accommodate the maximum possible
      string size
      
      Fixes the below with gcc W=1:
      drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c: In function ‘smu_v11_0_init_microcode’:
      drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:110:54: warning: ‘.bin’ directive output may be truncated writing 4 bytes into a region of size between 0 and 29 [-Wformat-truncation=]
        110 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
            |                                                      ^~~~
      drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:110:9: note: ‘snprintf’ output between 12 and 41 bytes into a destination of size 36
        110 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Suggested-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      730dd50f
    • Tao Zhou's avatar
      drm/amdgpu: simplify convert_error_address interface for UMC v12 · 8e4617c2
      Tao Zhou authored
      Replace separate parameters with struct ta_ras_query_address_input.
      Signed-off-by: default avatarTao Zhou <tao.zhou1@amd.com>
      Reviewed-by: default avatarStanley.Yang <Stanley.Yang@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      8e4617c2
    • Srinivasan Shanmugam's avatar
      drm/amdgpu: Fix truncation issues in gfx_v9_0.c · 539ff12e
      Srinivasan Shanmugam authored
      The size of fw_name is increased to ensure that it can accommodate
      the maximum possible size of the string being written into it.
      
      Fixes the below with gcc W=1:
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c: In function ‘gfx_v9_0_early_init’:
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1255:52: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1255 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", chip_name);
            |                                                    ^~
      ......
       1393 |                 r = gfx_v9_0_init_cp_gfx_microcode(adev, ucode_prefix);
            |                                                          ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1255:9: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 30
       1255 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", chip_name);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1261:52: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1261 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", chip_name);
            |                                                    ^~
      ......
       1393 |                 r = gfx_v9_0_init_cp_gfx_microcode(adev, ucode_prefix);
            |                                                          ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1261:9: note: ‘snprintf’ output between 15 and 44 bytes into a destination of size 30
       1261 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", chip_name);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1267:52: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1267 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce.bin", chip_name);
            |                                                    ^~
      ......
       1393 |                 r = gfx_v9_0_init_cp_gfx_microcode(adev, ucode_prefix);
            |                                                          ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1267:9: note: ‘snprintf’ output between 15 and 44 bytes into a destination of size 30
       1267 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce.bin", chip_name);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1303:60: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1303 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc_am4.bin", chip_name);
            |                                                            ^~
      ......
       1398 |         r = gfx_v9_0_init_rlc_microcode(adev, ucode_prefix);
            |                                               ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1303:17: note: ‘snprintf’ output between 20 and 49 bytes into a destination of size 30
       1303 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc_am4.bin", chip_name);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1309:60: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1309 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_kicker_rlc.bin", chip_name);
            |                                                            ^~
      ......
       1398 |         r = gfx_v9_0_init_rlc_microcode(adev, ucode_prefix);
            |                                               ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1309:17: note: ‘snprintf’ output between 23 and 52 bytes into a destination of size 30
       1309 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_kicker_rlc.bin", chip_name);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1311:60: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1311 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", chip_name);
            |                                                            ^~
      ......
       1398 |         r = gfx_v9_0_init_rlc_microcode(adev, ucode_prefix);
            |                                               ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1311:17: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 30
       1311 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", chip_name);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1344:60: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1344 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_sjt_mec.bin", chip_name);
            |                                                            ^~
      ......
       1402 |         r = gfx_v9_0_init_cp_compute_microcode(adev, ucode_prefix);
            |                                                      ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1344:17: note: ‘snprintf’ output between 20 and 49 bytes into a destination of size 30
       1344 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_sjt_mec.bin", chip_name);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1346:60: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1346 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name);
            |                                                            ^~
      ......
       1402 |         r = gfx_v9_0_init_cp_compute_microcode(adev, ucode_prefix);
            |                                                      ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1346:17: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 30
       1346 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1356:68: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1356 |                         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_sjt_mec2.bin", chip_name);
            |                                                                    ^~
      ......
       1402 |         r = gfx_v9_0_init_cp_compute_microcode(adev, ucode_prefix);
            |                                                      ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1356:25: note: ‘snprintf’ output between 21 and 50 bytes into a destination of size 30
       1356 |                         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_sjt_mec2.bin", chip_name);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1358:68: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=]
       1358 |                         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2.bin", chip_name);
            |                                                                    ^~
      ......
       1402 |         r = gfx_v9_0_init_cp_compute_microcode(adev, ucode_prefix);
            |                                                      ~~~~~~~~~~~~
      drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:1358:25: note: ‘snprintf’ output between 17 and 46 bytes into a destination of size 30
       1358 |                         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2.bin", chip_name);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Suggested-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      539ff12e