All of lore.kernel.org
 help / color / mirror / Atom feed
* ACPI notify handler and reentrancy of WMI device.
@ 2011-01-16 18:18 Corentin Chary
       [not found] ` <AANLkTim0auvcUeDSO7QGSVbj0A+g88FSon7-qT6KzBHd@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Corentin Chary @ 2011-01-16 18:18 UTC (permalink / raw)
  To: linux acpi; +Cc: platform-driver-x86, Len Brown, Matthew Garrett

Hi,
I currently trying to fix a bug on the Eeepc 1000H with eeepc-wmi.

I got an acpi notify handler. The notify is triggered when I call WMBC().
In this notify handler, I must re-call WMBC (with some other arguments, it won't
notify again this time).

If I do that, I'll get:
[  176.920391] ACPI Error (dswload-0802): [_T_0] Namespace lookup
failure, AE_ALREADY_EXISTS
[  176.920416] ACPI Exception: AE_ALREADY_EXISTS, During name
lookup/catalog (20100428/psloop-231)
[  176.920439] ACPI Error (psparse-0537): Method parse/execution
failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS
[  176.920469] ACPI: Marking method WMBC as Serialized because of
AE_ALREADY_EXISTS error

Then it'll work.

What's the best way to avoid that ?
- Is there some way to tell acpica that this method should be serialized ?
- Is there some way to finish the execution of the first WMBC call in
the notify handler ?
- Should I use a work queue, and do what I have to do later (when the
previous call is finished) ?
- anything else ?

Thanks,

-- 
Corentin Chary
http://xf.iksaif.net

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

* Re: ACPI notify handler and reentrancy of WMI device.
       [not found] ` <AANLkTim0auvcUeDSO7QGSVbj0A+g88FSon7-qT6KzBHd@mail.gmail.com>
@ 2011-01-17  2:05   ` Lin Ming
  2011-01-17  6:51     ` Corentin Chary
  0 siblings, 1 reply; 9+ messages in thread
From: Lin Ming @ 2011-01-17  2:05 UTC (permalink / raw)
  To: Corentin Chary
  Cc: linux acpi, platform-driver-x86, Len Brown, Matthew Garrett


> From: Corentin Chary <corentin.chary@gmail.com>
> Date: Mon, Jan 17, 2011 at 2:18 AM
> Subject: ACPI notify handler and reentrancy of WMI device.
> To: linux acpi <linux-acpi@vger.kernel.org>
> Cc: platform-driver-x86@vger.kernel.org, Len Brown
> <len.brown@intel.com>, Matthew Garrett <mjg@redhat.com>
> 
> 
> Hi,
> I currently trying to fix a bug on the Eeepc 1000H with eeepc-wmi.
> 
> I got an acpi notify handler. The notify is triggered when I call WMBC().
> In this notify handler, I must re-call WMBC (with some other arguments, it won't
> notify again this time).
> 
> If I do that, I'll get:
> [  176.920391] ACPI Error (dswload-0802): [_T_0] Namespace lookup
> failure, AE_ALREADY_EXISTS
> [  176.920416] ACPI Exception: AE_ALREADY_EXISTS, During name
> lookup/catalog (20100428/psloop-231)
> [  176.920439] ACPI Error (psparse-0537): Method parse/execution
> failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS
> [  176.920469] ACPI: Marking method WMBC as Serialized because of
> AE_ALREADY_EXISTS error

Hi, 

Could you attach the acpidump output?

Thanks,
Lin Ming

> 
> Then it'll work.
> 
> What's the best way to avoid that ?
> - Is there some way to tell acpica that this method should be serialized ?
> - Is there some way to finish the execution of the first WMBC call in
> the notify handler ?
> - Should I use a work queue, and do what I have to do later (when the
> previous call is finished) ?
> - anything else ?
> 
> Thanks,
> 
> --
> Corentin Chary
> http://xf.iksaif.net
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

