1. 24 Nov, 2022 1 commit
    • Janusz Krzysztofik's avatar
      drm/i915: Fix negative value passed as remaining time · f235dbd5
      Janusz Krzysztofik authored
      Commit b97060a9 ("drm/i915/guc: Update intel_gt_wait_for_idle to work
      with GuC") extended the API of intel_gt_retire_requests_timeout() with an
      extra argument 'remaining_timeout', intended for passing back unconsumed
      portion of requested timeout when 0 (success) is returned.  However, when
      request retirement happens to succeed despite an error returned by a call
      to dma_fence_wait_timeout(), that error code (a negative value) is passed
      back instead of remaining time.  If we then pass that negative value
      forward as requested timeout to intel_uc_wait_for_idle(), an explicit BUG
      will be triggered.
      
      If request retirement succeeds but an error code is passed back via
      remaininig_timeout, we may have no clue on how much of the initial timeout
      might have been left for spending it on waiting for GuC to become idle.
      OTOH, since all pending requests have been successfully retired, that
      error code has been already ignored by intel_gt_retire_requests_timeout(),
      then we shouldn't fail.
      
      Assume no more time has been left on error and pass 0 timeout value to
      intel_uc_wait_for_idle() to give it a chance to return success if GuC is
      already idle.
      
      v3: Don't fail on any error passed back via remaining_timeout.
      
      v2: Fix the issue on the caller side, not the provider.
      
      Fixes: b97060a9 ("drm/i915/guc: Update intel_gt_wait_for_idle to work with GuC")
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Cc: stable@vger.kernel.org # v5.15+
      Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221121145655.75141-2-janusz.krzysztofik@linux.intel.com
      f235dbd5
  2. 23 Nov, 2022 3 commits
  3. 22 Nov, 2022 1 commit
  4. 21 Nov, 2022 4 commits
  5. 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
  6. 17 Nov, 2022 5 commits
  7. 16 Nov, 2022 7 commits
  8. 15 Nov, 2022 2 commits
  9. 14 Nov, 2022 9 commits
  10. 11 Nov, 2022 1 commit
  11. 10 Nov, 2022 2 commits
  12. 09 Nov, 2022 1 commit
  13. 08 Nov, 2022 3 commits