Re: [PATCH] Cleanup of i7300_idle based on review comments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Cleanup of i7300 idle driver based on review comments from Randy Dunlap,
Andi Kleen and Len Brown.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>

---
 drivers/idle/Kconfig      |   11 ++++++-----
 drivers/idle/i7300_idle.c |   33 ++++++++++++++++++---------------
 2 files changed, 24 insertions(+), 20 deletions(-)

Index: linux-acpi-2.6/drivers/idle/Kconfig
===================================================================
--- linux-acpi-2.6.orig/drivers/idle/Kconfig	2008-10-22 11:43:08.000000000 -0700
+++ linux-acpi-2.6/drivers/idle/Kconfig	2008-10-22 11:43:37.000000000 -0700
@@ -5,12 +5,13 @@ config I7300_IDLE_IOAT_CHANNEL
 	bool
 
 config I7300_IDLE
-	tristate "Intel chipset idle power saving driver"
+	tristate "Intel chipset idle memory power saving driver"
 	select I7300_IDLE_IOAT_CHANNEL
-	depends on X86_64
+	depends on X86_64 && EXPERIMENTAL
 	help
-	  Enable idle power savings with certain Intel server chipsets.
-	  The chipset must have I/O AT support, such as the Intel 7300.
-	  The power savings depends on the type and quantity of DRAM devices.
+	  Enable memory power savings when idle with certain Intel server
+	  chipsets. The chipset must have I/O AT support, such as the
+	  Intel 7300. The power savings depends on the type and quantity of
+	  DRAM devices.
 
 endmenu
Index: linux-acpi-2.6/drivers/idle/i7300_idle.c
===================================================================
--- linux-acpi-2.6.orig/drivers/idle/i7300_idle.c	2008-10-22 11:43:08.000000000 -0700
+++ linux-acpi-2.6/drivers/idle/i7300_idle.c	2008-10-22 11:43:37.000000000 -0700
@@ -35,6 +35,8 @@
 #define I7300_IDLE_DRIVER_VERSION	"1.55"
 #define I7300_PRINT			"i7300_idle:"
 
+#define MAX_STOP_RETRIES	10
+
 static int debug;
 module_param_named(debug, debug, uint, 0644);
 MODULE_PARM_DESC(debug, "Enable debug printks in this driver");
@@ -47,12 +49,12 @@ MODULE_PARM_DESC(debug, "Enable debug pr
  *  0 = No throttling
  *  1 = Throttle when > 4 activations per eval window (Maximum throttling)
  *  2 = Throttle when > 8 activations
- *  168 = Throttle when > 168 activations (Minimum throttling)
+ *  168 = Throttle when > 672 activations (Minimum throttling)
  */
-#define MAX_THRTLWLIMIT		168
-static uint i7300_idle_thrtlowlm = 1;
-module_param_named(thrtlwlimit, i7300_idle_thrtlowlm, uint, 0644);
-MODULE_PARM_DESC(thrtlwlimit,
+#define MAX_THROTTLE_LOW_LIMIT		168
+static uint throttle_low_limit = 1;
+module_param_named(throttle_low_limit, throttle_low_limit, uint, 0644);
+MODULE_PARM_DESC(throttle_low_limit,
 		"Value for THRTLOWLM activation field "
 		"(0 = disable throttle, 1 = Max throttle, 168 = Min throttle)");
 
@@ -111,9 +113,9 @@ static int i7300_idle_ioat_start(void)
 static void i7300_idle_ioat_stop(void)
 {
 	int i;
-	u8 sts;
+	u64 sts;
 
-	for (i = 0; i < 5; i++) {
+	for (i = 0; i < MAX_STOP_RETRIES; i++) {
 		writeb(IOAT_CHANCMD_RESET,
 			ioat_chanbase + IOAT1_CHANCMD_OFFSET);
 
@@ -127,9 +129,10 @@ static void i7300_idle_ioat_stop(void)
 
 	}
 
-	if (i == 5)
-		dprintk("failed to suspend+reset I/O AT after 5 retries\n");
-
+	if (i == MAX_STOP_RETRIES) {
+		dprintk("failed to stop I/O AT after %d retries\n",
+			MAX_STOP_RETRIES);
+	}
 }
 
 /* Test I/O AT by copying 1024 byte from 2k to 1k */
@@ -276,7 +279,7 @@ static void __exit i7300_idle_ioat_exit(
 	i7300_idle_ioat_stop();
 
 	/* Wait for a while for the channel to halt before releasing */
-	for (i = 0; i < 10; i++) {
+	for (i = 0; i < MAX_STOP_RETRIES; i++) {
 		writeb(IOAT_CHANCMD_RESET,
 		       ioat_chanbase + IOAT1_CHANCMD_OFFSET);
 
@@ -390,9 +393,9 @@ static void i7300_idle_start(void)
 	new_ctl = i7300_idle_thrtctl_saved & ~DIMM_THRTCTL_THRMHUNT;
 	pci_write_config_byte(fbd_dev, DIMM_THRTCTL, new_ctl);
 
-	limit = i7300_idle_thrtlowlm;
-	if (unlikely(limit > MAX_THRTLWLIMIT))
-		limit = MAX_THRTLWLIMIT;
+	limit = throttle_low_limit;
+	if (unlikely(limit > MAX_THROTTLE_LOW_LIMIT))
+		limit = MAX_THROTTLE_LOW_LIMIT;
 
 	pci_write_config_byte(fbd_dev, DIMM_THRTLOW, limit);
 
@@ -441,7 +444,7 @@ static int i7300_idle_notifier(struct no
 	static ktime_t idle_begin_time;
 	static int time_init = 1;
 
-	if (!i7300_idle_thrtlowlm)
+	if (!throttle_low_limit)
 		return 0;
 
 	if (unlikely(time_init)) {
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux