All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Matthew Garrett" <mjg59@srcf.ucam.org>,
	"Darren Hart" <dvhart@infradead.org>,
	"Gabriele Mazzotta" <gabriele.mzt@gmail.com>,
	"Michał Kępień" <kernel@kempniu.pl>,
	"Andy Lutomirski" <luto@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] dell-wmi: Check if Dell WMI descriptor structure is valid
Date: Fri, 25 Dec 2015 14:02:41 +0100	[thread overview]
Message-ID: <201512251402.42066@pali> (raw)
In-Reply-To: <CALCETrW0HmHiXmM23Y0XV1FBKaw9dcEwdrRWzwSJJhj89RkQYQ@mail.gmail.com>

[-- Attachment #1: Type: Text/Plain, Size: 2003 bytes --]

On Friday 25 December 2015 02:23:04 Andy Lutomirski wrote:
> On Thu, Dec 24, 2015 at 1:18 PM, Pali Rohár <pali.rohar@gmail.com>
> wrote:
> > According to Dell WMI document mentioned in ML dicussion archived
> > at http://www.spinics.net/lists/platform-driver-x86/msg07220.html
> > OS should check Dell WMI descriptor structure. Structure also
> > provide Dell WMI interface version which is used later.
> 
> I will rebase my big series on top of this.  It'll give me a good
> excuse to test that I got the probe ordering right.  (The code is
> explicitly intended to support use cases like this, and now I'll have
> a real-world test for it.)  I'll also test this in a bit.

Ok!

> > +MODULE_ALIAS("wmi:"DELL_DESCRIPTOR_GUID);
> 
> I don't think this is necessary.  The driver will only work if both
> wmi devices and, hence, modaliases are present, so there's no need to
> cause just one or the other to trigger dell-wmi autoloading.

Maybe now when you are working on big WMI patch series is time to change 
modalias support in WMI to support AND-conjunction (&&) on WMI aliases, 
not just OR (one alias match).

Something like: load dell-wmi.ko driver if system provides both WMI 
GUIDs.

> > +/**
> 
> > + * Descriptor buffer is 128 byte long and contains:
> This isn't kerneldoc format, so I think this should just be "/*".
> 

Ok, I will fix this in next version.

> > +       if (obj->buffer.length != 128) {
> > +               pr_err("Dell descriptor buffer has invalid length
> > (%d)\n", +                       obj->buffer.length);
> > +               kfree(obj);
> > +               return -EINVAL;
> > +       }
> 
> I would advocate for being more permissive: a buffer that is actually
> too short for the fields we need would result in -EINVAL, but a
> buffer that isn't 128 bytes would just be a warning and not cause
> module load to fail.
> 
> --Andy

Sounds good, I will change this part.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2015-12-25 13:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-24 21:18 [PATCH 0/2] Fixes for dell-wmi Pali Rohár
2015-12-24 21:18 ` [PATCH 1/2] dell-wmi: Check if Dell WMI descriptor structure is valid Pali Rohár
2015-12-25  1:23   ` Andy Lutomirski
2015-12-25 13:02     ` Pali Rohár [this message]
2015-12-28 13:37   ` Michał Kępień
2015-12-28 14:08     ` Pali Rohár
2015-12-29 12:44       ` Michał Kępień
2015-12-29 16:05         ` Pali Rohár
2015-12-30 11:27           ` Michał Kępień
2016-01-04 18:23             ` Andy Lutomirski
2015-12-24 21:18 ` [PATCH 2/2] dell-wmi: Process only one event on devices with interface version 0 Pali Rohár
2015-12-28 13:40   ` Michał Kępień
2015-12-28 13:49     ` Pali Rohár
2015-12-27 12:59 ` [PATCH 0/2] Fixes for dell-wmi Gabriele Mazzotta
2015-12-27 13:07   ` Pali Rohár
2015-12-27 13:10     ` Gabriele Mazzotta
2015-12-27 13:17       ` Pali Rohár
2015-12-28 13:33 ` Michał Kępień
2015-12-28 13:46   ` Pali Rohár
2015-12-29 12:18     ` Michał Kępień
2016-01-04 20:48 ` Darren Hart
2016-01-07 22:31   ` Pali Rohár
2016-01-04 21:26 ` [PATCH v2 " Pali Rohár
2016-01-04 21:26   ` [PATCH v2 1/2] dell-wmi: Check if Dell WMI descriptor structure is valid Pali Rohár
2016-01-04 21:26   ` [PATCH v2 2/2] dell-wmi: Process only one event on devices with interface version 0 Pali Rohár
2016-01-12 11:14     ` Michał Kępień
2016-01-12 17:49       ` Pali Rohár
2016-01-12 20:12         ` Michał Kępień
2016-01-14 23:06           ` Darren Hart
2016-01-11 19:22   ` [PATCH v2 0/2] Fixes for dell-wmi Darren Hart
2016-01-12  0:30     ` Gabriele Mazzotta

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=201512251402.42066@pali \
    --to=pali.rohar@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=gabriele.mzt@gmail.com \
    --cc=kernel@kempniu.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.