public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Frans Klaver <fransklaver@gmail.com>
Cc: Corentin Chary <corentin.chary@gmail.com>,
	acpi4asus-user <acpi4asus-user@lists.sourceforge.net>,
	platform-driver-x86 <platform-driver-x86@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 8/8] eeepc-laptop: don't assume get_acpi succeeds
Date: Wed, 29 Oct 2014 17:54:32 -0700	[thread overview]
Message-ID: <20141030005432.GA14609@vmdeb7> (raw)
In-Reply-To: <CAH6sp9PUSbSj0jWNNv6q=rwqUnpkCoiUBxCUAHSVjP+qrUEa9g@mail.gmail.com>

On Tue, Oct 28, 2014 at 09:09:03AM +0100, Frans Klaver wrote:
> On Tue, Oct 28, 2014 at 6:34 AM, Darren Hart <dvhart@infradead.org> wrote:
> > On Wed, Oct 22, 2014 at 09:12:43PM +0200, Frans Klaver wrote:
> >> In eeepc_hotk_thaw, we assume that get_acpi() will effectively return a
> >> bool. However, it is possible that get_acpi() returns an error instead.
> >> We should not be writing error values to the ACPI device, even though
> >> it's quite possible that we couldn't contact the ACPI device in the
> >> first place.
> >>
> >> Signed-off-by: Frans Klaver <fransklaver@gmail.com>
> >> ---
> >>  drivers/platform/x86/eeepc-laptop.c | 5 +++--
> >>  1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
> >> index 275a239..14f79ef 100644
> >> --- a/drivers/platform/x86/eeepc-laptop.c
> >> +++ b/drivers/platform/x86/eeepc-laptop.c
> >> @@ -911,7 +911,7 @@ static int eeepc_hotk_thaw(struct device *device)
> >>       struct eeepc_laptop *eeepc = dev_get_drvdata(device);
> >>
> >>       if (eeepc->wlan_rfkill) {
> >> -             bool wlan;
> >> +             int wlan;
> >>
> >>               /*
> >>                * Work around bios bug - acpi _PTS turns off the wireless led
> >> @@ -919,7 +919,8 @@ static int eeepc_hotk_thaw(struct device *device)
> >>                * we should kick it ourselves in case hibernation is aborted.
> >>                */
> >>               wlan = get_acpi(eeepc, CM_ASL_WLAN);
> >> -             set_acpi(eeepc, CM_ASL_WLAN, wlan);
> >> +             if (wlan >= 0)
> >> +                     set_acpi(eeepc, CM_ASL_WLAN, wlan);
> >
> > And if not? Seems like we should be passing the error code along.
> 
> Wouldn't that mean that you cannot thaw the system if the wlan acpi call fails?

Good question. I traced it back to the platform driver core, and it just
propogates the error, so I'm not sure either.

> 
> I'd rather have my system up and running without wlan, than I'd have
> my system down because we couldn't start wlan. This is of course
> assuming that returning an error from eeepc_hotk_thaw means the
> thawing stops.

I agree, and this is what it does now, and acer-wmi thaw has similar behavior.

I consider this an incremental improvement, so queued.

-- 
Darren Hart
Intel Open Source Technology Center

  reply	other threads:[~2014-10-30  0:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 19:12 [PATCH 0/8] More eeepc-laptop cleanup Frans Klaver
2014-10-22 19:12 ` [PATCH 1/8] eeepc-laptop: flatten control flow Frans Klaver
2014-10-28  4:56   ` Darren Hart
2014-10-22 19:12 ` [PATCH 2/8] eeepc-laptop: don't break user visible strings Frans Klaver
2014-10-22 19:12 ` [PATCH 3/8] eeepc-laptop: define rfkill notifier nodes only once Frans Klaver
2014-10-28  5:12   ` Darren Hart
2014-10-28  8:28     ` Frans Klaver
2014-10-22 19:12 ` [PATCH 4/8] eeepc-laptop: pull out eeepc_destroy_rfkill Frans Klaver
2014-10-28  5:19   ` Darren Hart
2014-10-28  8:16     ` Frans Klaver
2014-10-22 19:12 ` [PATCH 5/8] eeepc-laptop: clean up control flow in eeepc_acpi_notify Frans Klaver
2014-10-28  5:25   ` Darren Hart
2014-11-02 21:14     ` [PATCH v2] " Frans Klaver
2014-11-04  6:01       ` Darren Hart
2014-10-22 19:12 ` [PATCH 6/8] eeepc-laptop: replace magic numbers with defines Frans Klaver
2014-10-22 19:12 ` [PATCH 7/8] eeepc-laptop: document fan_pwm conversions Frans Klaver
2014-10-28  5:31   ` Darren Hart
2014-10-28  8:21     ` Frans Klaver
2014-10-22 19:12 ` [PATCH 8/8] eeepc-laptop: don't assume get_acpi succeeds Frans Klaver
2014-10-28  5:34   ` Darren Hart
2014-10-28  8:09     ` Frans Klaver
2014-10-30  0:54       ` Darren Hart [this message]
2014-10-28  5:35 ` [PATCH 0/8] More eeepc-laptop cleanup Darren Hart

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=20141030005432.GA14609@vmdeb7 \
    --to=dvhart@infradead.org \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=corentin.chary@gmail.com \
    --cc=fransklaver@gmail.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox