ACPI: C-States: bm_activity improvements
Do not assume there was bus mastering activity if the idle handler didn't get called, as there's only reason to not enter C3-type sleep if there is bus master activity going on. Only for the "promotion" into C3-type sleep bus mastering activity is taken into account, and there only current bus mastering activity, and not pure guessing should lead to the decision on whether to enter C3-type sleep or not. Also, as bm_activity is a jiffy-based bitmask (bit 0: bus mastering activity during this juffy, bit 31: bus mastering activity 31 jiffies ago), fix the setting of bit 0, as it might be called multiple times within one jiffy. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
committed by
Len Brown
parent
a3c6598f92
commit
c5ab81ca01
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
|
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
|
||||||
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
|
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
|
||||||
* Copyright (C) 2004 Dominik Brodowski <linux@brodo.de>
|
* Copyright (C) 2004, 2005 Dominik Brodowski <linux@brodo.de>
|
||||||
* Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
|
* Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
|
||||||
* - Added processor hotplug support
|
* - Added processor hotplug support
|
||||||
* Copyright (C) 2005 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
|
* Copyright (C) 2005 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
|
||||||
@@ -261,21 +261,15 @@ static void acpi_processor_idle(void)
|
|||||||
u32 bm_status = 0;
|
u32 bm_status = 0;
|
||||||
unsigned long diff = jiffies - pr->power.bm_check_timestamp;
|
unsigned long diff = jiffies - pr->power.bm_check_timestamp;
|
||||||
|
|
||||||
if (diff > 32)
|
if (diff > 31)
|
||||||
diff = 32;
|
diff = 31;
|
||||||
|
|
||||||
while (diff) {
|
pr->power.bm_activity <<= diff;
|
||||||
/* if we didn't get called, assume there was busmaster activity */
|
|
||||||
diff--;
|
|
||||||
if (diff)
|
|
||||||
pr->power.bm_activity |= 0x1;
|
|
||||||
pr->power.bm_activity <<= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS,
|
acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS,
|
||||||
&bm_status, ACPI_MTX_DO_NOT_LOCK);
|
&bm_status, ACPI_MTX_DO_NOT_LOCK);
|
||||||
if (bm_status) {
|
if (bm_status) {
|
||||||
pr->power.bm_activity++;
|
pr->power.bm_activity |= 0x1;
|
||||||
acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS,
|
acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS,
|
||||||
1, ACPI_MTX_DO_NOT_LOCK);
|
1, ACPI_MTX_DO_NOT_LOCK);
|
||||||
}
|
}
|
||||||
@@ -287,7 +281,7 @@ static void acpi_processor_idle(void)
|
|||||||
else if (errata.piix4.bmisx) {
|
else if (errata.piix4.bmisx) {
|
||||||
if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01)
|
if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01)
|
||||||
|| (inb_p(errata.piix4.bmisx + 0x0A) & 0x01))
|
|| (inb_p(errata.piix4.bmisx + 0x0A) & 0x01))
|
||||||
pr->power.bm_activity++;
|
pr->power.bm_activity |= 0x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr->power.bm_check_timestamp = jiffies;
|
pr->power.bm_check_timestamp = jiffies;
|
||||||
|
Reference in New Issue
Block a user