Commit caf866a0 authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] Make the bm_activity depend on "jiffies", instead of numbers

of the check being called. This means bus mastering activity
is assumed if bm_check isn't called; and multiple calls during
one jiffy will be |='ed.
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 362aeea4
......@@ -193,8 +193,18 @@ static void acpi_processor_idle (void)
*/
if (pr->flags.bm_check) {
u32 bm_status = 0;
unsigned long diff = jiffies - pr->power.bm_check_timestamp;
if (diff > 32)
diff = 32;
while (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,
&bm_status, ACPI_MTX_DO_NOT_LOCK);
......@@ -213,6 +223,9 @@ static void acpi_processor_idle (void)
|| (inb_p(errata.piix4.bmisx + 0x0A) & 0x01))
pr->power.bm_activity++;
}
pr->power.bm_check_timestamp = jiffies;
/*
* Apply bus mastering demotion policy. Automatically demote
* to avoid a faulty transition. Note that the processor
......
......@@ -54,6 +54,7 @@ struct acpi_processor_cx {
struct acpi_processor_power {
struct acpi_processor_cx *state;
unsigned long bm_check_timestamp;
u32 default_state;
u32 bm_activity;
int count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment