1. 16 11月, 2022 1 次提交
  2. 01 11月, 2022 1 次提交
  3. 24 9月, 2022 1 次提交
    • J
      drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers. · f158936b
      Jim Cromie 提交于
      Use DECLARE_DYNDBG_CLASSMAP across DRM:
      
       - in .c files, since macro defines/initializes a record
      
       - in drivers, $mod_{drv,drm,param}.c
         ie where param setup is done, since a classmap is param related
      
       - in drm/drm_print.c
         since existing __drm_debug param is defined there,
         and we ifdef it, and provide an elaborated alternative.
      
       - in drm_*_helper modules:
         dp/drm_dp - 1st item in makefile target
         drivers/gpu/drm/drm_crtc_helper.c - random pick iirc.
      
      Since these modules all use identical CLASSMAP declarations (ie: names
      and .class_id's) they will all respond together to "class DRM_UT_*"
      query-commands:
      
        :#> echo class DRM_UT_KMS +p > /proc/dynamic_debug/control
      
      NOTES:
      
      This changes __drm_debug from int to ulong, so BIT() is usable on it.
      
      DRM's enum drm_debug_category values need to sync with the index of
      their respective class-names here.  Then .class_id == category, and
      dyndbg's class FOO mechanisms will enable drm_dbg(DRM_UT_KMS, ...).
      
      Though DRM needs consistent categories across all modules, thats not
      generally needed; modules X and Y could define FOO differently (ie a
      different NAME => class_id mapping), changes are made according to
      each module's private class-map.
      
      No callsites are actually selected by this patch, since none are
      class'd yet.
      Signed-off-by: NJim Cromie <jim.cromie@gmail.com>
      Link: https://lore.kernel.org/r/20220912052852.1123868-3-jim.cromie@gmail.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f158936b
  4. 21 9月, 2022 1 次提交
  5. 20 9月, 2022 2 次提交
    • Y
      drm/amdgpu: Fixed psp fence and memory issues when removing amdgpu device · 83d29a5f
      YiPeng Chai 提交于
      V3:
      Fixed psp fence and memory issues for the asic
      using smu v13_0_2 when removing amdgpu device.
      
      [Why]:
      1. psp_suspend->psp_free_shared_bufs->
             psp_ta_free_shared_buf->
                 amdgpu_bo_free_kernel->
                   ...->amdgpu_bo_release_notify->
                          amdgpu_fill_buffer
         psp will free vram memory used by psp when psp_suspend
         is called. But for the asic using smu v13_0_2, because
         psp_suspend is called before adev->shutdown is set to
         true when removing the first hive device, amdgpu fill_buffer
         will be called, which will cause fence issues when evicting
         all vram resources in amdgpu vram mgr_fini.
      2. Since psp_hw_fini is not called after calling psp_suspend
         and psp_suspend only calls psp_ring_stop, the psp ring memory
         will not be released when amdgpu device is removed.
      
      [How]:
      1. Set shutdown to true before calling amdgpu_device_gpu_recover,
         then amdgpu_fill_buffer will not be called when psp_suspend is
         called.
      2. Free psp ring memory in psp_sw_fini.
      Signed-off-by: NYiPeng Chai <YiPeng.Chai@amd.com>
      Reviewed-by: NHawking Zhang <Hawking.Zhang@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      83d29a5f
    • Y
      drm/amdgpu: Adjust removal control flow for smu v13_0_2 · f5c7e779
      YiPeng Chai 提交于
      Adjust removal control flow for smu v13_0_2:
         During amdgpu uninstallation, when removing the first
      device, the kernel needs to first send a mode1reset message
      to all gpu devices. Otherwise, smu initialization will fail
      the next time amdgpu is installed.
      
      V2:
      1. Update commit comments.
      2. Remove the global variable amdgpu_device_remove_cnt
         and add a variable to the structure amdgpu_hive_info.
      3. Use hive to detect the first removed device instead of
         a global variable.
      
      V3:
       1. Update commit comments.
       2. Split a patch into multiple patches.
       3. The current patch does:
          a. Add a work mode of AMDGPU_RESET_FOR_DEVICE_REMOVE into
             the existing gpu recover path, which make all devices
             in hive list only have HW reset but no resume (except
             the base IP).
          b. Call AMDGPU_RESET_FOR_DEVICE_REMOVE and
             AMDGPU_NEED_FULL_RESET mode of amdgpu_device_gpu_recover
             in amdgpu_pci_remove when removing the first device in
             hive list.
          c. When removing the first device, the IP blocks keyword
             function call sequence is as follows:
      .suspend->mode1reset->.resume(basic ip)->.hw_fini->.early_fini->.sw_fini.
         ^                           |
         |-<----------<---------<----|
      	The first three sequences are because of a call to
              amdgpu_device_gpu_recover. The three sequences will be
              executed in a loop until all devices in the hive list
              are iterated.
              The sequences starting from .hw_fini only apply to the
              first device. Since .suspend has been called before,
              except the resumed phase1 basic ip blocks, all other ip
              blocks .hw_fini of current device will do nothing.
           d. When removing other devices, the calling sequences is the
              same as legacy:
      	   .hw_fini -> .early_fini -> .sw_fini.
      	Since .suspend has been called when removing the first device,
              except the resumed phase1 basic ip blocks, all of other ip
              blocks .hw_fini of current device will do nothing.
      Signed-off-by: NYiPeng Chai <YiPeng.Chai@amd.com>
      Reviewed-by: NHawking Zhang <Hawking.Zhang@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      f5c7e779
  6. 08 9月, 2022 1 次提交
    • Y
      drm/amdgpu: TA unload messages are not actually sent to psp when amdgpu is uninstalled · fac53471
      YiPeng Chai 提交于
      V1:
        The psp_cmd_submit_buf function is called by psp_hw_fini to send
      TA unload messages to psp to terminate ras, asd and tmr. But when
      amdgpu is uninstalled, drm_dev_unplug is called earlier than
      psp_hw_fini in amdgpu_pci_remove, the calling order as follows:
      static void amdgpu_pci_remove(struct pci_dev *pdev) {
      	drm_dev_unplug
      	......
      	amdgpu_driver_unload_kms->amdgpu_device_fini_hw->...
      		->.hw_fini->psp_hw_fini->...
      		->psp_ta_unload->psp_cmd_submit_buf
      	......
      }
      The program will return when calling drm_dev_enter in psp_cmd_submit_buf.
      
      So the call to drm_dev_enter in psp_cmd_submit_buf should be
      removed, so that the TA unload messages can be sent to the psp
      when amdgpu is uninstalled.
      
      V2:
      1. Restore psp_cmd_submit_buf to its original code.
      2. Move drm_dev_unplug call after amdgpu_driver_unload_kms in
         amdgpu_pci_remove.
      3. Since amdgpu_device_fini_hw is called by amdgpu_driver_unload_kms,
         remove the unplug check to release device mmio resource in
         amdgpu_device_fini_hw before calling drm_dev_unplug.
      Signed-off-by: NYiPeng Chai <YiPeng.Chai@amd.com>
      Reviewed-by: NHawking Zhang <Hawking.Zhang@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      fac53471
  7. 30 8月, 2022 1 次提交
  8. 25 7月, 2022 3 次提交
  9. 19 7月, 2022 1 次提交
  10. 08 6月, 2022 1 次提交
  11. 27 5月, 2022 2 次提交
  12. 19 5月, 2022 2 次提交
  13. 06 5月, 2022 1 次提交
  14. 04 5月, 2022 2 次提交
  15. 28 4月, 2022 1 次提交
    • A
      drm/amdgpu: don't runtime suspend if there are displays attached (v3) · f95af4a9
      Alex Deucher 提交于
      We normally runtime suspend when there are displays attached if they
      are in the DPMS off state, however, if something wakes the GPU
      we send a hotplug event on resume (in case any displays were connected
      while the GPU was in suspend) which can cause userspace to light
      up the displays again soon after they were turned off.
      
      Prior to
      commit 087451f3 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's."),
      the driver took a runtime pm reference when the fbdev emulation was
      enabled because we didn't implement proper shadowing support for
      vram access when the device was off so the device never runtime
      suspended when there was a console bound.  Once that commit landed,
      we now utilize the core fb helper implementation which properly
      handles the emulation, so runtime pm now suspends in cases where it did
      not before.  Ultimately, we need to sort out why runtime suspend in not
      working in this case for some users, but this should restore similar
      behavior to before.
      
      v2: move check into runtime_suspend
      v3: wake ups -> wakeups in comment, retain pm_runtime behavior in
          runtime_idle callback
      
      Fixes: 087451f3 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.")
      Link: https://lore.kernel.org/r/20220403132322.51c90903@darkstar.example.org/Tested-by: NMichele Ballabio <ballabio.m@gmail.com>
      Reviewed-by: NEvan Quan <evan.quan@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      f95af4a9
  16. 22 4月, 2022 1 次提交
    • A
      drm/amdgpu: don't runtime suspend if there are displays attached (v3) · 4020c228
      Alex Deucher 提交于
      We normally runtime suspend when there are displays attached if they
      are in the DPMS off state, however, if something wakes the GPU
      we send a hotplug event on resume (in case any displays were connected
      while the GPU was in suspend) which can cause userspace to light
      up the displays again soon after they were turned off.
      
      Prior to
      commit 087451f3 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's."),
      the driver took a runtime pm reference when the fbdev emulation was
      enabled because we didn't implement proper shadowing support for
      vram access when the device was off so the device never runtime
      suspended when there was a console bound.  Once that commit landed,
      we now utilize the core fb helper implementation which properly
      handles the emulation, so runtime pm now suspends in cases where it did
      not before.  Ultimately, we need to sort out why runtime suspend in not
      working in this case for some users, but this should restore similar
      behavior to before.
      
      v2: move check into runtime_suspend
      v3: wake ups -> wakeups in comment, retain pm_runtime behavior in
          runtime_idle callback
      
      Fixes: 087451f3 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.")
      Link: https://lore.kernel.org/r/20220403132322.51c90903@darkstar.example.org/Tested-by: NMichele Ballabio <ballabio.m@gmail.com>
      Reviewed-by: NEvan Quan <evan.quan@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      4020c228
  17. 14 4月, 2022 1 次提交
    • K
      drm/amdgpu: Ensure HDA function is suspended before ASIC reset · 887f75cf
      Kai-Heng Feng 提交于
      DP/HDMI audio on AMD PRO VII stops working after S3:
      [  149.450391] amdgpu 0000:63:00.0: amdgpu: MODE1 reset
      [  149.450395] amdgpu 0000:63:00.0: amdgpu: GPU mode1 reset
      [  149.450494] amdgpu 0000:63:00.0: amdgpu: GPU psp mode1 reset
      [  149.983693] snd_hda_intel 0000:63:00.1: refused to change power state from D0 to D3hot
      [  150.003439] amdgpu 0000:63:00.0: refused to change power state from D0 to D3hot
      ...
      [  155.432975] snd_hda_intel 0000:63:00.1: CORB reset timeout#2, CORBRP = 65535
      
      The offending commit is daf8de08 ("drm/amdgpu: always reset the asic in
      suspend (v2)"). Commit 34452ac3 ("drm/amdgpu: don't use BACO for
      reset in S3 ") doesn't help, so the issue is something different.
      
      Assuming that to make HDA resume to D0 fully realized, it needs to be
      successfully put to D3 first. And this guesswork proves working, by
      moving amdgpu_asic_reset() to noirq callback, so it's called after HDA
      function is in D3.
      
      Fixes: daf8de08 ("drm/amdgpu: always reset the asic in suspend (v2)")
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      887f75cf
  18. 09 4月, 2022 1 次提交
  19. 08 4月, 2022 1 次提交
    • K
      drm/amdgpu: Ensure HDA function is suspended before ASIC reset · 9e051720
      Kai-Heng Feng 提交于
      DP/HDMI audio on AMD PRO VII stops working after S3:
      [  149.450391] amdgpu 0000:63:00.0: amdgpu: MODE1 reset
      [  149.450395] amdgpu 0000:63:00.0: amdgpu: GPU mode1 reset
      [  149.450494] amdgpu 0000:63:00.0: amdgpu: GPU psp mode1 reset
      [  149.983693] snd_hda_intel 0000:63:00.1: refused to change power state from D0 to D3hot
      [  150.003439] amdgpu 0000:63:00.0: refused to change power state from D0 to D3hot
      ...
      [  155.432975] snd_hda_intel 0000:63:00.1: CORB reset timeout#2, CORBRP = 65535
      
      The offending commit is daf8de08 ("drm/amdgpu: always reset the asic in
      suspend (v2)"). Commit 34452ac3 ("drm/amdgpu: don't use BACO for
      reset in S3 ") doesn't help, so the issue is something different.
      
      Assuming that to make HDA resume to D0 fully realized, it needs to be
      successfully put to D3 first. And this guesswork proves working, by
      moving amdgpu_asic_reset() to noirq callback, so it's called after HDA
      function is in D3.
      
      Fixes: daf8de08 ("drm/amdgpu: always reset the asic in suspend (v2)")
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      9e051720
  20. 26 3月, 2022 1 次提交
  21. 05 3月, 2022 1 次提交
  22. 03 3月, 2022 1 次提交
  23. 25 2月, 2022 2 次提交
  24. 24 2月, 2022 3 次提交
  25. 23 2月, 2022 1 次提交
  26. 18 2月, 2022 2 次提交
  27. 17 2月, 2022 1 次提交
  28. 08 2月, 2022 1 次提交
  29. 03 2月, 2022 2 次提交