* Re: ACPI notify handler and reentrancy of WMI device.
  2011-01-17  2:05   ` Lin Ming
@ 2011-01-17  6:51     ` Corentin Chary
  2011-01-17  6:52       ` Corentin Chary
                         ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Corentin Chary @ 2011-01-17  6:51 UTC (permalink / raw)
  To: Lin Ming; +Cc: linux acpi, platform-driver-x86, Len Brown, Matthew Garrett

>> I got an acpi notify handler. The notify is triggered when I call WMBC().
>> In this notify handler, I must re-call WMBC (with some other arguments, it won't
>> notify again this time).
>>
>> If I do that, I'll get:
>> [  176.920391] ACPI Error (dswload-0802): [_T_0] Namespace lookup
>> failure, AE_ALREADY_EXISTS
>> [  176.920416] ACPI Exception: AE_ALREADY_EXISTS, During name
>> lookup/catalog (20100428/psloop-231)
>> [  176.920439] ACPI Error (psparse-0537): Method parse/execution
>> failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS
>> [  176.920469] ACPI: Marking method WMBC as Serialized because of
>> AE_ALREADY_EXISTS error
>
> Could you attach the acpidump output?

Here it is, and here is the patch I did (I used the workqueue solution
in this one):

http://git.iksaif.net/?p=acpi4asus.git;a=blobdiff;f=drivers/platform/x86/eeepc-wmi.c;h=725239860bad8d97dabf8b3db4086d6df4b7820b;hp=0d8217d1478028071859ba1a503ba226b3cb33a0;hb=1eac4d6a6fb632314a464e7d52e1dcb1e4780931;hpb=5c5d1a036bb7d38153c6d2102767ef51e5d94ce3

(check eeepc_rfkill_notify, it's triggered when the wlan rfkill is
blocked: WMBC is called to disable the wlan card, it send a
notification, the handler is called, the handler want to check the
wlan card status, it calls WMBC again).
Thanks;

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: ACPI notify handler and reentrancy of WMI device.
  2011-01-17  6:51     ` Corentin Chary
@ 2011-01-17  6:52       ` Corentin Chary
  2011-01-19  8:15       ` Corentin Chary
  2011-01-20  9:55       ` Lin Ming
  2 siblings, 0 replies; 9+ messages in thread
From: Corentin Chary @ 2011-01-17  6:52 UTC (permalink / raw)
  To: Lin Ming; +Cc: linux acpi, platform-driver-x86, Len Brown, Matthew Garrett

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

On Mon, Jan 17, 2011 at 7:51 AM, Corentin Chary
<corentin.chary@gmail.com> wrote:
>>> I got an acpi notify handler. The notify is triggered when I call WMBC().
>>> In this notify handler, I must re-call WMBC (with some other arguments, it won't
>>> notify again this time).
>>>
>>> If I do that, I'll get:
>>> [  176.920391] ACPI Error (dswload-0802): [_T_0] Namespace lookup
>>> failure, AE_ALREADY_EXISTS
>>> [  176.920416] ACPI Exception: AE_ALREADY_EXISTS, During name
>>> lookup/catalog (20100428/psloop-231)
>>> [  176.920439] ACPI Error (psparse-0537): Method parse/execution
>>> failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS
>>> [  176.920469] ACPI: Marking method WMBC as Serialized because of
>>> AE_ALREADY_EXISTS error
>>
>> Could you attach the acpidump output?
>
> Here it is

Ooops

-- 
Corentin Chary
http://xf.iksaif.net

[-- Attachment #2: acpidump.gz --]
[-- Type: application/x-gzip, Size: 44832 bytes --]

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

* Re: ACPI notify handler and reentrancy of WMI device.
  2011-01-17  6:51     ` Corentin Chary
  2011-01-17  6:52       ` Corentin Chary
@ 2011-01-19  8:15       ` Corentin Chary
  2011-01-20  9:55       ` Lin Ming
  2 siblings, 0 replies; 9+ messages in thread
From: Corentin Chary @ 2011-01-19  8:15 UTC (permalink / raw)
  To: Lin Ming; +Cc: linux acpi, platform-driver-x86, Len Brown, Matthew Garrett

On Mon, Jan 17, 2011 at 7:51 AM, Corentin Chary
<corentin.chary@gmail.com> wrote:
>>> I got an acpi notify handler. The notify is triggered when I call WMBC().
>>> In this notify handler, I must re-call WMBC (with some other arguments, it won't
>>> notify again this time).
>>>
>>> If I do that, I'll get:
>>> [  176.920391] ACPI Error (dswload-0802): [_T_0] Namespace lookup
>>> failure, AE_ALREADY_EXISTS
>>> [  176.920416] ACPI Exception: AE_ALREADY_EXISTS, During name
>>> lookup/catalog (20100428/psloop-231)
>>> [  176.920439] ACPI Error (psparse-0537): Method parse/execution
>>> failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS
>>> [  176.920469] ACPI: Marking method WMBC as Serialized because of
>>> AE_ALREADY_EXISTS error
>>
>> Could you attach the acpidump output?
>
> Here it is, and here is the patch I did (I used the workqueue solution
> in this one):
>
> http://git.iksaif.net/?p=acpi4asus.git;a=blobdiff;f=drivers/platform/x86/eeepc-wmi.c;h=725239860bad8d97dabf8b3db4086d6df4b7820b;hp=0d8217d1478028071859ba1a503ba226b3cb33a0;hb=1eac4d6a6fb632314a464e7d52e1dcb1e4780931;hpb=5c5d1a036bb7d38153c6d2102767ef51e5d94ce3
>
> (check eeepc_rfkill_notify, it's triggered when the wlan rfkill is
> blocked: WMBC is called to disable the wlan card, it send a
> notification, the handler is called, the handler want to check the
> wlan card status, it calls WMBC again).
> Thanks;
>

The above patch doesn't seems to fix the issue everytime.
I think adding mutex protecting WMBC calls would do it.
I you know any cleaner way to do that, let me know.


-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: ACPI notify handler and reentrancy of WMI device.
  2011-01-17  6:51     ` Corentin Chary
  2011-01-17  6:52       ` Corentin Chary
  2011-01-19  8:15       ` Corentin Chary
