public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Biereigel <stefan@biereigel.de>
To: Kieran Clancy <clancy.kieran@gmail.com>
Cc: Juan Manuel Cabo <juanmanuel.cabo@gmail.com>,
	Stefan Biereigel <security@biereigel-wb.de>,
	Lan Tianyu <lantianyu1986@gmail.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger kernel org" <linux-kernel@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	San Zamoyski <san@plusnet.pl>, "D. Jansen" <dennis.jansen@web.de>,
	Maurizio D'Addona <mauritiusdadd@gmail.com>
Subject: Re: [REGRESSION 3.14-rc6] Samsung N150 lid does not "open" after suspend to RAM.
Date: Wed, 26 Mar 2014 23:41:38 +0100	[thread overview]
Message-ID: <533357A2.2020402@biereigel.de> (raw)
In-Reply-To: <CAGf84Q+HG-DspQWnza+JQE-bEki0oaJMiHQR5Y-2V97KDShf2Q@mail.gmail.com>


Am 26.03.2014 23:36, schrieb Kieran Clancy:
> On Thu, Mar 27, 2014 at 6:26 AM, Stefan Biereigel <stefan@biereigel.de> wrote:
>> I tested both of your patches. The processing of events works well on my
>> N150, the lid is reported open correctly after resume.
>> For the second patch (the whitelisting-approach), I had to change the
>> Product Name to "N150/N210/N220" instead of "N150P", because that is
>> what dmidecode reports for my netbook.
> That was quick - thanks for testing!
>
> For the product name match then, it matches substrings not whole
> strings, so "N150" should be sufficient (my mistake putting P on the
> end).
Alright, so that was the problem why it did not work with your original 
patch, but I missed that it did substring matching, so "N150" should be 
ok there.
>
>> So, all three approaches work equally well for me (whitelisting my
>> broken N150, blacklisting the broken Series 5/7/9, processing all the
>> stale events). I personally would prefer a solution which needs to
>> handle (best case) no custom cases, because there are always n+1 of
>> them. But, as I don't know if there may be any problems with the
>> approach that needs no special handling (processing all stale events) in
>> the future, I'm not the one to decide the correct solution.
> I won't be able to test ec_clear_process patch until tomorrow because
> I have a full day today.
>
> On my machine, _QXX events are all something like:
>
> if (AC_PLUGGED_IN) {
>      do_something();
> }
>
> So if (for example) AC_PLUGGED_IN has changed since the event was
> produced (e.g. no longer plugged in), nothing bad should happen.
> That's not necessarily a guarantee that this wouldn't introduce new
> bugs on other machines though.
>
> I think the ideal fix would be to distinguish between events which are
> "jammed" and won't be processed (like on Series 5/7/9), and events
> which will be processed normally with GPEs (N150). I am not sure how
> to do this or if it's even possible.
>
> For example, on my machine, the EC status byte (EC_SC) seems to be
> 0x29 for jammed events, which means the SCI_EVT bit is set but we
> never got/get the interrupt. On your N150, your status byte was 0x09
> which means the SCI_EVT was not set - it was not yet asking for the OS
> to attend to this.
>
> I wonder if something as simple as this would work (in acpi_ec_clear):
>
>                  if (!(acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI))
>                          break;
>                  status = acpi_ec_query_unlocked(ec, &value);
>                  if (status || !value)
>                          break;
>
> This would make it only clear events while the SCI_EVT bit is set. I
> am not sure that it would entirely remove the race condition you are
> seeing, but it might be enough to fix it.
>
> If we cant come up with a generally applicable solution, whitelisting
> is the lesser of two evils when compared with blacklisting here. A
> jammed EC won't function _at all_, while losing one or two EC events
> on boot/resume doesn't prevent future events and is easier to work
> around (though still not ideal).
You are right there, of course. Sadly, I can find nobody near me who 
owns one of the newer Samsung machines, therefore I can only contribute 
with testing on my machine. If there is anything else I could try, let 
me know.

Best wishes,
Stefan


  reply	other threads:[~2014-03-26 22:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24  7:50 [REGRESSION 3.14-rc6] Samsung N150 lid does not "open" after suspend to RAM Stefan Biereigel
2014-03-24  9:30 ` Lan Tianyu
2014-03-24 11:19   ` Stefan Biereigel
2014-03-25  9:34     ` Lan Tianyu
2014-03-25  9:43       ` Stefan Biereigel
2014-03-25 13:23       ` Kieran Clancy
2014-03-25 13:53         ` Juan Manuel Cabo
2014-03-25 16:07           ` Stefan Biereigel
2014-03-25 16:38         ` Stefan Biereigel
2014-03-25 20:24         ` Stefan Biereigel
2014-03-25 20:41           ` Juan Manuel Cabo
2014-03-25 22:56             ` Juan Manuel Cabo
2014-03-26 10:42               ` Stefan Biereigel
2014-03-26 14:38                 ` Kieran Clancy
2014-03-26 15:01                   ` Rafael J. Wysocki
2014-03-26 19:56                   ` Stefan Biereigel
2014-03-26 22:36                     ` Kieran Clancy
2014-03-26 22:41                       ` Stefan Biereigel [this message]
     [not found]                   ` <CAM6oVw2v9ptr0c08uPiB_3z3e41VO+Vp3OhoHXiBxagAOfPBZA@mail.gmail.com>
2014-04-01  9:53                     ` Kieran Clancy
2014-04-01 11:36                       ` Nicolas Porcel
2014-04-01 11:58                         ` Kieran Clancy
2014-04-01 12:18                           ` Nicolas Porcel
2014-04-01 18:02                             ` Nicolas Porcel

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=533357A2.2020402@biereigel.de \
    --to=stefan@biereigel.de \
    --cc=clancy.kieran@gmail.com \
    --cc=dennis.jansen@web.de \
    --cc=juanmanuel.cabo@gmail.com \
    --cc=lantianyu1986@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mauritiusdadd@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=san@plusnet.pl \
    --cc=security@biereigel-wb.de \
    /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