1. 21 Nov, 2022 2 commits
  2. 18 Nov, 2022 1 commit
    • Matt Roper's avatar
      drm/i915/gt: Manage uncore->lock while waiting on MCR register · 192bb40f
      Matt Roper authored
      The GT MCR code currently relies on uncore->lock to avoid race
      conditions on the steering control register during MCR operations.  The
      *_fw() versions of MCR operations expect the caller to already hold
      uncore->lock, while the non-fw variants manage the lock internally.
      However the sole callsite of intel_gt_mcr_wait_for_reg_fw() does not
      currently obtain the forcewake lock, allowing a potential race condition
      (and triggering an assertion on lockdep builds).  Furthermore, since
      'wait for register value' requests may not return immediately, it is
      undesirable to hold a fundamental lock like uncore->lock for the entire
      wait and block all other MMIO for the duration; rather the lock is only
      needed around the MCR read operations and can be released during the
      delays.
      
      Convert intel_gt_mcr_wait_for_reg_fw() to a non-fw variant that will
      manage uncore->lock internally.  This does have the side effect of
      causing an unnecessary lookup in the forcewake table on each read
      operation, but since the caller is still holding the relevant forcewake
      domain, this will ultimately just incremenent the reference count and
      won't actually cause any additional MMIO traffic.
      
      In the future we plan to switch to a dedicated MCR lock to protect the
      steering critical section rather than using the overloaded and
      high-traffic uncore->lock; on MTL and beyond the new lock can be
      implemented on top of the hardware-provided synchonization mechanism for
      steering.
      
      Fixes: 3068bec8 ("drm/i915/gt: Add intel_gt_mcr_wait_for_reg_fw()")
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221117173358.1980230-1-matthew.d.roper@intel.com
      192bb40f
  3. 17 Nov, 2022 5 commits
  4. 16 Nov, 2022 7 commits
  5. 15 Nov, 2022 2 commits
  6. 14 Nov, 2022 9 commits
  7. 11 Nov, 2022 1 commit
  8. 10 Nov, 2022 2 commits
  9. 09 Nov, 2022 1 commit
  10. 08 Nov, 2022 3 commits
  11. 07 Nov, 2022 6 commits
  12. 04 Nov, 2022 1 commit
    • John Harrison's avatar
      drm/i915/guc: Don't deadlock busyness stats vs reset · 178b8a36
      John Harrison authored
      The engine busyness stats has a worker function to do things like
      64bit extend the 32bit hardware counters. The GuC's reset prepare
      function flushes out this worker function to ensure no corruption
      happens during the reset. Unforunately, the worker function has an
      infinite wait for active resets to finish before doing its work. Thus
      a deadlock would occur if the worker function had actually started
      just as the reset starts.
      
      The function being used to lock the reset-in-progress mutex is called
      intel_gt_reset_trylock(). However, as noted it does not follow
      standard 'trylock' conventions and exit if already locked. So rename
      the current _trylock function to intel_gt_reset_lock_interruptible(),
      which is the behaviour it actually provides. In addition, add a new
      implementation of _trylock and call that from the busyness stats
      worker instead.
      
      v2: Rename existing trylock to interruptible rather than trying to
      preserve the existing (confusing) naming scheme (review comments from
      Tvrtko).
      Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: default avatarUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221102192109.2492625-3-John.C.Harrison@Intel.com
      178b8a36