]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.10.11/drm-i915-gen9-increase-pcode-request-timeout-to-50ms.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.10.11 / drm-i915-gen9-increase-pcode-request-timeout-to-50ms.patch
1 From d253371c4c2f5fc2d884ef25f64decd7549aff5a Mon Sep 17 00:00:00 2001
2 From: Imre Deak <imre.deak@intel.com>
3 Date: Fri, 24 Feb 2017 16:32:10 +0200
4 Subject: drm/i915/gen9: Increase PCODE request timeout to 50ms
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Imre Deak <imre.deak@intel.com>
10
11 commit d253371c4c2f5fc2d884ef25f64decd7549aff5a upstream.
12
13 After
14 commit 2c7d0602c815277f7cb7c932b091288710d8aba7
15 Author: Imre Deak <imre.deak@intel.com>
16 Date: Mon Dec 5 18:27:37 2016 +0200
17
18 drm/i915/gen9: Fix PCODE polling during CDCLK change notification
19
20 there is still one report of the CDCLK-change request timing out on a
21 KBL machine, see the Reference link. On that machine the maximum time
22 the request took to succeed was 34ms, so increase the timeout to 50ms.
23
24 v2:
25 - Change timeout from 100 to 50 ms to maintain the current 50 ms limit
26 for atomic waits in the driver. (Chris, Tvrtko)
27
28 Reference: https://bugs.freedesktop.org/show_bug.cgi?id=99345
29 Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
30 Cc: Chris Wilson <chris@chris-wilson.co.uk>
31 Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
32 Signed-off-by: Imre Deak <imre.deak@intel.com>
33 Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
34 Link: http://patchwork.freedesktop.org/patch/msgid/1487946730-17162-1-git-send-email-imre.deak@intel.com
35 (cherry picked from commit 0129936ddda26afd5d9d207c4e86b2425952579f)
36 Signed-off-by: Jani Nikula <jani.nikula@intel.com>
37 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38
39 ---
40 drivers/gpu/drm/i915/intel_pm.c | 11 ++++++-----
41 1 file changed, 6 insertions(+), 5 deletions(-)
42
43 --- a/drivers/gpu/drm/i915/intel_pm.c
44 +++ b/drivers/gpu/drm/i915/intel_pm.c
45 @@ -7895,10 +7895,10 @@ static bool skl_pcode_try_request(struct
46 * @timeout_base_ms: timeout for polling with preemption enabled
47 *
48 * Keep resending the @request to @mbox until PCODE acknowledges it, PCODE
49 - * reports an error or an overall timeout of @timeout_base_ms+10 ms expires.
50 + * reports an error or an overall timeout of @timeout_base_ms+50 ms expires.
51 * The request is acknowledged once the PCODE reply dword equals @reply after
52 * applying @reply_mask. Polling is first attempted with preemption enabled
53 - * for @timeout_base_ms and if this times out for another 10 ms with
54 + * for @timeout_base_ms and if this times out for another 50 ms with
55 * preemption disabled.
56 *
57 * Returns 0 on success, %-ETIMEDOUT in case of a timeout, <0 in case of some
58 @@ -7934,14 +7934,15 @@ int skl_pcode_request(struct drm_i915_pr
59 * worst case) _and_ PCODE was busy for some reason even after a
60 * (queued) request and @timeout_base_ms delay. As a workaround retry
61 * the poll with preemption disabled to maximize the number of
62 - * requests. Increase the timeout from @timeout_base_ms to 10ms to
63 + * requests. Increase the timeout from @timeout_base_ms to 50ms to
64 * account for interrupts that could reduce the number of these
65 - * requests.
66 + * requests, and for any quirks of the PCODE firmware that delays
67 + * the request completion.
68 */
69 DRM_DEBUG_KMS("PCODE timeout, retrying with preemption disabled\n");
70 WARN_ON_ONCE(timeout_base_ms > 3);
71 preempt_disable();
72 - ret = wait_for_atomic(COND, 10);
73 + ret = wait_for_atomic(COND, 50);
74 preempt_enable();
75
76 out: