linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging
@ 2018-09-26 16:10 Mario Limonciello
  2018-09-26 17:02 ` Andy Shevchenko
  2018-09-26 18:34 ` Mika Westerberg
  0 siblings, 2 replies; 6+ messages in thread
From: Mario Limonciello @ 2018-09-26 16:10 UTC (permalink / raw)
  To: dvhart, Andy Shevchenko
  Cc: LKML, platform-driver-x86, Mika Westerberg, Mario Limonciello

Some users have been reporting issues with thunderbolt being turned off
before fully initialized.  This is suspected to be caused by userspace
turning off the Thunderbolt controller using intel-wmi-thunderbolt
prematurely.

Details are available here:
https://bugzilla.kernel.org/show_bug.cgi?id=201227
https://bugzilla.kernel.org/show_bug.cgi?id=199631

Userspace has already made some mitigiations for this situation:
https://github.com/hughsie/fwupd/commit/ef6f1d76983c9b66
https://github.com/hughsie/fwupd/commit/c07ce5b4889a5384

To allow easier debugging of this situation add output that can be turned
on with dynamic debugging to better root cause this problem.

Suggested-by: Mika Westerberg <mika.westerberg@intel.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/platform/x86/intel-wmi-thunderbolt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c b/drivers/platform/x86/intel-wmi-thunderbolt.c
index c2257bd..ce5fbf0 100644
--- a/drivers/platform/x86/intel-wmi-thunderbolt.c
+++ b/drivers/platform/x86/intel-wmi-thunderbolt.c
@@ -38,12 +38,16 @@ static ssize_t force_power_store(struct device *dev,
 	input.length = sizeof(u8);
 	input.pointer = &mode;
 	mode = hex_to_bin(buf[0]);
+	dev_dbg(dev, "force_power: storing %#x\n", mode);
 	if (mode == 0 || mode == 1) {
 		status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
 					     &input, NULL);
-		if (ACPI_FAILURE(status))
+		if (ACPI_FAILURE(status)) {
+			dev_dbg(dev, "force_power: failed to evaluate ACPI method\n");
 			return -ENODEV;
+		}
 	} else {
+		dev_dbg(dev, "force_power: unsupported mode\n");
 		return -EINVAL;
 	}
 	return count;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging
  2018-09-26 16:10 [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging Mario Limonciello
@ 2018-09-26 17:02 ` Andy Shevchenko
  2018-09-26 17:03   ` Mario.Limonciello
  2018-09-26 18:34 ` Mika Westerberg
  1 sibling, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2018-09-26 17:02 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Darren Hart, Linux Kernel Mailing List, Platform Driver, Mika Westerberg

On Wed, Sep 26, 2018 at 7:11 PM Mario Limonciello
<mario.limonciello@dell.com> wrote:
>
> Some users have been reporting issues with thunderbolt being turned off
> before fully initialized.  This is suspected to be caused by userspace
> turning off the Thunderbolt controller using intel-wmi-thunderbolt
> prematurely.
>

> Details are available here:
> https://bugzilla.kernel.org/show_bug.cgi?id=201227
> https://bugzilla.kernel.org/show_bug.cgi?id=199631

BugLink: ... ?
BugLink: ... ?

I can do it myself if you are okay with this format.

The patch itself LGTM.

>
> Userspace has already made some mitigiations for this situation:
> https://github.com/hughsie/fwupd/commit/ef6f1d76983c9b66
> https://github.com/hughsie/fwupd/commit/c07ce5b4889a5384
>
> To allow easier debugging of this situation add output that can be turned
> on with dynamic debugging to better root cause this problem.
>
> Suggested-by: Mika Westerberg <mika.westerberg@intel.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> ---
>  drivers/platform/x86/intel-wmi-thunderbolt.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c b/drivers/platform/x86/intel-wmi-thunderbolt.c
> index c2257bd..ce5fbf0 100644
> --- a/drivers/platform/x86/intel-wmi-thunderbolt.c
> +++ b/drivers/platform/x86/intel-wmi-thunderbolt.c
> @@ -38,12 +38,16 @@ static ssize_t force_power_store(struct device *dev,
>         input.length = sizeof(u8);
>         input.pointer = &mode;
>         mode = hex_to_bin(buf[0]);
> +       dev_dbg(dev, "force_power: storing %#x\n", mode);
>         if (mode == 0 || mode == 1) {
>                 status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
>                                              &input, NULL);
> -               if (ACPI_FAILURE(status))
> +               if (ACPI_FAILURE(status)) {
> +                       dev_dbg(dev, "force_power: failed to evaluate ACPI method\n");
>                         return -ENODEV;
> +               }
>         } else {
> +               dev_dbg(dev, "force_power: unsupported mode\n");
>                 return -EINVAL;
>         }
>         return count;
> --
> 2.7.4
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging
  2018-09-26 17:02 ` Andy Shevchenko
@ 2018-09-26 17:03   ` Mario.Limonciello
  2018-09-26 17:10     ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Mario.Limonciello @ 2018-09-26 17:03 UTC (permalink / raw)
  To: andy.shevchenko
  Cc: dvhart, linux-kernel, platform-driver-x86, mika.westerberg

> 
> On Wed, Sep 26, 2018 at 7:11 PM Mario Limonciello
> <mario.limonciello@dell.com> wrote:
> >
> > Some users have been reporting issues with thunderbolt being turned off
> > before fully initialized.  This is suspected to be caused by userspace
> > turning off the Thunderbolt controller using intel-wmi-thunderbolt
> > prematurely.
> >
> 
> > Details are available here:
> > https://bugzilla.kernel.org/show_bug.cgi?id=201227
> > https://bugzilla.kernel.org/show_bug.cgi?id=199631
> 
> BugLink: ... ?
> BugLink: ... ?
> 
> I can do it myself if you are okay with this format.
> 
> The patch itself LGTM.

Sure, thank you.

> 
> >
> > Userspace has already made some mitigiations for this situation:
> > https://github.com/hughsie/fwupd/commit/ef6f1d76983c9b66
> > https://github.com/hughsie/fwupd/commit/c07ce5b4889a5384
> >
> > To allow easier debugging of this situation add output that can be turned
> > on with dynamic debugging to better root cause this problem.
> >
> > Suggested-by: Mika Westerberg <mika.westerberg@intel.com>
> > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> > ---
> >  drivers/platform/x86/intel-wmi-thunderbolt.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c
> b/drivers/platform/x86/intel-wmi-thunderbolt.c
> > index c2257bd..ce5fbf0 100644
> > --- a/drivers/platform/x86/intel-wmi-thunderbolt.c
> > +++ b/drivers/platform/x86/intel-wmi-thunderbolt.c
> > @@ -38,12 +38,16 @@ static ssize_t force_power_store(struct device *dev,
> >         input.length = sizeof(u8);
> >         input.pointer = &mode;
> >         mode = hex_to_bin(buf[0]);
> > +       dev_dbg(dev, "force_power: storing %#x\n", mode);
> >         if (mode == 0 || mode == 1) {
> >                 status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
> >                                              &input, NULL);
> > -               if (ACPI_FAILURE(status))
> > +               if (ACPI_FAILURE(status)) {
> > +                       dev_dbg(dev, "force_power: failed to evaluate ACPI method\n");
> >                         return -ENODEV;
> > +               }
> >         } else {
> > +               dev_dbg(dev, "force_power: unsupported mode\n");
> >                 return -EINVAL;
> >         }
> >         return count;
> > --
> > 2.7.4
> >
> 
> 
> --
> With Best Regards,
> Andy Shevchenko

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging
  2018-09-26 17:03   ` Mario.Limonciello
@ 2018-09-26 17:10     ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2018-09-26 17:10 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Darren Hart, Linux Kernel Mailing List, Platform Driver, Mika Westerberg

On Wed, Sep 26, 2018 at 8:03 PM <Mario.Limonciello@dell.com> wrote:
>
> >
> > On Wed, Sep 26, 2018 at 7:11 PM Mario Limonciello
> > <mario.limonciello@dell.com> wrote:
> > >
> > > Some users have been reporting issues with thunderbolt being turned off
> > > before fully initialized.  This is suspected to be caused by userspace
> > > turning off the Thunderbolt controller using intel-wmi-thunderbolt
> > > prematurely.
> > >
> >
> > > Details are available here:
> > > https://bugzilla.kernel.org/show_bug.cgi?id=201227
> > > https://bugzilla.kernel.org/show_bug.cgi?id=199631
> >
> > BugLink: ... ?
> > BugLink: ... ?
> >
> > I can do it myself if you are okay with this format.
> >
> > The patch itself LGTM.
>
> Sure, thank you.

Pushed to my review and testing queue with mentioned changes, thanks!

>
> >
> > >
> > > Userspace has already made some mitigiations for this situation:
> > > https://github.com/hughsie/fwupd/commit/ef6f1d76983c9b66
> > > https://github.com/hughsie/fwupd/commit/c07ce5b4889a5384
> > >
> > > To allow easier debugging of this situation add output that can be turned
> > > on with dynamic debugging to better root cause this problem.
> > >
> > > Suggested-by: Mika Westerberg <mika.westerberg@intel.com>
> > > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> > > ---
> > >  drivers/platform/x86/intel-wmi-thunderbolt.c | 6 +++++-
> > >  1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c
> > b/drivers/platform/x86/intel-wmi-thunderbolt.c
> > > index c2257bd..ce5fbf0 100644
> > > --- a/drivers/platform/x86/intel-wmi-thunderbolt.c
> > > +++ b/drivers/platform/x86/intel-wmi-thunderbolt.c
> > > @@ -38,12 +38,16 @@ static ssize_t force_power_store(struct device *dev,
> > >         input.length = sizeof(u8);
> > >         input.pointer = &mode;
> > >         mode = hex_to_bin(buf[0]);
> > > +       dev_dbg(dev, "force_power: storing %#x\n", mode);
> > >         if (mode == 0 || mode == 1) {
> > >                 status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
> > >                                              &input, NULL);
> > > -               if (ACPI_FAILURE(status))
> > > +               if (ACPI_FAILURE(status)) {
> > > +                       dev_dbg(dev, "force_power: failed to evaluate ACPI method\n");
> > >                         return -ENODEV;
> > > +               }
> > >         } else {
> > > +               dev_dbg(dev, "force_power: unsupported mode\n");
> > >                 return -EINVAL;
> > >         }
> > >         return count;
> > > --
> > > 2.7.4
> > >
> >
> >
> > --
> > With Best Regards,
> > Andy Shevchenko



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging
  2018-09-26 16:10 [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging Mario Limonciello
  2018-09-26 17:02 ` Andy Shevchenko
@ 2018-09-26 18:34 ` Mika Westerberg
  2018-09-26 19:25   ` Andy Shevchenko
  1 sibling, 1 reply; 6+ messages in thread
From: Mika Westerberg @ 2018-09-26 18:34 UTC (permalink / raw)
  To: Mario Limonciello; +Cc: dvhart, Andy Shevchenko, LKML, platform-driver-x86

On Wed, Sep 26, 2018 at 11:10:58AM -0500, Mario Limonciello wrote:
> Some users have been reporting issues with thunderbolt being turned off
> before fully initialized.  This is suspected to be caused by userspace
> turning off the Thunderbolt controller using intel-wmi-thunderbolt
> prematurely.
> 
> Details are available here:
> https://bugzilla.kernel.org/show_bug.cgi?id=201227
> https://bugzilla.kernel.org/show_bug.cgi?id=199631
> 
> Userspace has already made some mitigiations for this situation:
                                  ^^^^^^^^^^^^
mitigations?

> https://github.com/hughsie/fwupd/commit/ef6f1d76983c9b66
> https://github.com/hughsie/fwupd/commit/c07ce5b4889a5384
> 
> To allow easier debugging of this situation add output that can be turned
> on with dynamic debugging to better root cause this problem.
> 
> Suggested-by: Mika Westerberg <mika.westerberg@intel.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging
  2018-09-26 18:34 ` Mika Westerberg
@ 2018-09-26 19:25   ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2018-09-26 19:25 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Mario Limonciello, Darren Hart, Linux Kernel Mailing List,
	Platform Driver

On Wed, Sep 26, 2018 at 9:34 PM Mika Westerberg
<mika.westerberg@intel.com> wrote:
>
> On Wed, Sep 26, 2018 at 11:10:58AM -0500, Mario Limonciello wrote:
> > Some users have been reporting issues with thunderbolt being turned off
> > before fully initialized.  This is suspected to be caused by userspace
> > turning off the Thunderbolt controller using intel-wmi-thunderbolt
> > prematurely.
> >
> > Details are available here:
> > https://bugzilla.kernel.org/show_bug.cgi?id=201227
> > https://bugzilla.kernel.org/show_bug.cgi?id=199631
> >
> > Userspace has already made some mitigiations for this situation:
>                                   ^^^^^^^^^^^^
> mitigations?

I've fixed that, but in any case I need to add your tag, thanks!


>
> > https://github.com/hughsie/fwupd/commit/ef6f1d76983c9b66
> > https://github.com/hughsie/fwupd/commit/c07ce5b4889a5384
> >
> > To allow easier debugging of this situation add output that can be turned
> > on with dynamic debugging to better root cause this problem.
> >
> > Suggested-by: Mika Westerberg <mika.westerberg@intel.com>
> > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
>
> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-26 19:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 16:10 [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging Mario Limonciello
2018-09-26 17:02 ` Andy Shevchenko
2018-09-26 17:03   ` Mario.Limonciello
2018-09-26 17:10     ` Andy Shevchenko
2018-09-26 18:34 ` Mika Westerberg
2018-09-26 19:25   ` Andy Shevchenko

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).