* [PATCH 1/3] dmi: add support for exact DMI matches in addition to substring matching
2013-06-06 13:53 [PATCH 0/3] Jani Nikula
@ 2013-06-06 13:53 ` Jani Nikula
2013-06-06 13:53 ` [PATCH 2/3] drm/i915: Quirk away phantom LVDS on Intel's D510MO mainboard Jani Nikula
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2013-06-06 13:53 UTC (permalink / raw)
To: linux-kernel, intel-gfx, Andrew Morton, Greg Kroah-Hartman
Cc: chris, daniel, 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"),
},
}
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/firmware/dmi_scan.c | 12 +++++++++---
include/linux/mod_devicetable.h | 6 ++++--
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index b95159b..eb760a2 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -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;
}
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index b508016..b3bd7e7 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -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:"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 2/3] drm/i915: Quirk away phantom LVDS on Intel's D510MO mainboard
2013-06-06 13:53 [PATCH 0/3] Jani Nikula
2013-06-06 13:53 ` [PATCH 1/3] dmi: add support for exact DMI matches in addition to substring matching Jani Nikula
@ 2013-06-06 13:53 ` Jani Nikula
2013-06-06 13:53 ` [PATCH 3/3] drm/i915: Quirk away phantom LVDS on Intel's D525MW mainboard Jani Nikula
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2013-06-06 13:53 UTC (permalink / raw)
To: linux-kernel, intel-gfx, Andrew Morton, Greg Kroah-Hartman
Cc: chris, daniel, jani.nikula
From: Chris Wilson <chris@chris-wilson.co.uk>
This replaceable mainboard only has a VGA-out, yet it claims to also
have a connected LVDS header.
Reported-by: annndddrr@gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63860
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[Jani: Use DMI_EXACT_MATCH for board name.]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 10c3d56..76213e4 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -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 */
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 3/3] drm/i915: Quirk away phantom LVDS on Intel's D525MW mainboard
2013-06-06 13:53 [PATCH 0/3] Jani Nikula
2013-06-06 13:53 ` [PATCH 1/3] dmi: add support for exact DMI matches in addition to substring matching Jani Nikula
2013-06-06 13:53 ` [PATCH 2/3] drm/i915: Quirk away phantom LVDS on Intel's D510MO mainboard Jani Nikula
@ 2013-06-06 13:53 ` Jani Nikula
2013-06-06 13:59 ` [PATCH 0/3] Jani Nikula
2013-06-06 14:33 ` Daniel Vetter
4 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2013-06-06 13:53 UTC (permalink / raw)
To: linux-kernel, intel-gfx, Andrew Morton, Greg Kroah-Hartman
Cc: chris, daniel, 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
Reported-by: Cornel Panceac <cpanceac@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 76213e4..607c06e 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -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 */
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 0/3]
2013-06-06 13:53 [PATCH 0/3] Jani Nikula
` (2 preceding siblings ...)
2013-06-06 13:53 ` [PATCH 3/3] drm/i915: Quirk away phantom LVDS on Intel's D525MW mainboard Jani Nikula
@ 2013-06-06 13:59 ` Jani Nikula
2013-06-13 8:22 ` Daniel Vetter
2013-06-06 14:33 ` Daniel Vetter
4 siblings, 1 reply; 10+ messages in thread
From: Jani Nikula @ 2013-06-06 13:59 UTC (permalink / raw)
To: linux-kernel, intel-gfx, Andrew Morton, Greg Kroah-Hartman
With Greg's address fixed. Please drop the old one from any
replies. Sorry for the noise.
On Thu, 06 Jun 2013, Jani Nikula <jani.nikula@intel.com> wrote:
> 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(-)
>
> --
> 1.7.9.5
>
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 0/3]
2013-06-06 13:59 ` [PATCH 0/3] Jani Nikula
@ 2013-06-13 8:22 ` Daniel Vetter
2013-06-14 16:23 ` Greg Kroah-Hartman
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Vetter @ 2013-06-13 8:22 UTC (permalink / raw)
To: Jani Nikula; +Cc: Greg Kroah-Hartman, intel-gfx, linux-kernel, Andrew Morton
On Thu, Jun 06, 2013 at 04:59:26PM +0300, Jani Nikula wrote:
>
> 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:
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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
>
> On Thu, 06 Jun 2013, Jani Nikula <jani.nikula@intel.com> wrote:
> > 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(-)
> >
> > --
> > 1.7.9.5
> >
>
> --
> Jani Nikula, Intel Open Source Technology Center
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/3]
2013-06-13 8:22 ` Daniel Vetter
@ 2013-06-14 16:23 ` Greg Kroah-Hartman
2013-06-14 20:36 ` [Intel-gfx] " Daniel Vetter
0 siblings, 1 reply; 10+ messages in thread
From: Greg Kroah-Hartman @ 2013-06-14 16:23 UTC (permalink / raw)
To: Jani Nikula, linux-kernel, intel-gfx, Andrew Morton, chris
On Thu, Jun 13, 2013 at 10:22:05AM +0200, Daniel Vetter wrote:
> On Thu, Jun 06, 2013 at 04:59:26PM +0300, Jani Nikula wrote:
> >
> > 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:
>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Intel-gfx] [PATCH 0/3]
2013-06-14 16:23 ` Greg Kroah-Hartman
@ 2013-06-14 20:36 ` Daniel Vetter
0 siblings, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2013-06-14 20:36 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jani Nikula, Linux Kernel Mailing List, intel-gfx, Andrew Morton,
Chris Wilson
On Fri, Jun 14, 2013 at 6:23 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Thu, Jun 13, 2013 at 10:22:05AM +0200, Daniel Vetter wrote:
>> On Thu, Jun 06, 2013 at 04:59:26PM +0300, Jani Nikula wrote:
>> >
>> > 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:
>>
>> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>
>> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/3]
2013-06-06 13:53 [PATCH 0/3] Jani Nikula
` (3 preceding siblings ...)
2013-06-06 13:59 ` [PATCH 0/3] Jani Nikula
@ 2013-06-06 14:33 ` Daniel Vetter
4 siblings, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2013-06-06 14:33 UTC (permalink / raw)
To: Jani Nikula
Cc: linux-kernel, intel-gfx, Andrew Morton, Greg Kroah-Hartman, chris,
daniel
On Thu, Jun 06, 2013 at 04:53:01PM +0300, Jani Nikula wrote:
> 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
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
on the i915 patches for merging through whatever tree the drm stuff goes
through.
-Daniel
>
> 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(-)
>
> --
> 1.7.9.5
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 10+ messages in thread