@ 2011-01-20  9:55       ` Lin Ming
  2011-01-20 10:00         ` Corentin Chary
  2011-01-20 10:10         ` Corentin Chary
  2 siblings, 2 replies; 9+ messages in thread
From: Lin Ming @ 2011-01-20  9:55 UTC (permalink / raw)
  To: Corentin Chary
  Cc: linux acpi, platform-driver-x86, Brown, Len, Matthew Garrett

On Mon, 2011-01-17 at 14:51 +0800, Corentin Chary wrote:
> >> I got an acpi notify handler. The notify is triggered when I call WMBC().
> >> In this notify handler, I must re-call WMBC (with some other arguments, it won't
> >> notify again this time).
> >>
> >> If I do that, I'll get:
> >> [  176.920391] ACPI Error (dswload-0802): [_T_0] Namespace lookup
> >> failure, AE_ALREADY_EXISTS
> >> [  176.920416] ACPI Exception: AE_ALREADY_EXISTS, During name
> >> lookup/catalog (20100428/psloop-231)
> >> [  176.920439] ACPI Error (psparse-0537): Method parse/execution
> >> failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS
> >> [  176.920469] ACPI: Marking method WMBC as Serialized because of
> >> AE_ALREADY_EXISTS error
> >
> > Could you attach the acpidump output?
> 
> Here it is, and here is the patch I did (I used the workqueue solution
> in this one):
> 
> http://git.iksaif.net/?p=acpi4asus.git;a=blobdiff;f=drivers/platform/x86/eeepc-wmi.c;h=725239860bad8d97dabf8b3db4086d6df4b7820b;hp=0d8217d1478028071859ba1a503ba226b3cb33a0;hb=1eac4d6a6fb632314a464e7d52e1dcb1e4780931;hpb=5c5d1a036bb7d38153c6d2102767ef51e5d94ce3
> 
> (check eeepc_rfkill_notify, it's triggered when the wlan rfkill is
> blocked: WMBC is called to disable the wlan card, it send a
> notification, the handler is called, the handler want to check the
> wlan card status, it calls WMBC again).
> Thanks;
> 

Sorry for late reply.

WMBC is not an ACPI spec defined method (which always start with "_",
_ADR, _DSW etc), the driver should only call ACPI spec defined method.
What does this method do?

And, I don't see any call to WMBC in eeepc-wmi.c or above patch.

Lin Ming

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

* Re: ACPI notify handler and reentrancy of WMI device.
  2011-01-20  9:55       ` Lin Ming
@ 2011-01-20 10:00         ` Corentin Chary
  2011-01-21 19:55           ` Corentin Chary
  2011-01-20 10:10         ` Corentin Chary
  1 sibling, 1 reply; 9+ messages in thread
From: Corentin Chary @ 2011-01-20 10:00 UTC (permalink / raw)
  To: Lin Ming; +Cc: linux acpi, platform-driver-x86, Brown, Len, Matthew Garrett

On Thu, Jan 20, 2011 at 10:55 AM, Lin Ming <ming.m.lin@intel.com> wrote:
> On Mon, 2011-01-17 at 14:51 +0800, Corentin Chary wrote:
>> >> I got an acpi notify handler. The notify is triggered when I call WMBC().
>> >> In this notify handler, I must re-call WMBC (with some other arguments, it won't
>> >> notify again this time).
>> >>
>> >> If I do that, I'll get:
>> >> [  176.920391] ACPI Error (dswload-0802): [_T_0] Namespace lookup
>> >> failure, AE_ALREADY_EXISTS
>> >> [  176.920416] ACPI Exception: AE_ALREADY_EXISTS, During name
>> >> lookup/catalog (20100428/psloop-231)
>> >> [  176.920439] ACPI Error (psparse-0537): Method parse/execution
>> >> failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS
>> >> [  176.920469] ACPI: Marking method WMBC as Serialized because of
>> >> AE_ALREADY_EXISTS error
>> >
>> > Could you attach the acpidump output?
>>
>> Here it is, and here is the patch I did (I used the workqueue solution
>> in this one):
>>
>> http://git.iksaif.net/?p=acpi4asus.git;a=blobdiff;f=drivers/platform/x86/eeepc-wmi.c;h=725239860bad8d97dabf8b3db4086d6df4b7820b;hp=0d8217d1478028071859ba1a503ba226b3cb33a0;hb=1eac4d6a6fb632314a464e7d52e1dcb1e4780931;hpb=5c5d1a036bb7d38153c6d2102767ef51e5d94ce3
>>
>> (check eeepc_rfkill_notify, it's triggered when the wlan rfkill is
>> blocked: WMBC is called to disable the wlan card, it send a
>> notification, the handler is called, the handler want to check the
>> wlan card status, it calls WMBC again).
>> Thanks;
>>
>
> Sorry for late reply.
>
> WMBC is not an ACPI spec defined method (which always start with "_",
> _ADR, _DSW etc), the driver should only call ACPI spec defined method.
> What does this method do?
>
> And, I don't see any call to WMBC in eeepc-wmi.c or above patch.

It's a wmi driver, so it calls wmi_evaluate_method, wich internally
will call \AMW0.WMBC for this GUID.
Sorry for the confusion.

I finally found a solut^W^W workaround:
http://git.iksaif.net/?p=acpi4asus.git;a=commitdiff;h=aa8ff8f23b2f99da9371da9154d3e523b964f054;hp=d13f17d9657d7161884e289cc2ac6efb414a6ff9

But it would probably be cleaner to tell ACPI that we want to
serialize access to this method, and let acpica mechanism do the job
for us.

Thanks,

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: ACPI notify handler and reentrancy of WMI device.
  2011-01-20  9:55       ` Lin Ming
  2011-01-20 10:00         ` Corentin Chary
@ 2011-01-20 10:10         ` Corentin Chary
  1 sibling, 0 replies; 9+ messages in thread
From: Corentin Chary @ 2011-01-20 10:10 UTC (permalink / raw)
  To: Lin Ming; +Cc: linux acpi, platform-driver-x86, Brown, Len, Matthew Garrett

> What does this method do?

It does ... *everything*, it's our only entry point in this driver.

