From: ykzhao <yakui.zhao@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
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: Tue, 14 Dec 2010 09:21:36 +0800 [thread overview]
Message-ID: <1292289696.3983.60.camel@localhost.localdomain> (raw)
In-Reply-To: <201012132225.05149.rjw@sisk.pl>
On Tue, 2010-12-14 at 05:25 +0800, Rafael J. Wysocki wrote:
> 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.
The device->power.state is also updated in the function of
acpi_bus_get_power. But it won't try to call the _PSC or _ON/OFF method
to really change the corresponding power state. It only reports the
corresponding power state.
> In the case of acpi_bus_update_power() we at least _try_ to keep the two things
> in sync.
Yes. I agree that the acpi_bus_update_power can always assure that the
two things are in sync state. But some systems will report the bogus
power state although we already set another power state(For example:
Maybe it reports that it is in D3 state because of bogus BIOS code). In
such case if we try to turn off the corresponding power resource by
using _PSC/_ON/_OFF method, maybe we will cut off the power supply for
these devices.
> 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).
It seems that another point is missed in previous patch.
Before the reworking patch of power resource, the force_power_state
flag is used when setting the corresponding power state for some ACPI
devices(For example: Fan). This flag will still force to call the
_PSC/_ON/_OFF method even when it is already the same as the target
state. Maybe this is to workaround the BIOS issue that the power state
is not reported correctly first time.
Not sure whether my above understanding is reasonable.
Thanks.
Yakui
>
> 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
next prev parent reply other threads:[~2010-12-14 1:27 UTC|newest]
Thread overview: 13+ 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
2010-12-11 22:44 ` [Resend][PATCH 2/3] ACPI / PM: Drop acpi_bus_get_power() Rafael J. Wysocki
2010-12-11 22:45 ` [Resend][PATCH 3/3] ACPI / PM: Drop acpi_power_nocheck 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 21:25 ` Rafael J. Wysocki
2010-12-14 1:21 ` ykzhao [this message]
2010-12-14 20:24 ` Rafael J. Wysocki
2010-12-15 2:17 ` ykzhao
2010-12-15 22:20 ` Rafael J. Wysocki
2010-12-13 20:31 ` Len Brown
2010-12-13 21:11 ` 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=1292289696.3983.60.camel@localhost.localdomain \
--to=yakui.zhao@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=mjg59@srcf.ucam.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