Commit d253371c authored by Imre Deak's avatar Imre Deak Committed by Jani Nikula

drm/i915/gen9: Increase PCODE request timeout to 50ms

After
commit 2c7d0602
Author: Imre Deak <imre.deak@intel.com>
Date:   Mon Dec 5 18:27:37 2016 +0200

    drm/i915/gen9: Fix PCODE polling during CDCLK change notification

there is still one report of the CDCLK-change request timing out on a
KBL machine, see the Reference link. On that machine the maximum time
the request took to succeed was 34ms, so increase the timeout to 50ms.

v2:
- Change timeout from 100 to 50 ms to maintain the current 50 ms limit
  for atomic waits in the driver. (Chris, Tvrtko)

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=99345
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Acked-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1487946730-17162-1-git-send-email-imre.deak@intel.com
(cherry picked from commit 0129936d)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 34dc8993
...@@ -7923,10 +7923,10 @@ static bool skl_pcode_try_request(struct drm_i915_private *dev_priv, u32 mbox, ...@@ -7923,10 +7923,10 @@ static bool skl_pcode_try_request(struct drm_i915_private *dev_priv, u32 mbox,
* @timeout_base_ms: timeout for polling with preemption enabled * @timeout_base_ms: timeout for polling with preemption enabled
* *
* Keep resending the @request to @mbox until PCODE acknowledges it, PCODE * Keep resending the @request to @mbox until PCODE acknowledges it, PCODE
* reports an error or an overall timeout of @timeout_base_ms+10 ms expires. * reports an error or an overall timeout of @timeout_base_ms+50 ms expires.
* The request is acknowledged once the PCODE reply dword equals @reply after * The request is acknowledged once the PCODE reply dword equals @reply after
* applying @reply_mask. Polling is first attempted with preemption enabled * applying @reply_mask. Polling is first attempted with preemption enabled
* for @timeout_base_ms and if this times out for another 10 ms with * for @timeout_base_ms and if this times out for another 50 ms with
* preemption disabled. * preemption disabled.
* *
* Returns 0 on success, %-ETIMEDOUT in case of a timeout, <0 in case of some * Returns 0 on success, %-ETIMEDOUT in case of a timeout, <0 in case of some
...@@ -7962,14 +7962,15 @@ int skl_pcode_request(struct drm_i915_private *dev_priv, u32 mbox, u32 request, ...@@ -7962,14 +7962,15 @@ int skl_pcode_request(struct drm_i915_private *dev_priv, u32 mbox, u32 request,
* worst case) _and_ PCODE was busy for some reason even after a * worst case) _and_ PCODE was busy for some reason even after a
* (queued) request and @timeout_base_ms delay. As a workaround retry * (queued) request and @timeout_base_ms delay. As a workaround retry
* the poll with preemption disabled to maximize the number of * the poll with preemption disabled to maximize the number of
* requests. Increase the timeout from @timeout_base_ms to 10ms to * requests. Increase the timeout from @timeout_base_ms to 50ms to
* account for interrupts that could reduce the number of these * account for interrupts that could reduce the number of these
* requests. * requests, and for any quirks of the PCODE firmware that delays
* the request completion.
*/ */
DRM_DEBUG_KMS("PCODE timeout, retrying with preemption disabled\n"); DRM_DEBUG_KMS("PCODE timeout, retrying with preemption disabled\n");
WARN_ON_ONCE(timeout_base_ms > 3); WARN_ON_ONCE(timeout_base_ms > 3);
preempt_disable(); preempt_disable();
ret = wait_for_atomic(COND, 10); ret = wait_for_atomic(COND, 50);
preempt_enable(); preempt_enable();
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment