From: Thomas Renninger <trenn@suse.de>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH 0/6] ACPI: button: minor cleanups
Date: Mon, 11 May 2009 08:56:37 +0200 [thread overview]
Message-ID: <200905110856.37626.trenn@suse.de> (raw)
In-Reply-To: <200905081453.02556.bjorn.helgaas@hp.com>
On Friday 08 May 2009 10:53:01 pm Bjorn Helgaas wrote:
> On Wednesday 06 May 2009 11:20:52 am Bjorn Helgaas wrote:
> > On Wednesday 06 May 2009 09:13:07 am Thomas Renninger wrote:
> > > Below is the outcome of the patch which fixes a fixed feature button
> > > s2ram issue.
> > >
> > > This does not work anymore since Bjoern's patches.
> > > Comparing the with the HID of the acpi device looks ugly.
> > >
> > > Shall I revive the fixed feature vs GPE button types?
> > > ACPI_BUTTON_TYPE_POWERF and ACPI_BUTTON_TYPE_SLEEPF?
> >
> > I don't understand exactly how I broke this.
Ahh, sorry.
You did not break anything.
The patch is a fix (not for a regression), but is now (with your change)
somewhat harder/uncleaner to integrate.
The fix removes fixed featured button's fixed event handler on
suspend and installs it again on resume.
With your change, the button driver does not know anymore about
fixed feature buttons. And notify handlers shouldn't be touched with
your change in the button driver, but I think this is cleaner.
So this is nothing urgent. I'll send a patch which works with your
version, but I am not sure what the cleanest way is now to add this.
Sorry for not being clear,
Thomas
> What tree are you testing? In Linus's upstream tree, 373cfc360e
> adds the .notify method, and at the same time, it removes
> acpi_button_notify_fixed().
>
> Your patch below, which fixes the problem, shows that you already
> have the .notify method, and yet you apparently *also* have the
> acpi_button_notify_fixed() function. That makes me suspect that
> you're using a tree with a merge error.
>
> Bjorn
>
> > > @@ -85,6 +86,7 @@ static struct acpi_driver acpi_button_driver = {
> > > .ops = {
> > > .add = acpi_button_add,
> > > .resume = acpi_button_resume,
> > > + .suspend = acpi_button_suspend,
> > > .remove = acpi_button_remove,
> > > .notify = acpi_button_notify,
> > > },
> > > @@ -281,8 +283,41 @@ static int acpi_button_resume(struct acpi_device
> > > *device) {
> > > struct acpi_button *button = acpi_driver_data(device);
> > >
> > > - if (button->type == ACPI_BUTTON_TYPE_LID)
> > > + if (!button)
> > > + return -EINVAL;
> > > + switch (button->type) {
> > > + case ACPI_BUTTON_TYPE_LID:
> > > return acpi_lid_send_state(device);
> > > + case ACPI_BUTTON_TYPE_SLEEPF:
> > > + return acpi_install_fixed_event_handler(
> > > + ACPI_EVENT_SLEEP_BUTTON,
> > > + acpi_button_notify_fixed, button);
> > > +
> > > + case ACPI_BUTTON_TYPE_POWERF:
> > > + return acpi_install_fixed_event_handler(
> > > + ACPI_EVENT_POWER_BUTTON,
> > > + acpi_button_notify_fixed, button);
> > > + }
> > > + return 0;
> > > +}
> > > +
> > > +static int acpi_button_suspend(struct acpi_device *device,
> > > pm_message_t state) +{
> > > + struct acpi_button *button;
> > > + if (!device)
> > > + return -EINVAL;
> > > + button = acpi_driver_data(device);
> > > + if (!button)
> > > + return -EINVAL;
> > > + switch (button->type) {
> > > + case ACPI_BUTTON_TYPE_SLEEPF:
> > > + return acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
> > > + acpi_button_notify_fixed);
> > > +
> > > + case ACPI_BUTTON_TYPE_POWERF:
> > > + return acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
> > > + acpi_button_notify_fixed);
> > > + }
> > > return 0;
> > > }
next prev parent reply other threads:[~2009-05-11 5:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-08 15:39 [PATCH 0/6] ACPI: button: minor cleanups Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 1/6] ACPI: button: whitespace changes Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 2/6] ACPI: button: remove unnecessary null pointer checks Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 3/6] ACPI: button: use Linux style for getting driver_data Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 4/6] ACPI: button: cache hid/name/class pointers Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 5/6] ACPI: button: remove button->device pointer Bjorn Helgaas
2009-04-08 15:40 ` [PATCH 6/6] ACPI: button: remove control method/fixed hardware distinctions Bjorn Helgaas
2009-04-18 4:19 ` [PATCH 0/6] ACPI: button: minor cleanups Len Brown
[not found] ` <200904171339.15895.bjorn.helgaas@hp.com>
[not found] ` <200905061713.08057.trenn@suse.de>
2009-05-06 17:20 ` Bjorn Helgaas
2009-05-08 17:21 ` Bjorn Helgaas
2009-05-08 20:53 ` Bjorn Helgaas
2009-05-11 6:56 ` Thomas Renninger [this message]
2009-05-11 22:13 ` Bjorn Helgaas
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=200905110856.37626.trenn@suse.de \
--to=trenn@suse.de \
--cc=bjorn.helgaas@hp.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rjw@sisk.pl \
/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