mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Mario.Limonciello@dell.com>
To: <dvhart@infradead.org>
Cc: <andy.shevchenko@gmail.com>, <linux-kernel@vger.kernel.org>,
	<platform-driver-x86@vger.kernel.org>, <pali.rohar@gmail.com>
Subject: RE: [PATCH] platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers
Date: Fri, 3 Nov 2017 14:42:55 +0000	[thread overview]
Message-ID: <8a19372f91e34d96ab16e8d4c31b0c86@ausx13mpc124.AMER.DELL.COM> (raw)
In-Reply-To: <20171103005632.GB7971@fury>

> -----Original Message-----
> From: Darren Hart [mailto:dvhart@infradead.org]
> Sent: Thursday, November 2, 2017 7:57 PM
> To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>; LKML <linux-
> kernel@vger.kernel.org>; platform-driver-x86@vger.kernel.org;
> pali.rohar@gmail.com
> Subject: Re: [PATCH] platform/x86: dell-*wmi*: Relay failed initial probe to
> dependent drivers
> 
> On Wed, Nov 01, 2017 at 02:28:21PM -0500, Mario Limonciello wrote:
> > dell-wmi and dell-smbios-wmi are dependent upon dell-wmi-descriptor
> > finishing probe successfully to probe themselves.
> >
> > Currently if dell-wmi-descriptor fails probing in a non-recoverable way
> > (such as invalid header) dell-wmi and dell-smbios-wmi will continue to
> > try to redo probing due to deferred probing.
> >
> > To solve this have the dependent drivers query the dell-wmi-descriptor
> > driver whether the descriptor has been determined valid. The possible
> > results are:
> > -EPROBE_DEFER: Descriptor not yet probed, dependent driver should wait
> >  and use deferred probing
> > < 0: Descriptor probed, invalid.  Dependent driver should return an
> >  error.
> > 0: Successful descriptor probe, dependent driver can continue
> >
> > Successful descriptor probe still doesn't mean that the descriptor driver
> > is necessarily bound at the time of initialization of dependent driver.
> > Userspace can unbind the driver, so all methods used from driver
> > should still be verified to return success values otherwise deferred
> > probing be used.
> >
> > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> 
> > diff --git a/drivers/platform/x86/dell-wmi-descriptor.c
> b/drivers/platform/x86/dell-wmi-descriptor.c
> > index 3204c408e261..33c6c7d66f8c 100644
> > --- a/drivers/platform/x86/dell-wmi-descriptor.c
> > +++ b/drivers/platform/x86/dell-wmi-descriptor.c
> > @@ -26,9 +26,16 @@ struct descriptor_priv {
> >  	u32 interface_version;
> >  	u32 size;
> >  };
> > +static int descriptor_valid;
> 
> This initializes to 0, which I believe creates an odd race window between when
> this init is called and when the first driver calls
> dell_wmi_get_descriptor_valid(). Seems like initializing to -EPROBE_DEFER here
> in the declaration would be a better right approach.
> 
> --

Thanks, good catch.  I'll adjust.

      reply	other threads:[~2017-11-03 14:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 19:28 Mario Limonciello
2017-11-03  0:56 ` Darren Hart
2017-11-03 14:42   ` Mario.Limonciello [this message]

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=8a19372f91e34d96ab16e8d4c31b0c86@ausx13mpc124.AMER.DELL.COM \
    --to=mario.limonciello@dell.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®