All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: ykzhao <yakui.zhao@intel.com>
Cc: Len Brown <lenb@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>
Subject: Re: [Resend][PATCH 0/3] ACPI / PM: Patches missing from linux-acpi-2.6/test
Date: Mon, 13 Dec 2010 22:25:04 +0100	[thread overview]
Message-ID: <201012132225.05149.rjw@sisk.pl> (raw)
In-Reply-To: <1292229322.3983.29.camel@localhost.localdomain>

On Monday, December 13, 2010, ykzhao wrote:
> On Sun, 2010-12-12 at 06:39 +0800, Rafael J. Wysocki wrote:
> > Hi Len,
> > 
> > The following three patches seem to have been dropped from your 'test' branch.
> > 
> > If that happened by accident, please reapply.  Otherwise, please let me know
> > what's wrong with the patches so that I can fix them.
> > 
> > [1/3] - Make fujitsu_laptop use acpi_bus_update_power() instead of
> >         acpi_bus_get_power() which is unsafe.
> 
> It seems that the function of acpi_bus_update_power not only obtains
> the current power state, but also set the corresponding power state.
> Right?

Yes, it does.

> If the device reports the bogus power state, maybe we will set the
> incorrect power state for the corresponding device when using the
> function of acpi_bus_update_power instead of acpi_bus_get_power.

Please actually look at acpi_bus_get_power() (being removed by [2/3]) and note
that it _also_ modifies device->power.state (it doesn't return the state, actually),
so if the returned state is really bogus, we'll have a mismatch between
device->power.state and the real state of the device.  This cannot be good.

In the case of acpi_bus_update_power() we at least _try_ to keep the two things
in sync.

Note, this is _essentially_ important for power resources (if
acpi_bus_get_power() is used, the refcounts are _guaranteed_ not to be in sync
with device->power.state in some situations).

> In such case maybe the device can't work well. 
> 
> The bogus power state is reported for some devices on some laptops. For
> example: 
>     http://bugzilla.kernel.org/show_bug.cgi?id=8049
>     http://bugzilla.kernel.org/show_bug.cgi?id=11000

These bugs are about acpi_bus_set_power() doing the acpi_bus_get_power()
before setting the state, which is wrong and is being removed by my previous
patches (now in the Len's tree).

Thanks,
Rafael
--
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

  reply	other threads:[~2010-12-13 21:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-11 22:39 [Resend][PATCH 0/3] ACPI / PM: Patches missing from linux-acpi-2.6/test Rafael J. Wysocki
2010-12-11 22:43 ` [Resend][PATCH 1/3] Platform / x86: Make fujitsu_laptop use acpi_bus_update_power() Rafael J. Wysocki
2011-01-01  2:34   ` Jonathan Woithe
2011-01-01  2:34   ` Jonathan Woithe
2010-12-11 22:43 ` Rafael J. Wysocki
2010-12-11 22:44 ` [Resend][PATCH 2/3] ACPI / PM: Drop acpi_bus_get_power() Rafael J. Wysocki
2010-12-11 22:44 ` Rafael J. Wysocki
2010-12-11 22:45 ` [Resend][PATCH 3/3] ACPI / PM: Drop acpi_power_nocheck Rafael J. Wysocki
2010-12-11 22:45 ` Rafael J. Wysocki
2010-12-13  8:35 ` [Resend][PATCH 0/3] ACPI / PM: Patches missing from linux-acpi-2.6/test ykzhao
2010-12-13  8:35 ` ykzhao
2010-12-13 21:25   ` Rafael J. Wysocki [this message]
2010-12-14  1:21     ` ykzhao
2010-12-14 20:24       ` Rafael J. Wysocki
2010-12-14 20:24       ` Rafael J. Wysocki
2010-12-15  2:17         ` ykzhao
2010-12-15 22:20           ` Rafael J. Wysocki
2010-12-15 22:20           ` Rafael J. Wysocki
2010-12-15  2:17         ` ykzhao
2010-12-14  1:21     ` ykzhao
2010-12-13 21:25   ` Rafael J. Wysocki
2010-12-13 20:31 ` Len Brown
2010-12-13 20:31 ` Len Brown
2010-12-13 21:11   ` Rafael J. Wysocki
2010-12-13 21:11   ` Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2010-12-11 22:39 Rafael J. Wysocki

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=201012132225.05149.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=yakui.zhao@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 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.