LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Yi Yang <yi.y.yang@intel.com>
To: linux-acpi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, lenb@kernel.org,
	acpi-bugzilla@lists.sourceforge.net
Subject: [PATCH] ACPI: create proc entry 'power' only if C2 or C3 is supported
Date: Thu, 24 Jan 2008 08:45:32 +0800	[thread overview]
Message-ID: <1201135532.3969.3.camel@yangyi-dev.bj.intel.com> (raw)
In-Reply-To: <1199762486.3551.22.camel@yangyi-dev.bj.intel.com>

Subject: ACPI: Create proc entry 'power' only C2 or C3 is supported
From: Yi Yang <yi.y.yang@intel.com>

ACPI processor idle driver makes sense only if the processor supports
C2 or C3. For legacy C0 and C1, just the original pm_idle is working
, statistics info about promotion, demotion, latency, usage and
duration are empty or 0, so these are misleading, users'll think their
CPUs support C states (C2 or C3), /proc/acpi/processor/CPU*/power
shouldn't exist for this case at all.

This patch fixes this issue, it makes ACPI processor idle driver to create
proc entry only if the processor supports C2 or C3.


Signed-off-by: Yi Yang <yi.y.yang@intel.com>
---
 processor_idle.c |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

--- a/drivers/acpi/processor_idle.c	2008-01-24 05:34:29.000000000 +0800
+++ b/drivers/acpi/processor_idle.c	2008-01-24 07:04:59.000000000 +0800
@@ -1738,17 +1738,17 @@ int __cpuinit acpi_processor_power_init(
 			pm_idle = acpi_processor_idle;
 		}
 #endif
-	}
 
-	/* 'power' [R] */
-	entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER,
-				  S_IRUGO, acpi_device_dir(device));
-	if (!entry)
-		return -EIO;
-	else {
-		entry->proc_fops = &acpi_processor_power_fops;
-		entry->data = acpi_driver_data(device);
-		entry->owner = THIS_MODULE;
+		/* 'power' [R] */
+		entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER,
+					  S_IRUGO, acpi_device_dir(device));
+		if (!entry)
+			return -EIO;
+		else {
+			entry->proc_fops = &acpi_processor_power_fops;
+			entry->data = acpi_driver_data(device);
+			entry->owner = THIS_MODULE;
+		}
 	}
 
 	return 0;
@@ -1763,7 +1763,8 @@ int acpi_processor_power_exit(struct acp
 #endif
 	pr->flags.power_setup_done = 0;
 
-	if (acpi_device_dir(device))
+	if (acpi_device_dir(device) &&
+		((pr->flags.power) && (!boot_option_idle_override)))
 		remove_proc_entry(ACPI_PROCESSOR_FILE_POWER,
 				  acpi_device_dir(device));
 



  reply	other threads:[~2008-01-24  9:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-27  6:47 [PATCH linux-acpi] Fix /proc/acpi/alarm set error Yi Yang
2007-12-27  8:41 ` [PATCH linux-acpi] Remove superfluous code and correct counting error in function acpi_system_write_alarm Yi Yang
2007-12-29  8:22   ` [PATCH linux-acpi] Correct wakeup set error and append a new column PCI ID Yi Yang
2008-01-01 23:20     ` Pavel Machek
2008-01-02  2:03       ` Yi Yang
2008-01-02 16:09         ` Pavel Machek
2008-01-03  2:02           ` Yi Yang
2008-01-03  2:11           ` Yi Yang
2008-01-04  8:16     ` [PATCH linux-acpi] fix acpi fan state set error Yi Yang
2008-01-07  6:56       ` [PATCH] ACPI: fix processor throttling " Yi Yang
2008-01-08  3:21         ` [PATCH] ACPI: fix processor limit " Yi Yang
2008-01-24  0:45           ` Yi Yang [this message]
2008-01-24 14:43             ` [PATCH] ACPI: create proc entry 'power' only if C2 or C3 is supported Mark Lord
2008-01-09 22:21         ` [PATCH] ACPI: Add sysfs interface for acpi device wakeup Yi Yang
2008-01-10  7:43           ` Maxim Levitsky
2008-01-09 23:59             ` Yi Yang
2008-01-10 10:30               ` Matthew Garrett
2008-01-13 18:16               ` Pavel Machek
2008-01-11  8:16             ` Zhang Rui
2008-01-10 23:55               ` Yi Yang
2008-03-19 13:06                 ` Thomas Renninger
2008-03-19 14:37                   ` Yi Yang
2008-03-20  4:32                     ` Zhao Yakui
2008-03-19 18:52                   ` David Brownell
2008-03-20  5:12                     ` Zhao Yakui
2008-03-20  6:12                       ` David Brownell

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=1201135532.3969.3.camel@yangyi-dev.bj.intel.com \
    --to=yi.y.yang@intel.com \
    --cc=acpi-bugzilla@lists.sourceforge.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] ACPI: create proc entry '\''power'\'' only if C2 or C3 is supported' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).