1. 30 Sep, 2023 3 commits
  2. 29 Sep, 2023 4 commits
  3. 28 Sep, 2023 1 commit
  4. 27 Sep, 2023 1 commit
    • Tvrtko Ursulin's avatar
      drm/i915: Do not disable preemption for resets · 1e975e59
      Tvrtko Ursulin authored
      Commit ade8a0f5 ("drm/i915: Make all GPU resets atomic") added a
      preempt disable section over the hardware reset callback to prepare the
      driver for being able to reset from atomic contexts.
      
      In retrospect I can see that the work item at a time was about removing
      the struct mutex from the reset path. Code base also briefly entertained
      the idea of doing the reset under stop_machine in order to serialize
      userspace mmap and temporary glitch in the fence registers (see
      eb8d0f5a ("drm/i915: Remove GPU reset dependence on struct_mutex"),
      but that never materialized and was soon removed in 2caffbf1
      ("drm/i915: Revoke mmaps and prevent access to fence registers across
      reset") and replaced with a SRCU based solution.
      
      As such, as far as I can see, today we still have a requirement that
      resets must not sleep (invoked from submission tasklets), but no need to
      support invoking them from a truly atomic context.
      
      Given that the preemption section is problematic on RT kernels, since the
      uncore lock becomes a sleeping lock and so is invalid in such section,
      lets try and remove it. Potential downside is that our short waits on GPU
      to complete the reset may get extended if CPU scheduling interferes, but
      in practice that probably isn't a deal breaker.
      
      In terms of mechanics, since the preemption disabled block is being
      removed we just need to replace a few of the wait_for_atomic macros into
      busy looping versions which will work (and not complain) when called from
      non-atomic sections.
      
      v2:
       * Fix timeouts which are now in us. (Andi)
       * Update one comment as a drive by. (Andi)
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Chris Wilson <chris.p.wilson@intel.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Andi Shyti <andi.shyti@linux.intel.com>
      Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230926100855.61722-1-tvrtko.ursulin@linux.intel.com
      1e975e59
  5. 26 Sep, 2023 2 commits
  6. 25 Sep, 2023 3 commits
  7. 21 Sep, 2023 3 commits
  8. 20 Sep, 2023 1 commit
  9. 19 Sep, 2023 3 commits
  10. 15 Sep, 2023 3 commits
  11. 14 Sep, 2023 1 commit
  12. 13 Sep, 2023 1 commit
  13. 08 Sep, 2023 1 commit
  14. 07 Sep, 2023 2 commits
  15. 31 Aug, 2023 1 commit
  16. 30 Aug, 2023 1 commit
  17. 29 Aug, 2023 1 commit
  18. 28 Aug, 2023 1 commit
  19. 23 Aug, 2023 1 commit
  20. 22 Aug, 2023 1 commit
    • John Harrison's avatar
      drm/i915/guc: Force a reset on internal GuC error · b2edc414
      John Harrison authored
      If GuC hits an internal error (and survives long enough to report it
      to the KMD), it is basically toast and will stop until a GT reset and
      subsequent GuC reload is performed. Previously, the KMD just printed
      an error message and then waited for the heartbeat to eventually kick
      in and trigger a reset (assuming the heartbeat had not been disabled).
      Instead, force the reset immediately to guarantee that it happens and
      to eliminate the very long heartbeat delay. The captured error state
      is also more likely to be useful if captured at the time of the error
      rather than many seconds later.
      
      Note that it is not possible to trigger a reset from with the G2H
      handler itself. The reset prepare process involves flushing
      outstanding G2H contents. So a deadlock could result. Instead, the G2H
      handler queues a worker thread to do the reset asynchronously.
      
      v2: Flush the worker on suspend and shutdown. Add rate limiting to
      prevent spam from a totally dead system (review feedback from Daniele).
      Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230816003957.3572654-1-John.C.Harrison@Intel.com
      b2edc414
  21. 21 Aug, 2023 5 commits
    • Matt Roper's avatar
      drm/i915: Replace several IS_METEORLAKE with proper IP version checks · 14128d64
      Matt Roper authored
      Many of the IS_METEORLAKE conditions throughout the driver are supposed
      to be checks for Xe_LPG and/or Xe_LPM+ IP, not for the MTL platform
      specifically.  Update those checks to ensure that the code will still
      operate properly if/when these IP versions show up on future platforms.
      
      v2:
       - Update two more conditions (one for pg_enable, one for MTL HuC
         compatibility).
      v3:
       - Don't change GuC/HuC compatibility check, which sounds like it truly
         is specific to the MTL platform.  (Gustavo)
       - Drop a non-lineage workaround number for the OA timestamp frequency
         workaround.  (Gustavo)
      
      Cc: Gustavo Sousa <gustavo.sousa@intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-20-matthew.d.roper@intel.com
      14128d64
    • Matt Roper's avatar
      drm/i915/mtl: Eliminate subplatforms · 2e3c369f
      Matt Roper authored
      Now that we properly match the Xe_LPG IP versions associated with
      various workarounds, there's no longer any need to define separate MTL
      subplatform in the driver.  Nothing in the code is conditional on MTL-M
      or MTL-P base platforms.  Furthermore, I'm not sure the "M" and "P"
      designations are even an accurate representation of which specific
      platforms would have which IP versions; those were mostly just
      placeholders from a long time ago.  The reality is that the IP version
      present on a platform gets read from a fuse register at driver init; we
      shouldn't be trying to guess which IP is present based on PCI ID
      anymore.
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarNemesa Garg <nemesa.garg@intel.com>
      Reviewed-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-18-matthew.d.roper@intel.com
      2e3c369f
    • Matt Roper's avatar
      drm/i915: Eliminate IS_MTL_MEDIA_STEP · 81af8abe
      Matt Roper authored
      Stepping-specific media behavior shouldn't be tied to MTL as a platform,
      but rather specifically to the Xe_LPM+ IP.  Future non-MTL platforms may
      re-use this IP and will need to follow the exact same logic and apply
      the same workarounds.  IS_MTL_MEDIA_STEP() is dropped in favor of
      IS_MEDIA_GT_IP_STEP, which checks the media IP version associated with a
      specific IP and also ensures that we're operating on the media GT, not
      the primary GT.
      
      v2:
       - Switch to the IS_GT_IP_STEP macro.
      v3:
       - Switch back to long-form IS_MEDIA_GT_IP_STEP.  (Jani)
      v4:
       - Build IS_MEDIA_GT_IP_STEP on top of IS_MEDIA_GT_IP_RANGE and
         IS_MEDIA_STEP building blocks and name the parameters from/until
         rather than begin/fixed..  (Jani)
      v5:
       - Tweak macro comment wording.  (Gustavo)
       - Add a check to catch NULL gt in IS_MEDIA_GT_IP_RANGE; this allows it
         to be used safely on i915->media_gt, which may be NULL on some
         platforms.  (Gustavo)
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Gustavo Sousa <gustavo.sousa@intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-16-matthew.d.roper@intel.com
      81af8abe
    • Matt Roper's avatar
      drm/i915: Eliminate IS_MTL_GRAPHICS_STEP · 5a213086
      Matt Roper authored
      Several workarounds are guarded by IS_MTL_GRAPHICS_STEP.  However none
      of these workarounds are actually tied to MTL as a platform; they only
      relate to the Xe_LPG graphics IP, regardless of what platform it appears
      in.  At the moment MTL is the only platform that uses Xe_LPG with IP
      versions 12.70 and 12.71, but we can't count on this being true in the
      future.  Switch these to use a new IS_GFX_GT_IP_STEP() macro instead
      that is purely based on IP version.  IS_GFX_GT_IP_STEP() is also
      GT-based rather than device-based, which will help prevent mistakes
      where we accidentally try to apply Xe_LPG graphics workarounds to the
      Xe_LPM+ media GT and vice-versa.
      
      v2:
       - Switch to a more generic and shorter IS_GT_IP_STEP macro that can be
         used for both graphics and media IP (and any other kind of GTs that
         show up in the future).
      v3:
       - Switch back to long-form IS_GFX_GT_IP_STEP macro.  (Jani)
       - Move macro to intel_gt.h.  (Andi)
      v4:
       - Build IS_GFX_GT_IP_STEP on top of IS_GFX_GT_IP_RANGE and
         IS_GRAPHICS_STEP building blocks and name the parameters from/until
         rather than begin/fixed.  (Jani)
       - Fix usage examples in comment.
      v5:
       - Tweak comment on macro.  (Gustavo)
      
      Cc: Gustavo Sousa <gustavo.sousa@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Andi Shyti <andi.shyti@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
      Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-15-matthew.d.roper@intel.com
      5a213086
    • Matt Roper's avatar
      drm/i915/xelpg: Call Xe_LPG workaround functions based on IP version · f7696ded
      Matt Roper authored
      Although some of our Xe_LPG workarounds were already being applied based
      on IP version correctly, others were matching on MTL as a base platform,
      which is incorrect.  Although MTL is the only platform right now that
      uses Xe_LPG IP, this may not always be the case.  If a future platform
      re-uses this graphics IP, the same workarounds should be applied, even
      if it isn't a "MTL" platform.
      
      We were also incorrectly applying Xe_LPG workarounds/tuning to the
      Xe_LPM+ media IP in one or two places; we should make sure that we don't
      try to apply graphics workarounds to the media GT and vice versa where
      they don't belong.  A new helper macro IS_GT_IP_RANGE() is added to help
      ensure this is handled properly -- it checks that the GT matches the IP
      type being tested as well as the IP version falling in the proper range.
      
      Note that many of the stepping-based workarounds are still incorrectly
      checking for a MTL base platform; that will be remedied in a later
      patch.
      
      v2:
       - Rework macro into a slightly more generic IS_GT_IP_RANGE() that can
         be used for either GFX or MEDIA checks.
      
      v3:
       - Switch back to separate macros for gfx and media.  (Jani)
       - Move macro to intel_gt.h.  (Andi)
      
      Cc: Gustavo Sousa <gustavo.sousa@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Andi Shyti <andi.shyti@linux.intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-14-matthew.d.roper@intel.com
      f7696ded