linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.32-rc1: spurious error message from "ACPI button: provide lid status functions"
@ 2009-10-03 10:52 Alan Jenkins
  2009-10-05 23:59 ` Jesse Barnes
  2009-10-26 20:24 ` Jesse Barnes
  0 siblings, 2 replies; 3+ messages in thread
From: Alan Jenkins @ 2009-10-03 10:52 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: Eric Anholt, Matthew Garrett, linux acpi, linux-kernel

ACPI: Waking up from system sleep state S4
PM: Device PNP0C0D:00 failed to thaw: error 1

The device appears to be the acpi lid "button".  The error comes from
calling acpi_lid_send_state():

    @@ -242,7 +272,12 @@ static int acpi_lid_send_state(struct
    acpi_device *device)
         /* input layer checks if event is redundant */
         input_report_switch(button->input, SW_LID, !state);
         input_sync(button->input);
    -    return 0;
    +
    +    ret = blocking_notifier_call_chain(&acpi_lid_notifier, state,
    device);
    +    if (ret == NOTIFY_DONE)
    +        ret = blocking_notifier_call_chain(&acpi_lid_notifier, state,
    +                           device);
    +    return ret;
     }


The "error 1" is actually NOTIFY_OK.

    @include/linux/notify.h:
    #define NOTIFY_DONE        0x0000        /* Don't care */
    #define NOTIFY_OK        0x0001        /* Suits me */
    #define NOTIFY_STOP_MASK    0x8000        /* Don't call further */
    #define NOTIFY_BAD        (NOTIFY_STOP_MASK|0x0002)
                            /* Bad/Veto action */
    /*
     * Clean way to return from the notifier and stop further calls.
     */
    #define NOTIFY_STOP        (NOTIFY_OK|NOTIFY_STOP_MASK)


Clearly acpi_lid_send_state() should return 0 for NOTIFY_OK.  I guess
NOTIFY_STOP can be ignored until someone says they need it.

But I don't understand the NOTIFY_DONE case, so I'm not sure.  I can't
find any users to reverse engineer it.  IMO it either needs to be
removed or commented.

Can you please sort this out, so we don't see this error message on a
completely successful resume?

Thanks!
Alan

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

* Re: 2.6.32-rc1: spurious error message from "ACPI button: provide lid status functions"
  2009-10-03 10:52 2.6.32-rc1: spurious error message from "ACPI button: provide lid status functions" Alan Jenkins
@ 2009-10-05 23:59 ` Jesse Barnes
  2009-10-26 20:24 ` Jesse Barnes
  1 sibling, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2009-10-05 23:59 UTC (permalink / raw)
  To: Alan Jenkins; +Cc: Eric Anholt, Matthew Garrett, linux acpi, linux-kernel

On Sat, 03 Oct 2009 11:52:57 +0100
Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:

> ACPI: Waking up from system sleep state S4
> PM: Device PNP0C0D:00 failed to thaw: error 1
> 
> The device appears to be the acpi lid "button".  The error comes from
> calling acpi_lid_send_state():
> 
>     @@ -242,7 +272,12 @@ static int acpi_lid_send_state(struct
>     acpi_device *device)
>          /* input layer checks if event is redundant */
>          input_report_switch(button->input, SW_LID, !state);
>          input_sync(button->input);
>     -    return 0;
>     +
>     +    ret = blocking_notifier_call_chain(&acpi_lid_notifier, state,
>     device);
>     +    if (ret == NOTIFY_DONE)
>     +        ret = blocking_notifier_call_chain(&acpi_lid_notifier,
> state,
>     +                           device);
>     +    return ret;
>      }
> 
> 
> The "error 1" is actually NOTIFY_OK.
> 
>     @include/linux/notify.h:
>     #define NOTIFY_DONE        0x0000        /* Don't care */
>     #define NOTIFY_OK        0x0001        /* Suits me */
>     #define NOTIFY_STOP_MASK    0x8000        /* Don't call further */
>     #define NOTIFY_BAD        (NOTIFY_STOP_MASK|0x0002)
>                             /* Bad/Veto action */
>     /*
>      * Clean way to return from the notifier and stop further calls.
>      */
>     #define NOTIFY_STOP        (NOTIFY_OK|NOTIFY_STOP_MASK)
> 
> 
> Clearly acpi_lid_send_state() should return 0 for NOTIFY_OK.  I guess
> NOTIFY_STOP can be ignored until someone says they need it.
> 
> But I don't understand the NOTIFY_DONE case, so I'm not sure.  I can't
> find any users to reverse engineer it.  IMO it either needs to be
> removed or commented.
> 
> Can you please sort this out, so we don't see this error message on a
> completely successful resume?

Ah yeah, this does look funky.  I'll fix it up.

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

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

* Re: 2.6.32-rc1: spurious error message from "ACPI button: provide lid status functions"
  2009-10-03 10:52 2.6.32-rc1: spurious error message from "ACPI button: provide lid status functions" Alan Jenkins
  2009-10-05 23:59 ` Jesse Barnes
@ 2009-10-26 20:24 ` Jesse Barnes
  1 sibling, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2009-10-26 20:24 UTC (permalink / raw)
  To: Alan Jenkins; +Cc: Eric Anholt, Matthew Garrett, linux acpi, linux-kernel, lenb

On Sat, 03 Oct 2009 11:52:57 +0100
Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:

> ACPI: Waking up from system sleep state S4
> PM: Device PNP0C0D:00 failed to thaw: error 1
> 
> The device appears to be the acpi lid "button".  The error comes from
> calling acpi_lid_send_state():
> 
>     @@ -242,7 +272,12 @@ static int acpi_lid_send_state(struct
>     acpi_device *device)
>          /* input layer checks if event is redundant */
>          input_report_switch(button->input, SW_LID, !state);
>          input_sync(button->input);
>     -    return 0;
>     +
>     +    ret = blocking_notifier_call_chain(&acpi_lid_notifier, state,
>     device);
>     +    if (ret == NOTIFY_DONE)
>     +        ret = blocking_notifier_call_chain(&acpi_lid_notifier,
> state,
>     +                           device);
>     +    return ret;
>      }
> 
> 
> The "error 1" is actually NOTIFY_OK.
> 
>     @include/linux/notify.h:
>     #define NOTIFY_DONE        0x0000        /* Don't care */
>     #define NOTIFY_OK        0x0001        /* Suits me */
>     #define NOTIFY_STOP_MASK    0x8000        /* Don't call further */
>     #define NOTIFY_BAD        (NOTIFY_STOP_MASK|0x0002)
>                             /* Bad/Veto action */
>     /*
>      * Clean way to return from the notifier and stop further calls.
>      */
>     #define NOTIFY_STOP        (NOTIFY_OK|NOTIFY_STOP_MASK)
> 
> 
> Clearly acpi_lid_send_state() should return 0 for NOTIFY_OK.  I guess
> NOTIFY_STOP can be ignored until someone says they need it.
> 
> But I don't understand the NOTIFY_DONE case, so I'm not sure.  I can't
> find any users to reverse engineer it.  IMO it either needs to be
> removed or commented.
> 
> Can you please sort this out, so we don't see this error message on a
> completely successful resume?

I think Len and I sorted this out at KS.  Len did you commit the fix
suggested above?

-- 
Jesse Barnes, Intel Open Source Technology Center

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

end of thread, other threads:[~2009-10-26 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-03 10:52 2.6.32-rc1: spurious error message from "ACPI button: provide lid status functions" Alan Jenkins
2009-10-05 23:59 ` Jesse Barnes
2009-10-26 20:24 ` Jesse Barnes

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