Skip to contentSkip to conversation

drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads

PATCH New Yunwei Zhang 2 participants 3 messages Mar 22, 2018

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

PATCH 1/2 drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads

WaProgramMgsrForCorrectSliceSpecificMmioReads dictate that before any MMIO read into Slice/Subslice specific registers, MCR packet control register(0xFDC) needs to be programmed to point to any enabled slice/subslice pair. Otherwise, incorrect value will be returned.

However, that means each subsequent MMIO read will be forwarded to a specific slice/subslice combination as read is unicast. This is OK since slice/subslice specific register values are consistent in almost all cases across slice/subslice. There are rare occasions such as INSTDONE that this value will be dependent on slice/subslice combo, in such cases, we need to program 0xFDC and recover this after. This is already covered by read_subslice_reg for INSTDONE.

Also, 0xFDC will lose its information after TDR/engine reset/power state change.

v2:
- use fls() instead of find_last_bit()
- added INTEL_SSEU to extract sseu from device info.

Cc Oscar Mateo <[email protected]>
Cc Michel Thierry <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Mika Kuoppala <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.h        |  1 +
 drivers/gpu/drm/i915/intel_engine_cs.c | 41 ++++++++++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index d35f805..8484da1 100644
@@ -2287,6 +2287,7 @@ intel_info(const struct drm_i915_private *dev_priv)
 
 #define INTEL_GEN(dev_priv)	((dev_priv)->info.gen)
 #define INTEL_DEVID(dev_priv)	((dev_priv)->info.device_id)
+#define INTEL_SSEU(dev_priv)	((dev_priv)->info.sseu)
 
 #define REVID_FOREVER		0xff
 #define INTEL_REVID(dev_priv)	((dev_priv)->drm.pdev->revision)
drivers/gpu/drm/i915/intel_engine_cs.c +39 -2

69 lines not on this page · raw message

Signature · 6 lines
2.7.4

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

PATCH 2/2 drm/i915: Implement WaProgramMgsrForL3BankSpecificMmioReads

L3Bank could be fused off in hardware for debug purpose, and it is possible that subslice is enabled while its corresponding L3Bank pairs are disabled. In such case, if MCR packet control register(0xFDC) is programed to point to a disabled bank pair, a MMIO read into L3Bank range will return 0 instead of correct values.

However, this is not going to be the case in any production silicon. Therefore, we only check at initialization and issue a warning should this really happen.

v2:
- use fls instead of find_last_bit
- use is_power_of_2() instead of counting bit set

Cc Oscar Mateo <[email protected]>
Cc Michel Thierry <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Mika Kuoppala <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h        |  4 ++++
 drivers/gpu/drm/i915/intel_engine_cs.c | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +4 -0
index abdc513..b283427 100644
@@ -2849,6 +2849,10 @@ enum i915_power_well_id {
 #define   GEN10_F2_SS_DIS_SHIFT		18
 #define   GEN10_F2_SS_DIS_MASK		(0xf << GEN10_F2_SS_DIS_SHIFT)
 
+#define	GEN10_MIRROR_FUSE3		_MMIO(0x9118)
+#define GEN10_L3BANK_PAIR_COUNT     4
+#define GEN10_L3BANK_MASK   0x0F
+
 #define GEN8_EU_DISABLE0		_MMIO(0x9134)
 #define   GEN8_EU_DIS0_S0_MASK		0xffffff
 #define   GEN8_EU_DIS0_S1_SHIFT		24
drivers/gpu/drm/i915/intel_engine_cs.c +18 -0
index 452840d..6d38a6d 100644
@@ -796,7 +796,25 @@ static u32 calculate_mcr(u32 mcr, struct drm_i915_private *dev_priv)
 static void wa_init_mcr(struct drm_i915_private *dev_priv)
 {
 	u32 mcr;
+	u32 fuse3;
+	const struct sseu_dev_info *sseu = &(INTEL_SSEU(dev_priv));
+	u32 slice;
 
+	/* If more than one slice are enabled, L3Banks should be all enabled */
+	if (is_power_of_2(sseu->slice_mask)) {
+		/*
+		 * WaProgramMgsrForL3BankSpecificMmioReads:
+		 * read FUSE3 for enabled L3 Bank IDs, if L3 Bank matches
+		 * enabled subslice, no need to redirect MCR packet
+		 */
+		slice = fls(sseu->slice_mask);
+		fuse3 = I915_READ(GEN10_MIRROR_FUSE3);
+		if (WARN_ON(!((fuse3 & GEN10_L3BANK_MASK)
+			       & ((sseu->subslice_mask[slice]
+			       | sseu->subslice_mask[slice]>>GEN10_L3BANK_PAIR_COUNT)
+			       & GEN10_L3BANK_MASK))))
+			DRM_WARN("Production silicon should have matched L3Bank and subslice enabled\n");
+	}
 	mcr = I915_READ(GEN8_MCR_SELECTOR);
 	mcr = calculate_mcr(mcr, dev_priv);
 	I915_WRITE(GEN8_MCR_SELECTOR, mcr);
Signature · 6 lines
2.7.4

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

✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads

In reply to Yunwei Zhang
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
URL : https://patchwork.freedesktop.org/series/40495/
State : failure

== Summary ==

Applying: drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_drv.h
M drivers/gpu/drm/i915/intel_engine_cs.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/intel_engine_cs.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/intel_engine_cs.c Auto-merging drivers/gpu/drm/i915/i915_drv.h
Patch failed at 0001 drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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