Skip to contentSkip to conversation

drm/i915: Fallback to reserve forcewake if primary ack missing

PATCH In review Mika Kuoppala 3 participants 4 messages Oct 31, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915: Fallback to reserve forcewake if primary ack missing

There is a possibility on gen9 hardware to miss the forcewake ack message. The recommended workaround is to use another free bit and toggle it until original bit is successfully acknowledged.

Some future gen9 revs might or might not fix the underlying issue but the fallback to reserve bit dance can be considered as harmless:
without the ack timeout we never reach the reserve bit forcewake. Thus as of now we adopt a blanket approach for all gen9 and leave the bypassing the reserve bit approach for future patches if corresponding hw revisions do appear.

Commit 83e3337204b2 ("drm/i915: Increase maximum polling time to 50ms for forcewake request/clear ack") did increase the forcewake timeout. If the issue was a delayed ack, future work could include finding a suitable timeout value both for primary ack and reserve toggle to reduce the worst case latency.

v2: use bit 15, naming, comment (Chris), only wait fallback ack
v3: fix return on fallback, backoff after fallback write (Chris)
v4: udelay on first pass, grammar (Chris)

References: HSDES #1604254524
References: https://bugs.freedesktop.org/show_bug.cgi?id=102051

Cc Chris Wilson <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h     |   5 +-
 drivers/gpu/drm/i915/intel_uncore.c | 137 +++++++++++++++++++++++++++++++++---
 2 files changed, 130 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +3 -2
index 8c775e96b4e4..f0f8f6059652 100644
@@ -7774,8 +7774,9 @@ enum {
 #define  FORCEWAKE_ACK_MEDIA_GEN9		_MMIO(0x0D88)
 #define  FORCEWAKE_ACK_RENDER_GEN9		_MMIO(0x0D84)
 #define  FORCEWAKE_ACK_BLITTER_GEN9		_MMIO(0x130044)
-#define   FORCEWAKE_KERNEL			0x1
-#define   FORCEWAKE_USER			0x2
+#define   FORCEWAKE_KERNEL			BIT(0)
+#define   FORCEWAKE_USER			BIT(1)
+#define   FORCEWAKE_KERNEL_FALLBACK		BIT(15)
 #define  FORCEWAKE_MT_ACK			_MMIO(0x130040)
 #define  ECOBUS					_MMIO(0xa180)
 #define    FORCEWAKE_MT_ENABLE			(1<<5)
drivers/gpu/drm/i915/intel_uncore.c +127 -10

175 lines not on this page · raw message

Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 drm/i915: Print the condition causing GEM_BUG_ON

It is easier to categorize and debug bugs if the failed condition is in plain sight in the actual dmesg output. Make it so.

---
 drivers/gpu/drm/i915/i915_gem.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.h +5 -1
index ee54597465b6..84ba68e83df5 100644
@@ -28,7 +28,11 @@
 #include <linux/bug.h>
 
 #ifdef CONFIG_DRM_I915_DEBUG_GEM
-#define GEM_BUG_ON(expr) BUG_ON(expr)
+#define GEM_BUG_ON(condition) do { if (unlikely((condition))) {	\
+		printk(KERN_ERR "GEM_BUG_ON(%s)\n", __stringify(condition)); \
+		BUG(); \
+		} \
+	} while(0)
 #define GEM_WARN_ON(expr) WARN_ON(expr)
 
 #define GEM_DEBUG_DECL(var) var
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Re: [CI 2/2] drm/i915: Print the condition causing GEM_BUG_ON

Quoting Mika Kuoppala (2017-10-31 11:22:54)

Quoted 16 lines

It is easier to categorize and debug bugs if the failed condition is in plain sight in the actual dmesg output. Make it so.

---
 drivers/gpu/drm/i915/i915_gem.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.h +0 -0
index ee54597465b6..84ba68e83df5 100644

drivers/gpu/drm/i915/i915_gem.h line 35

Quoted 9 lines
drivers/gpu/drm/i915/i915_gem.h +5 -1
@@ -28,7 +28,11 @@
 #include <linux/bug.h>
 
 #ifdef CONFIG_DRM_I915_DEBUG_GEM
-#define GEM_BUG_ON(expr) BUG_ON(expr)
+#define GEM_BUG_ON(condition) do { if (unlikely((condition))) {        \
+               printk(KERN_ERR "GEM_BUG_ON(%s)\n", __stringify(condition)); \
+               BUG(); \
+               } \
+       } while(0)

I'm thinking the ones we actually hit, we should spend the time in writing up better debug output (i.e. GEM_BUG(expr, fmt, ...));

GEM_BUG_ON(expr) would become GEM_BUG(expr, __stringify(expr)); That shall be the next task.
-Chris
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

✗ Fi.CI.BAT: failure for series starting with [CI,1/2] drm/i915: Fallback to reserve forcewake if primary ack missing

In reply to Mika Kuoppala
== Series Details ==

== Series Details ==

Series: series starting with [CI,1/2] drm/i915: Fallback to reserve forcewake if primary ack missing
URL : https://patchwork.freedesktop.org/series/32896/
State : failure

== Summary ==

Series 32896v1 series starting with [CI,1/2] drm/i915: Fallback to reserve forcewake if primary ack missing
https://patchwork.freedesktop.org/api/1.0/series/32896/revisions/1/mbox/

Test chamelium:

        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test gem_exec_flush:
        Subgroup basic-uc-set-default:
                pass       -> INCOMPLETE (fi-cnl-y)
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-elk-e7500)
        Subgroup read-crc-pipe-a-frame-sequence:
                pass       -> INCOMPLETE (fi-elk-e7500)
Test pm_rpm:
        Subgroup basic-rte:
                skip       -> PASS       (fi-hsw-4770r) fdo#103522
Test drv_module_reload:
        Subgroup basic-reload-inject:
                incomplete -> DMESG-WARN (fi-cfl-s) fdo#103206

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#103522 https://bugs.freedesktop.org/show_bug.cgi?id=103522
fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:438s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:453s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:374s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:530s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:265s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:497s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:499s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:490s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:479s
fi-cfl-s         total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  time:546s
fi-cnl-y         total:67   pass:50   dwarn:0   dfail:0   fail:0   skip:16 
fi-elk-e7500     total:240  pass:188  dwarn:1   dfail:0   fail:0   skip:50 
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:250s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:577s
fi-glk-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  time:483s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:424s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:425s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:417s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:496s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:465s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:481s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:573s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:583s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:551s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:454s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:587s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:653s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:513s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:497s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:456s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:560s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:421s

dfe1410689e638c987b39e07288bc1951cb252f3 drm-tip: 2017y-10m-31d-09h-42m-59s UTC integration manifest 55af6238fafc drm/i915: Print the condition causing GEM_BUG_ON
0fe1550f4402 drm/i915: Fallback to reserve forcewake if primary ack missing

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6276/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx