Skip to contentSkip to conversation

drm/i915/cnp: Ignore VBT request for know invalid DDC pin.

PATCH Applied Rodrigo Vivi 5 participants 10 messages Jan 23, 2018 – Jan 24, 2018

Subsystems (2)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

PATCH 1/1 drm/i915/cnp: Ignore VBT request for know invalid DDC pin.

Let's ignore VBT request if the pin is clearly wrong.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104139

---
 drivers/gpu/drm/i915/intel_bios.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_bios.c +8 -3
index b0668202dc7e..95f0b310d656 100644
@@ -1115,9 +1115,14 @@ static const u8 cnp_ddc_pin_map[] = {
 
 static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin)
 {
-	if (HAS_PCH_CNP(dev_priv) &&
-	    vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map))
-		return cnp_ddc_pin_map[vbt_pin];
+	if (HAS_PCH_CNP(dev_priv)) {
+		if (vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map))
+			return cnp_ddc_pin_map[vbt_pin];
+		if (vbt_pin > GMBUS_PIN_4_CNP) {
+			DRM_DEBUG_KMS("Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n", vbt_pin);
+			return 0;
+		}
+	}
 
 	return vbt_pin;
 }
Signature · 6 lines
2.13.6

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

✓ Fi.CI.BAT: success for drm/i915/cnp: Ignore VBT request for know invalid DDC pin.

== Series Details ==

== Series Details ==

Series: drm/i915/cnp: Ignore VBT request for know invalid DDC pin.
URL : https://patchwork.freedesktop.org/series/36988/
State : success

== Summary ==

Series 36988v1 drm/i915/cnp: Ignore VBT request for know invalid DDC pin.
https://patchwork.freedesktop.org/api/1.0/series/36988/revisions/1/mbox/

Test debugfs_test:

        Subgroup read_all_entries:
                dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989 +2
Test gem_ringfill:
        Subgroup basic-default-hang:
                dmesg-warn -> PASS       (fi-pnv-d510) fdo#101600

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#101600 https://bugs.freedesktop.org/show_bug.cgi?id=101600

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:419s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:426s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:373s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:492s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:489s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:486s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:466s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:462s
fi-elk-e7500     total:229  pass:172  dwarn:10  dfail:0   fail:0   skip:46 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:280s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:511s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:390s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:412s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:449s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:416s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:456s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:496s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:451s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:500s
fi-pnv-d510      total:288  pass:223  dwarn:0   dfail:0   fail:0   skip:65  time:563s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:429s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:527s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:492s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:485s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:416s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:530s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:397s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:568s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:472s

5e022f5f329c7909cb9aa938364072329f694fb2 drm-tip: 2018y-01m-23d-17h-29m-20s UTC integration manifest e8a94473f3e0 drm/i915/cnp: Ignore VBT request for know invalid DDC pin.

== Logs ==

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

author maintainer Reviewed-by Radhakrishna Sripada on v1 1/1 Applied
#2 lore raw
In reply to Rodrigo Vivi
Quoted 5 lines · Rodrigo Vivi

Let's ignore VBT request if the pin is clearly wrong.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104139

(f2f)
thanks

merged to dinq.

Quoted 29 lines
---
 drivers/gpu/drm/i915/intel_bios.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_bios.c +8 -3
index b0668202dc7e..95f0b310d656 100644
@@ -1115,9 +1115,14 @@ static const u8 cnp_ddc_pin_map[] = {
 
 static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin)
 {
-	if (HAS_PCH_CNP(dev_priv) &&
-	    vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map))
-		return cnp_ddc_pin_map[vbt_pin];
+	if (HAS_PCH_CNP(dev_priv)) {
+		if (vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map))
+			return cnp_ddc_pin_map[vbt_pin];
+		if (vbt_pin > GMBUS_PIN_4_CNP) {
+			DRM_DEBUG_KMS("Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n", vbt_pin);
+			return 0;
+		}
+	}
 
 	return vbt_pin;
 }
Signature · 1 line
2.13.6

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

maintainer
#3 lore raw
Quoted 7 lines · Rodrigo Vivi
Quoted 5 lines · Rodrigo Vivi

Let's ignore VBT request if the pin is clearly wrong.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104139

Quoted 5 lines

(f2f)
thanks

merged to dinq.

A bit too fast IMO. The bug report doesn't include the vbt dump which you should *always* look at before making workarounds for vbt.

Also, see below.

Quoted 10 lines
Quoted 10 lines
---
 drivers/gpu/drm/i915/intel_bios.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_bios.c +0 -0
index b0668202dc7e..95f0b310d656 100644
@@ -1115,9 +1115,14 @@ static const u8 cnp_ddc_pin_map[] = {
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_bios.c static const u8 cnp_ddc_pin_map[] = { · line 1124

Quoted 12 lines
drivers/gpu/drm/i915/intel_bios.c +7 -3
 static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin)
 {
-	if (HAS_PCH_CNP(dev_priv) &&
-	    vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map))
-		return cnp_ddc_pin_map[vbt_pin];
+	if (HAS_PCH_CNP(dev_priv)) {
+		if (vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map))
+			return cnp_ddc_pin_map[vbt_pin];
+		if (vbt_pin > GMBUS_PIN_4_CNP) {
+			DRM_DEBUG_KMS("Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n", vbt_pin);
+			return 0;
+		}

The original code was wrong in the sense that it would only do the mapping if the provided vbt_pin was within bounds for CNP, and would return the unmapped vbt_pin otherwise. Instead, I think you should directly return 0 for out of bounds vbt_pin.

This change here is effectively the same, but more confusing. As if there's a case where the vbt_pin can be both out of bounds, within CNP pin limits, and should be returned unmapped. That can't happen, so please make the code reflect that.

BR,
Jani.

Quoted 11 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_bios.c +1 -0
+	}
 
 	return vbt_pin;
 }
Signature · 1 line
2.13.6

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

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Hi,

Quoted 3 lines · Jani Nikula

A bit too fast IMO. The bug report doesn't include the vbt dump which you should *always* look at before making workarounds for vbt.

I didn’t have access to the machine in question until now, I can provide VBT dump as well as i915_opregion requested by Ville.

But how do I make a VBT dump?

Kai-Heng

Quoted 3 lines
Signature · 2 lines
-- 
Jani Nikula, Intel Open Source Technology Center

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

maintainer
#5 lore raw
Quoted 10 lines · Kai Heng Feng

Hi,

Quoted 3 lines · Jani Nikula

A bit too fast IMO. The bug report doesn't include the vbt dump which you should *always* look at before making workarounds for vbt.

I didn’t have access to the machine in question until now, I can provide VBT dump as well as i915_opregion requested by Ville.

But how do I make a VBT dump?

Copy /sys/kernel/debug/dri/0/i915_vbt

I don't think the opregion will be necessary, I think Ville asks for it for the vbt, which on most platforms is contained in the opregion.

BR,
Jani.

Quoted 7 lines

Kai-Heng

Quoted 3 lines
Signature · 2 lines
-- 
Jani Nikula, Intel Open Source Technology Center
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 13 lines · Jani Nikula
Quoted 9 lines · Kai Heng Feng

Hi,

Quoted 3 lines · Jani Nikula

A bit too fast IMO. The bug report doesn't include the vbt dump which you should *always* look at before making workarounds for vbt.

I didn’t have access to the machine in question until now, I can provide VBT dump as well as i915_opregion requested by Ville.

Quoted 7 lines
Quoted 1 line

But how do I make a VBT dump?

Copy /sys/kernel/debug/dri/0/i915_vbt

I don't think the opregion will be necessary, I think Ville asks for it for the vbt, which on most platforms is contained in the opregion.

Thanks for the tip.

Attached i915_vbt:
https://bugs.freedesktop.org/attachment.cgi?id=136935

Kai-Heng

Quoted 5 lines

BR,
Jani.

Quoted 1 line
Quoted 9 lines
Quoted 6 lines

Kai-Heng

Quoted 3 lines
Signature · 2 lines
-- 
Jani Nikula, Intel Open Source Technology Center
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

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

#7 lore raw
In reply to Jani Nikula
Quoted 10 lines · Jani Nikula
Quoted 9 lines · Kai Heng Feng

Hi,

Quoted 3 lines · Jani Nikula

A bit too fast IMO. The bug report doesn't include the vbt dump which you should *always* look at before making workarounds for vbt.

I didn’t have access to the machine in question until now, I can provide VBT dump as well as i915_opregion requested by Ville.

Quoted 6 lines
Quoted 1 line

But how do I make a VBT dump?

