Skip to contentSkip to conversation

[PATCH 0/3]

PATCH In review Jani Nikula 3 participants 9 messages Jun 6, 2013 – Jun 14, 2013

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

cover [PATCH 0/3]

Hi Greg, Andrew -

Patch 1 is for DMI, bugfixes in patches 2-3 for i915 and included for completeness. After a tested-by they should be good for stable. I'll leave it to Daniel to sort out how the last two get in.

BR,
Jani.

Chris Wilson (1):
drm/i915: Quirk away phantom LVDS on Intel's D510MO mainboard

Jani Nikula (2):
dmi: add support for exact DMI matches in addition to substring
matching
drm/i915: Quirk away phantom LVDS on Intel's D525MW mainboard

 drivers/firmware/dmi_scan.c       |   12 +++++++++---
 drivers/gpu/drm/i915/intel_lvds.c |   16 ++++++++++++++++
 include/linux/mod_devicetable.h   |    6 ++++--
 3 files changed, 29 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/3 drm/i915: Quirk away phantom LVDS on Intel's D510MO mainboard

From: Chris Wilson <[email protected]>

This replaceable mainboard only has a VGA-out, yet it claims to also have a connected LVDS header.

Reported-by [email protected]

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

[Jani: Use DMI_EXACT_MATCH for board name.]
---
 drivers/gpu/drm/i915/intel_lvds.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_lvds.c +8 -0
index 10c3d56..76213e4 100644
@@ -690,6 +690,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Q900"),
 		},
 	},
+	{
+		.callback = intel_no_lvds_dmi_callback,
+		.ident = "Intel D510MO",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
+			DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"),
+		},
+	},
 
 	{ }	/* terminating entry */
 };
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 dmi: add support for exact DMI matches in addition to substring matching

In reply to Jani Nikula

dmi_match() considers a substring match to be a successful match. This is not always sufficient to distinguish between DMI data for different systems. Add support for exact string matching using strcmp() in addition to the substring matching using strstr().

The specific use case in the i915 driver is to allow us to use an exact match for D510MO, without also incorrectly matching D510MOV:

{
	.ident = "Intel D510MO",
	.matches = {
		DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
		DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"),
	},
}
---
 drivers/firmware/dmi_scan.c     |   12 +++++++++---
 include/linux/mod_devicetable.h |    6 ++++--
 2 files changed, 13 insertions(+), 5 deletions(-)
drivers/firmware/dmi_scan.c +9 -3
index b95159b..eb760a2 100644
@@ -551,9 +551,15 @@ static bool dmi_matches(const struct dmi_system_id *dmi)
 		int s = dmi->matches[i].slot;
 		if (s == DMI_NONE)
 			break;
-		if (dmi_ident[s]
-		    && strstr(dmi_ident[s], dmi->matches[i].substr))
-			continue;
+		if (dmi_ident[s]) {
+			if (!dmi->matches[i].exact_match &&
+			    strstr(dmi_ident[s], dmi->matches[i].substr))
+				continue;
+			else if (dmi->matches[i].exact_match &&
+				 !strcmp(dmi_ident[s], dmi->matches[i].substr))
+				continue;
+		}
+
 		/* No match */
 		return false;
 	}
include/linux/mod_devicetable.h +4 -2
index b508016..b3bd7e7 100644
@@ -456,7 +456,8 @@ enum dmi_field {
 };
 
 struct dmi_strmatch {
-	unsigned char slot;
+	unsigned char slot:7;
+	unsigned char exact_match:1;
 	char substr[79];
 };
 
@@ -474,7 +475,8 @@ struct dmi_system_id {
  */
 #define dmi_device_id dmi_system_id
 
-#define DMI_MATCH(a, b)	{ a, b }
+#define DMI_MATCH(a, b)	{ .slot = a, .substr = b }
+#define DMI_EXACT_MATCH(a, b)	{ .slot = a, .substr = b, .exact_match = 1 }
 
 #define PLATFORM_NAME_SIZE	20
 #define PLATFORM_MODULE_PREFIX	"platform:"
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/3 drm/i915: Quirk away phantom LVDS on Intel's D525MW mainboard

In reply to Jani Nikula

This replaceable mainboard only has a VGA-out, yet it claims to also have a connected LVDS header.

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

---
 drivers/gpu/drm/i915/intel_lvds.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_lvds.c +8 -0
index 76213e4..607c06e 100644
@@ -698,6 +698,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"),
 		},
 	},
+	{
+		.callback = intel_no_lvds_dmi_callback,
+		.ident = "Intel D525MW",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
+			DMI_EXACT_MATCH(DMI_BOARD_NAME, "D525MW"),
+		},
+	},
 
 	{ }	/* terminating entry */
 };
