mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li Guang <lig.fnst@cn.fujitsu.com>
To: Kieran Clancy <clancy.kieran@gmail.com>
Cc: Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lan Tianyu <tianyu.lan@intel.com>,
	Juan Manuel Cabo <juanmanuel.cabo@gmail.com>,
	Dennis Jansen <dennis.jansen@web.de>
Subject: Re: [PATCH] ACPI / EC: Clear stale EC events on Samsung systems
Date: Thu, 27 Feb 2014 12:47:28 +0800	[thread overview]
Message-ID: <530EC360.6010209@cn.fujitsu.com> (raw)
In-Reply-To: <CAGf84Q+Xd9EUjOEMe3+EMRhdPaFgnAjNDOoPZmf=gn8mi=FhWw@mail.gmail.com>

Kieran Clancy wrote:
> On Thu, Feb 27, 2014 at 12:29 PM, Li Guang<lig.fnst@cn.fujitsu.com>  wrote:
>    
>>> +#define ACPI_EC_CLEAR_MAX      20      /* Maximum number of events to
>>> query
>>> +                                        * when trying to clear the EC */
>>>
>>>        
>>
>> 20 is enough?
>> the query index is length of a byte.
>>      
> On my machine, 8 seems to be enough, so 20 seems to be a conservative
> maximum. Just reading your other email, maybe we should set this to
> 32? or 40? 100?
>
> If it's not enough, hopefully anyone seeing bugs will notice the
> warning "maximum of X stale EC events cleared".
>
> Here's what happens if I plug/replug the AC lots of times (more than
> 8) during suspend:
>
> [ 8807.019800] ACPI : EC: --->  status = 0x29
> [ 8807.019804] ACPI : EC: --->  data = 0x66
> [ 8807.020790] ACPI : EC: --->  status = 0x29
> [ 8807.020793] ACPI : EC: --->  data = 0x66
> [ 8807.021793] ACPI : EC: --->  status = 0x29
> [ 8807.021798] ACPI : EC: --->  data = 0x66
> [ 8807.022831] ACPI : EC: --->  status = 0x29
> [ 8807.022834] ACPI : EC: --->  data = 0x66
> [ 8807.023788] ACPI : EC: --->  status = 0x29
> [ 8807.023792] ACPI : EC: --->  data = 0x66
> [ 8807.024787] ACPI : EC: --->  status = 0x29
> [ 8807.024791] ACPI : EC: --->  data = 0x66
> [ 8807.025787] ACPI : EC: --->  status = 0x29
> [ 8807.025790] ACPI : EC: --->  data = 0x66
> [ 8807.026787] ACPI : EC: --->  status = 0x29
> [ 8807.026790] ACPI : EC: --->  data = 0x66
> [ 8807.027786] ACPI : EC: --->  status = 0x09
> [ 8807.027790] ACPI : EC: --->  data = 0x00
> [ 8807.027792] ACPI : EC: 8 stale EC events cleared
>
> Note that most of these have SCI_EVT set, but the OS is not notified
> according to ACPI specs (seemingly because these events happened
> during sleep).
>
> The _Q66 method in my DSDT, is:
>
>                          P8XH (Zero, 0x66)
>                          If (LEqual (B1EX, One))
>                          {
>                              Notify (BAT1, 0x80)
>                          }
>
> So, basically, this is supposed to notify that the battery (BAT1 =
> PNP0C0A) has changed state, but they are stale events so we don't run
> the handlers.
>
>    
>>> +static int EC_FLAGS_CLEAR_ON_RESUME; /* EC should be polled on
>>> boot/resume */
>>>        
>> seems name is implicit, what about EC_FLAGS_QEVENT_CLR_ON_RESUME?
>> seems too long :-)
>>      
> In my mind this is referring to the function name (acpi_ec_)clear.
> Perhaps we could just make the connection more explicit in the
> comment:
>
> /* needs acpi_ec_clear() on boot/resume */
>
> Not sure if this is better?
>
>    
>>> +       /* Some hardware may need the EC to be cleared before use */
>>>        
>> description is implicit, should specify what we clear is Q event, not EC.
>>      
> Are Q events the only thing we can get from the EC data port? I've
> read the relevant parts of the ACPI spec and I can't say I am 100%
> sure.
>
>    
I guess you want to clear Q events here,
EC usually has ACPI space to be read by cmd 80.

Thanks!




  reply	other threads:[~2014-02-27  4:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 15:42 Kieran Clancy
2014-02-26 23:45 ` Rafael J. Wysocki
2014-02-27  0:45   ` Kieran Clancy
2014-02-27  0:59     ` Kieran Clancy
2014-02-27  1:16       ` Rafael J. Wysocki
2014-02-27  1:09         ` Kieran Clancy
2014-02-27 22:02           ` Rafael J. Wysocki
2014-02-27  1:15     ` Rafael J. Wysocki
2014-02-27  1:59 ` Li Guang
2014-02-27  2:33   ` Juan Manuel Cabo
2014-02-27  3:14     ` Li Guang
2014-02-27  3:31       ` Juan Manuel Cabo
2014-02-27  3:45         ` Li Guang
2014-02-27  3:49   ` Kieran Clancy
2014-02-27  4:47     ` Li Guang [this message]
2014-02-27 13:41     ` Hello Kieran Juan Manuel Cabo
2014-02-28 14:12 ` [PATCH v2] ACPI / EC: Clear stale EC events on Samsung systems Kieran Clancy
2014-03-02  0:40   ` Rafael J. Wysocki
2014-03-05 18:30   ` Joseph Salisbury
2014-03-06  0:34     ` Kieran Clancy
2014-03-06  0:52       ` Rafael J. Wysocki
2014-03-06  1:24         ` Kieran Clancy
2014-03-06  1:36           ` Juan Manuel Cabo
2014-03-06 12:32           ` Rafael J. Wysocki
2014-03-06 23:12             ` Joseph Salisbury

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=530EC360.6010209@cn.fujitsu.com \
    --to=lig.fnst@cn.fujitsu.com \
    --cc=clancy.kieran@gmail.com \
    --cc=dennis.jansen@web.de \
    --cc=juanmanuel.cabo@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tianyu.lan@intel.com \
    /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

Powered by JetHome