-- 
Corentin Chary
http://xf.iksaif.net

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

* Re: ACPI notify handler and reentrancy of WMI device.
  2011-01-20 10:00         ` Corentin Chary
@ 2011-01-21 19:55           ` Corentin Chary
  0 siblings, 0 replies; 9+ messages in thread
From: Corentin Chary @ 2011-01-21 19:55 UTC (permalink / raw)
  To: Lin Ming; +Cc: linux acpi, platform-driver-x86, Brown, Len, Matthew Garrett

On Thu, Jan 20, 2011 at 11:00 AM, Corentin Chary
<corentin.chary@gmail.com> wrote:
> On Thu, Jan 20, 2011 at 10:55 AM, Lin Ming <ming.m.lin@intel.com> wrote:
>> On Mon, 2011-01-17 at 14:51 +0800, Corentin Chary wrote:
>>> >> I got an acpi notify handler. The notify is triggered when I call WMBC().
>>> >> In this notify handler, I must re-call WMBC (with some other arguments, it won't
>>> >> notify again this time).
>>> >>
>>> >> If I do that, I'll get:
>>> >> [  176.920391] ACPI Error (dswload-0802): [_T_0] Namespace lookup
>>> >> failure, AE_ALREADY_EXISTS
>>> >> [  176.920416] ACPI Exception: AE_ALREADY_EXISTS, During name
>>> >> lookup/catalog (20100428/psloop-231)
>>> >> [  176.920439] ACPI Error (psparse-0537): Method parse/execution
>>> >> failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS
>>> >> [  176.920469] ACPI: Marking method WMBC as Serialized because of
>>> >> AE_ALREADY_EXISTS error
>>> >
>>> > Could you attach the acpidump output?
>>>
>>> Here it is, and here is the patch I did (I used the workqueue solution
>>> in this one):
>>>
>>> http://git.iksaif.net/?p=acpi4asus.git;a=blobdiff;f=drivers/platform/x86/eeepc-wmi.c;h=725239860bad8d97dabf8b3db4086d6df4b7820b;hp=0d8217d1478028071859ba1a503ba226b3cb33a0;hb=1eac4d6a6fb632314a464e7d52e1dcb1e4780931;hpb=5c5d1a036bb7d38153c6d2102767ef51e5d94ce3
>>>
>>> (check eeepc_rfkill_notify, it's triggered when the wlan rfkill is
>>> blocked: WMBC is called to disable the wlan card, it send a
>>> notification, the handler is called, the handler want to check the
>>> wlan card status, it calls WMBC again).
>>> Thanks;
>>>
>>
>> Sorry for late reply.
>>
>> WMBC is not an ACPI spec defined method (which always start with "_",
>> _ADR, _DSW etc), the driver should only call ACPI spec defined method.
>> What does this method do?
>>
>> And, I don't see any call to WMBC in eeepc-wmi.c or above patch.
>
> It's a wmi driver, so it calls wmi_evaluate_method, wich internally
> will call \AMW0.WMBC for this GUID.
> Sorry for the confusion.
>
> I finally found a solut^W^W workaround:
> http://git.iksaif.net/?p=acpi4asus.git;a=commitdiff;h=aa8ff8f23b2f99da9371da9154d3e523b964f054;hp=d13f17d9657d7161884e289cc2ac6efb414a6ff9

As I thought, using a mutex here introduce a lot of potential deadlock ...
Any Idea ?


-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2011-01-21 19:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-16 18:18 ACPI notify handler and reentrancy of WMI device Corentin Chary
     [not found] ` <AANLkTim0auvcUeDSO7QGSVbj0A+g88FSon7-qT6KzBHd@mail.gmail.com>
2011-01-17  2:05   ` Lin Ming
2011-01-17  6:51     ` Corentin Chary
2011-01-17  6:52       ` Corentin Chary
2011-01-19  8:15       ` Corentin Chary
2011-01-20  9:55       ` Lin Ming
2011-01-20 10:00         ` Corentin Chary
2011-01-21 19:55           ` Corentin Chary
2011-01-20 10:10         ` Corentin Chary

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.