From patchwork Thu Dec 17 08:02:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 68519 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBI4ixtO005715 for ; Fri, 18 Dec 2009 04:47:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751873AbZLQH73 (ORCPT ); Thu, 17 Dec 2009 02:59:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752178AbZLQH73 (ORCPT ); Thu, 17 Dec 2009 02:59:29 -0500 Received: from mga02.intel.com ([134.134.136.20]:65026 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbZLQH73 (ORCPT ); Thu, 17 Dec 2009 02:59:29 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 16 Dec 2009 23:57:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,410,1257148800"; d="scan'208";a="579777018" Received: from rzhang1-desktop.sh.intel.com (HELO [10.239.36.29]) ([10.239.36.29]) by orsmga001.jf.intel.com with ESMTP; 16 Dec 2009 23:59:08 -0800 Subject: Re: [PATCH] acpi: Disable explicit power state retrieval on fans From: Zhang Rui To: Matthew Garrett Cc: "linux-acpi@vger.kernel.org" , "lenb@kernel.org" In-Reply-To: <1260503569.27069.326.camel@rzhang1-desktop> References: <1257883752-2163-1-git-send-email-mjg@redhat.com> <1260503569.27069.326.camel@rzhang1-desktop> Date: Thu, 17 Dec 2009 16:02:08 +0800 Message-ID: <1261036928.27291.21.camel@rzhang1-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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;