Signature · 1 line
1.7.9.5
#4 lore raw
In reply to Jani Nikula

With Greg's address fixed. Please drop the old one from any replies. Sorry for the noise.

Quoted 25 lines · Jani Nikula

Hi Greg, Andrew -

Patch 1 is for DMI, bugfixes in patches 2-3 for i915 and included for completeness. After a tested-by they should be good for stable. I'll leave it to Daniel to sort out how the last two get in.

BR,
Jani.

Chris Wilson (1):
drm/i915: Quirk away phantom LVDS on Intel's D510MO mainboard

Jani Nikula (2):
dmi: add support for exact DMI matches in addition to substring
matching
drm/i915: Quirk away phantom LVDS on Intel's D525MW mainboard

 drivers/firmware/dmi_scan.c       |   12 +++++++++---
 drivers/gpu/drm/i915/intel_lvds.c |   16 ++++++++++++++++
 include/linux/mod_devicetable.h   |    6 ++++--
 3 files changed, 29 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Acked-by on the v1 series
#8 lore raw
In reply to Jani Nikula
Quoted 5 lines · Jani Nikula

Hi Greg, Andrew -

Patch 1 is for DMI, bugfixes in patches 2-3 for i915 and included for completeness. After a tested-by they should be good for stable. I'll leave it to Daniel to sort out how the last two get in.

I'd prefer all to go through the same tree (to avoid tracking them), and conflicts around lvds quirks will be trivial at most. So no problem for me if this doesn't go in through drm-next. So

on the i915 patches for merging through whatever tree the drm stuff goes through.
-Daniel

Quoted 20 lines

BR,
Jani.

Chris Wilson (1):
drm/i915: Quirk away phantom LVDS on Intel's D510MO mainboard

Jani Nikula (2):
dmi: add support for exact DMI matches in addition to substring
matching
drm/i915: Quirk away phantom LVDS on Intel's D525MW mainboard

 drivers/firmware/dmi_scan.c       |   12 +++++++++---
 drivers/gpu/drm/i915/intel_lvds.c |   16 ++++++++++++++++
 include/linux/mod_devicetable.h   |    6 ++++--
 3 files changed, 29 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Acked-by
#5 lore raw
In reply to Jani Nikula
Quoted 3 lines · Jani Nikula

With Greg's address fixed. Please drop the old one from any replies. Sorry for the noise.

Oops, replied with the old one still there.

Greg, Andrew: Imo it's best to merge all three patches through the same tree, so:

on the i915 parts of it. If you want I can also slurp them in through the intel tree, including the new dmi match code.

Thanks, Daniel

Quoted 30 lines · Jani Nikula
Quoted 25 lines

Hi Greg, Andrew -

Patch 1 is for DMI, bugfixes in patches 2-3 for i915 and included for completeness. After a tested-by they should be good for stable. I'll leave it to Daniel to sort out how the last two get in.

BR,
Jani.

Chris Wilson (1):
drm/i915: Quirk away phantom LVDS on Intel's D510MO mainboard

Jani Nikula (2):
dmi: add support for exact DMI matches in addition to substring
matching
drm/i915: Quirk away phantom LVDS on Intel's D525MW mainboard

 drivers/firmware/dmi_scan.c       |   12 +++++++++---
 drivers/gpu/drm/i915/intel_lvds.c |   16 ++++++++++++++++
 include/linux/mod_devicetable.h   |    6 ++++--
 3 files changed, 29 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#6 lore raw
Quoted 7 lines · Daniel Vetter
Quoted 3 lines · Jani Nikula

With Greg's address fixed. Please drop the old one from any replies. Sorry for the noise.

Oops, replied with the old one still there.

Quoted 7 lines

Greg, Andrew: Imo it's best to merge all three patches through the same tree, so:

on the i915 parts of it. If you want I can also slurp them in through the intel tree, including the new dmi match code.

Please feel free to take them through your tree, I don't need to take them.

thanks,

greg k-h

#7 lore raw
Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Daniel Vetter
Quoted 3 lines · Jani Nikula

With Greg's address fixed. Please drop the old one from any replies. Sorry for the noise.

Oops, replied with the old one still there.

Greg, Andrew: Imo it's best to merge all three patches through the same tree, so:

Quoted 7 lines
Quoted 4 lines

on the i915 parts of it. If you want I can also slurp them in through the intel tree, including the new dmi match code.

Please feel free to take them through your tree, I don't need to take them.

Andrew already merged them, so I think we're good.

Thanks, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch