All of lore.kernel.org
 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 2/2] platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers
Date: Sat, 4 Nov 2017 03:25:04 +0000	[thread overview]
Message-ID: <41ef814bda1d41ab87880ab569aa48b3@ausx13mpc120.AMER.DELL.COM> (raw)
In-Reply-To: <20171104005327.GC24317@fury>

> -----Original Message-----
> From: Darren Hart [mailto:dvhart@infradead.org]
> Sent: Friday, November 3, 2017 7:53 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 2/2] platform/x86: dell-*wmi*: Relay failed initial probe to
> dependent drivers
> 
> On Fri, Nov 03, 2017 at 11:27:22AM -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
> 
> Userspace shouldn't be able to remove the dell-wmi-descriptor driver if a
> dependent driver is loaded. It isn't clear to me in which scenario we encounter
> this problem ??

Userspace can however unbind a bound GUID.  When this happens getting
the interface version and size will both fail.

> 
> 
> > should still be verified to return success values otherwise deferred
> > probing be used.
> 
> The part after "otherwise" is breaking my English parser...
> 
> Should this read: "Userspace can unbind the driver, so all methods used from the
> driver should still be verified to return successful values, falling back to
> deferred probing in case of failure." ??

Yeah that's clearer and correct.

> 
> > diff --git a/drivers/platform/x86/dell-wmi-descriptor.h
> b/drivers/platform/x86/dell-wmi-descriptor.h
> > index 5f7b69c2c83a..776cddd5e135 100644
> > --- a/drivers/platform/x86/dell-wmi-descriptor.h
> > +++ b/drivers/platform/x86/dell-wmi-descriptor.h
> > @@ -15,6 +15,13 @@
> >
> >  #define DELL_WMI_DESCRIPTOR_GUID "8D9DDCBC-A997-11DA-B012-
> B622A1EF5492"
> >
> > +/* possible return values:
> 
> This should trigger a checkpatch error, but doesn't. Huh. For everything but
> "net", comment blocks should start with /* and not following text.
> 

OK.

> /*
>  * First line.
>  * Second line.
>  */
> 
> A nit, and I can clean up if no changes are deemed necessary here.
> 
> > + *  -EPROBE_DEFER: probing for dell-wmi-descriptor not yet run
> > + *  0: valid descriptor, successfully probed
> > + *  < 0: invalid descriptor, don't probe dependent devices
> > + */
> 
> --
> Darren Hart
> VMware Open Source Technology Center

WARNING: multiple messages have this Message-ID (diff)
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 2/2] platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers
Date: Sat, 4 Nov 2017 03:25:04 +0000	[thread overview]
Message-ID: <41ef814bda1d41ab87880ab569aa48b3@ausx13mpc120.AMER.DELL.COM> (raw)
In-Reply-To: <20171104005327.GC24317@fury>

> -----Original Message-----
> From: Darren Hart [mailto:dvhart@infradead.org]
> Sent: Friday, November 3, 2017 7:53 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 2/2] platform/x86: dell-*wmi*: Relay failed initial probe to
> dependent drivers
> 
> On Fri, Nov 03, 2017 at 11:27:22AM -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
> 
> Userspace shouldn't be able to remove the dell-wmi-descriptor driver if a
> dependent driver is loaded. It isn't clear to me in which scenario we encounter
> this problem ??

Userspace can however unbind a bound GUID.  When this happens getting
the interface version and size will both fail.

> 
> 
> > should still be verified to return success values otherwise deferred
> > probing be used.
> 
> The part after "otherwise" is breaking my English parser...
> 
> Should this read: "Userspace can unbind the driver, so all methods used from the
> driver should still be verified to return successful values, falling back to
> deferred probing in case of failure." ??

Yeah that's clearer and correct.

> 
> > diff --git a/drivers/platform/x86/dell-wmi-descriptor.h
> b/drivers/platform/x86/dell-wmi-descriptor.h
> > index 5f7b69c2c83a..776cddd5e135 100644
> > --- a/drivers/platform/x86/dell-wmi-descriptor.h
> > +++ b/drivers/platform/x86/dell-wmi-descriptor.h
> > @@ -15,6 +15,13 @@
> >
> >  #define DELL_WMI_DESCRIPTOR_GUID "8D9DDCBC-A997-11DA-B012-
> B622A1EF5492"
> >
> > +/* possible return values:
> 
> This should trigger a checkpatch error, but doesn't. Huh. For everything but
> "net", comment blocks should start with /* and not following text.
> 

OK.

> /*
>  * First line.
>  * Second line.
>  */
> 
> A nit, and I can clean up if no changes are deemed necessary here.
> 
> > + *  -EPROBE_DEFER: probing for dell-wmi-descriptor not yet run
> > + *  0: valid descriptor, successfully probed
> > + *  < 0: invalid descriptor, don't probe dependent devices
> > + */
> 
> --
> Darren Hart
> VMware Open Source Technology Center

  reply	other threads:[~2017-11-04  3:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 16:27 [PATCH 0/2] Account for uncorrectable failures in probing Mario Limonciello
2017-11-03 16:27 ` [PATCH 1/2] platform/x86: dell-wmi-descriptor: check if memory was allocated Mario Limonciello
2017-11-09 12:07   ` Pali Rohár
2017-11-03 16:27 ` [PATCH 2/2] platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers Mario Limonciello
2017-11-04  0:53   ` Darren Hart
2017-11-04  3:25     ` Mario.Limonciello [this message]
2017-11-04  3:25       ` Mario.Limonciello
2017-11-09 16:02   ` Pali Rohár
2017-11-09 16:13     ` Mario.Limonciello
2017-11-09 16:13       ` Mario.Limonciello
2017-11-09 17:28       ` Pali Rohár
2017-11-09 17:34         ` Mario.Limonciello
2017-11-09 17:34           ` Mario.Limonciello
2017-11-09 17:52           ` Darren Hart
2017-11-07 16:17 ` [PATCH 0/2] Account for uncorrectable failures in probing Mario.Limonciello
2017-11-07 16:17   ` Mario.Limonciello

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=41ef814bda1d41ab87880ab569aa48b3@ausx13mpc120.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 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.