Copy /sys/kernel/debug/dri/0/i915_vbt

I don't think the opregion will be necessary, I think Ville asks for it for the vbt, which on most platforms is contained in the opregion.

Old habits...

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#8 lore raw
In reply to Jani Nikula
Quoted 8 lines · Jani Nikula
Quoted 7 lines · Rodrigo Vivi
Quoted 5 lines · Rodrigo Vivi

Let's ignore VBT request if the pin is clearly wrong.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104139

Quoted 8 lines
Quoted 5 lines

(f2f)
thanks

merged to dinq.

A bit too fast IMO. The bug report doesn't include the vbt dump which you should *always* look at before making workarounds for vbt.

my apologies. My biggest mistake was taking so long to reply to the bug and taking so long to post the patch here. :(

I looked to the VBT now and it is really just this ddc pin for this particular port wrong. Or should I look to something else?

What other kind of useful information would that bring to us normally?

Quoted 31 lines

Also, see below.

Quoted 10 lines
Quoted 10 lines
---
 drivers/gpu/drm/i915/intel_bios.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_bios.c +0 -0
index b0668202dc7e..95f0b310d656 100644
@@ -1115,9 +1115,14 @@ static const u8 cnp_ddc_pin_map[] = {
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_bios.c static const u8 cnp_ddc_pin_map[] = { · line 1124

Quoted 12 lines
drivers/gpu/drm/i915/intel_bios.c +7 -3
 static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin)
 {
-	if (HAS_PCH_CNP(dev_priv) &&
-	    vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map))
-		return cnp_ddc_pin_map[vbt_pin];
+	if (HAS_PCH_CNP(dev_priv)) {
+		if (vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map))
+			return cnp_ddc_pin_map[vbt_pin];
+		if (vbt_pin > GMBUS_PIN_4_CNP) {
+			DRM_DEBUG_KMS("Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n", vbt_pin);
+			return 0;
+		}

The original code was wrong in the sense that it would only do the mapping if the provided vbt_pin was within bounds for CNP, and would return the unmapped vbt_pin otherwise. Instead, I think you should directly return 0 for out of bounds vbt_pin.

Quoted 4 lines

This change here is effectively the same, but more confusing. As if there's a case where the vbt_pin can be both out of bounds, within CNP pin limits, and should be returned unmapped. That can't happen, so please make the code reflect that.

Yes. That's a great idea. Thanks for the suggestion.

Honestly, at first I assumed our behavior was something like this so I couldn't believe we had the issue even with the original mapping there. But when I did the last fix
I avoided changing the original behavior and messed things up. Sorry.

Thanks,
Rodrigo.

Quoted 7 lines

BR,
Jani.

Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_bios.c +1 -0
+	}
 
Quoted 12 lines
Quoted 9 lines
Quoted 5 lines
drivers/gpu/drm/i915/intel_bios.c +0 -0
 	return vbt_pin;
 }
Signature · 1 line
2.13.6

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

Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

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

#9 lore raw

✓ Fi.CI.IGT: success for drm/i915/cnp: Ignore VBT request for know invalid DDC pin.

In reply to Rodrigo Vivi
== Series Details ==

== Series Details ==

Series: drm/i915/cnp: Ignore VBT request for know invalid DDC pin.
URL : https://patchwork.freedesktop.org/series/36988/
State : success

== Summary ==

Test kms_flip:

        Subgroup 2x-plain-flip-fb-recreate:
                fail       -> PASS       (shard-hsw)
        Subgroup flip-vs-expired-vblank-interruptible:
                fail       -> PASS       (shard-hsw) fdo#102887
Test drv_suspend:
        Subgroup fence-restore-untiled:
                skip       -> PASS       (shard-snb) fdo#102365
Test gem_softpin:
        Subgroup noreloc-s4:
                fail       -> SKIP       (shard-snb) fdo#103375

fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375

shard-apl        total:2753 pass:1716 dwarn:1   dfail:0   fail:22  skip:1013 time:13982s
shard-hsw        total:2753 pass:1726 dwarn:1   dfail:0   fail:10  skip:1015 time:15436s
shard-snb        total:2753 pass:1319 dwarn:1   dfail:0   fail:9   skip:1424 time:7928s

Blacklisted hosts:
shard-kbl total:2753 pass:1836 dwarn:3 dfail:0 fail:24 skip:890 time:11032s

== Logs ==

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