backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>, backports@vger.kernel.org
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	annndddrr@gmail.com, chris@chris-wilson.co.uk,
	cpanceac@gmail.com, daniel.vetter@ffwll.ch, greg@kroah.com
Subject: Re: [PATCH v2 07/10] backports: revert DMI_EXACT_MATCH() for older kernels
Date: Mon, 22 Jul 2013 13:17:10 +0300	[thread overview]
Message-ID: <8738r62921.fsf@intel.com> (raw)
In-Reply-To: <1374272009-26152-8-git-send-email-mcgrof@do-not-panic.com>


Hi Luis -

On Sat, 20 Jul 2013, "Luis R. Rodriguez" <mcgrof@do-not-panic.com> wrote:
> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
>
> struct dmi_strmatch was modified on v3.11 with a
> exact_match member. The DMI_EXACT_MATCH() macro was
> added as a mod version of DMI_MATCH() to account for
> dmi strings that look closely like each other. An
> example is D510MO Vs D510MOV.
>
> Since exact_match is is not available on older kernels
> we can't use it and must revert to the old DMI_MATCH().
> Addressing the desired behaviour will require a separate
> change to deal with addressing the difference
> in the behaviour.
>
> Chris Wilson recommends that if we can't use this we should
> also rever the DMI related fixes. I believe these are:
>
> dcf6d294830d46b0e6901477fb4bf455281d90c8 - drm/i915: quirk away phantom LVDS on Intel's D525MW mainboard
> e5614f0c2d0f4d7f0b8ef745d34593baf2c5dbf8 - drm/i915: quirk away phantom LVDS on Intel's D510MO mainboard
>
> Once we get confirmation we can do that.

I agree with Chris about dropping the above two instead of carrying this
patch, if you can't backport DMI_EXACT_MATCH implementation. As is, this
would regress the longer named variants of D525MW and D510MO.

If more users for DMI_EXACT_MATCH start showing up, you may need to
figure out a better way if you want to backport the quirks.

BR,
Jani.

>
> Proof of why we can't backport DMI_EXACT_MATCH():
>
> DMI_EXACT_MATCH uses struct dmi_strmatch's new
> member exact_match:
>
> 	@@ -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];
> 	 };
>
> Prior to 5017b285 we only had slot member so to use
> DMI_EXACT_MATCH() with its intent we'd have to do something
> like:
> 	slot |= 1
>
> if its called. This however assumes though that older code has
> the sanity check as changed in 5017b285 on drivers/firmware/dmi_scan.c.
> dmi_scan.o gets linked with CONFIG_DMI. At least for x86 that gets
> objects sprinkled on arch/x86/, but more importantly CONFIG_DMI is
> bool. I've argued how I envision us being able to backport core
> components before (see 0935deab for the hint) but as it is right
> now we can't. We only backport things we can throw in as modular.
>
> mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 5017b285
> v3.11-rc1~99^2~254
>
> commit 5017b2851373ee15c7035151853bb1448800cae2
> Author: Jani Nikula <jani.nikula@intel.com>
> Date:   Wed Jul 3 15:05:02 2013 -0700
>
>     dmi: add support for exact DMI matches in addition to substring matching
>
>     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>
>     Cc: <annndddrr@gmail.com>
>     Cc: Chris Wilson <chris@chris-wilson.co.uk>
>     Cc: Cornel Panceac <cpanceac@gmail.com>
>     Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>     Cc: Greg KH <greg@kroah.com>
>     Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
>
> Cc: jani.nikula@intel.com
> Cc: annndddrr@gmail.com
> Cc: chris@chris-wilson.co.uk
> Cc: cpanceac@gmail.com
> Cc: daniel.vetter@ffwll.ch
> Cc: greg@kroah.com
> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
> ---
>  backport/backport-include/linux/mod_devicetable.h |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/backport/backport-include/linux/mod_devicetable.h b/backport/backport-include/linux/mod_devicetable.h
> index 1f85ce6..5b63637 100644
> --- a/backport/backport-include/linux/mod_devicetable.h
> +++ b/backport/backport-include/linux/mod_devicetable.h
> @@ -2,6 +2,10 @@
>  #define __BACKPORT_MOD_DEVICETABLE_H
>  #include_next <linux/mod_devicetable.h>
>  
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
> +#define DMI_EXACT_MATCH(a, b)  { a, b }
> +#endif
> +
>  #ifndef HID_BUS_ANY
>  #define HID_BUS_ANY                            0xffff
>  #endif
> -- 
> 1.7.10.4
>

-- 
Jani Nikula, Intel Open Source Technology Center

  reply	other threads:[~2013-07-22 10:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 22:13 [PATCH v2 00/10] backporst: take us to next-20130627 Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 01/10] backports: backport drvdata = NULL core driver fixes Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 02/10] backport: backport sprintf-style workqueue naming Luis R. Rodriguez
2013-07-21  6:39   ` Johannes Berg
2013-07-23 23:49     ` Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 03/10] backports: fix patches required for next-20130627 Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 04/10] backports: refresh patches " Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 05/10] backports: simplify swiotlb_nr_tbl() backport Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 06/10] backports: copy the max77693-private.h header file Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 07/10] backports: revert DMI_EXACT_MATCH() for older kernels Luis R. Rodriguez
2013-07-22 10:17   ` Jani Nikula [this message]
2013-07-19 22:13 ` [PATCH v2 08/10] backports: add clock enable/disable on soc_camera_power_[on|off]() Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 09/10] backports: enable REGULATOR_MAX77693 on >= 3.6 Luis R. Rodriguez
2013-07-19 22:13 ` [PATCH v2 10/10] backports: lib/kconfig.py - fix src line regexp Luis R. Rodriguez
2013-07-21  6:37   ` Johannes Berg
2013-07-23 22:51     ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8738r62921.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=annndddrr@gmail.com \
    --cc=backports@vger.kernel.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=cpanceac@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=greg@kroah.com \
    --cc=mcgrof@do-not-panic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).