Linux ACPI
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Zhang Rui <rui.zhang@intel.com>
Cc: Matthew Garrett <mjg@redhat.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH] acpi: Disable explicit power state retrieval on fans
Date: Mon, 28 Dec 2009 21:47:41 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0912282147360.12663@localhost.localdomain> (raw)
In-Reply-To: <1261036928.27291.21.camel@rzhang1-desktop>

applied to acpi-test

thanks,
Len Brown, Intel Open Source Technology Center

On Thu, 17 Dec 2009, Zhang Rui wrote:

> On Fri, 2009-12-11 at 11:52 +0800, Zhang Rui wrote:
> > On Wed, 2009-11-11 at 04:09 +0800, Matthew Garrett wrote:
> > > https://bugzilla.redhat.com/show_bug.cgi?id=531916 describes a system
> > > with a _PSC method for the fan that always returns "on". There's no
> > > benefit in us always requesting the state of the fan when performing
> > > transitions - we want to do everything we can to ensure that the fan turns
> > > on when it should do, not risk hardware damage by believing the hardware
> > > when it tells us the fan is already on. Given that the Leading Other OS(tm)
> > > works fine on this machine, it seems likely that it behaves in much this
> > > way.
> > > 
> > sounds reasonable.
> > But how can we get the power state if power resources is not available?
> > 
> > In acpi_bus_get_power, why not make acpi_power_get_inferred_state as the
> > first choice, instead of evaluating _PSC? like the patch attached.
> > 
> Matthew,
> 
> how about this one?
> 
> 
> If the ACPI power state can be got both directly and indirectly,
> we prefer to get it indirectly.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=531916 describes a
> system with a _PSC method for the fan that always returns "on".
> There's no benefit in us always requesting the state of the fan
> when performing transitions - we want to do everything we can
> to ensure that the fan turns on when it should do, not risk
> hardware damage by believing the hardware when it tells us the
> fan is already on. Given that the Leading Other OS(tm) works fine
> on this machine, it seems likely that it behaves in much this way.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/acpi/bus.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6/drivers/acpi/bus.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/bus.c
> +++ linux-2.6/drivers/acpi/bus.c
> @@ -190,16 +190,16 @@ int acpi_bus_get_power(acpi_handle handl
>  		 * Get the device's power state either directly (via _PSC) or
>  		 * indirectly (via power resources).
>  		 */
> -		if (device->power.flags.explicit_get) {
> +		if (device->power.flags.power_resources) {
> +			result = acpi_power_get_inferred_state(device);
> +			if (result)
> +				return result;
> +		} else if (device->power.flags.explicit_get) {
>  			status = acpi_evaluate_integer(device->handle, "_PSC",
>  						       NULL, &psc);
>  			if (ACPI_FAILURE(status))
>  				return -ENODEV;
>  			device->power.state = (int)psc;
> -		} else if (device->power.flags.power_resources) {
> -			result = acpi_power_get_inferred_state(device);
> -			if (result)
> -				return result;
>  		}
>  
>  		*state = device->power.state;
> 
> 
> 
> --
> 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
> 

      parent reply	other threads:[~2009-12-29  2:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10 20:09 [PATCH] acpi: Disable explicit power state retrieval on fans Matthew Garrett
2009-11-24 14:36 ` Matthew Garrett
2009-12-11  3:52 ` Zhang Rui
2009-12-17  8:02   ` Zhang Rui
     [not found]     ` <20091217191353.GA11041@srcf.ucam.org>
2009-12-18  1:02       ` Zhang Rui
2009-12-29  2:47     ` Len Brown [this message]

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=alpine.LFD.2.00.0912282147360.12663@localhost.localdomain \
    --to=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=rui.zhang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox