Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-mmc
[powerpc.git] / drivers / acpi / processor_idle.c
index af9f2af..7106606 100644 (file)
@@ -97,6 +97,9 @@ static int set_max_cstate(struct dmi_system_id *id)
 /* Actually this shouldn't be __cpuinitdata, would be better to fix the
    callers to only run once -AK */
 static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
+       { set_max_cstate, "IBM ThinkPad R40e", {
+         DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+         DMI_MATCH(DMI_BIOS_VERSION,"1SET70WW")}, (void *)1},
        { set_max_cstate, "IBM ThinkPad R40e", {
          DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
          DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW")}, (void *)1},
@@ -287,10 +290,10 @@ static void acpi_processor_idle(void)
                pr->power.bm_check_timestamp = jiffies;
 
                /*
-                * Apply bus mastering demotion policy.  Automatically demote
+                * If bus mastering is or was active this jiffy, demote
                 * to avoid a faulty transition.  Note that the processor
                 * won't enter a low-power state during this call (to this
-                * funciton) but should upon the next.
+                * function) but should upon the next.
                 *
                 * TBD: A better policy might be to fallback to the demotion
                 *      state (use it for this quantum only) istead of
@@ -298,7 +301,8 @@ static void acpi_processor_idle(void)
                 *      qualification.  This may, however, introduce DMA
                 *      issues (e.g. floppy DMA transfer overrun/underrun).
                 */
-               if (pr->power.bm_activity & cx->demotion.threshold.bm) {
+               if ((pr->power.bm_activity & 0x1) &&
+                   cx->demotion.threshold.bm) {
                        local_irq_enable();
                        next_state = cx->demotion.state;
                        goto end;
@@ -357,7 +361,9 @@ static void acpi_processor_idle(void)
                t1 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Invoke C2 */
                inb(cx->address);
-               /* Dummy op - must do something useless after P_LVL2 read */
+               /* Dummy wait op - must do something useless after P_LVL2 read
+                  because chipsets cannot guarantee that STPCLK# signal
+                  gets asserted in time to freeze execution properly. */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Get end time (ticks) */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
@@ -395,7 +401,7 @@ static void acpi_processor_idle(void)
                t1 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Invoke C3 */
                inb(cx->address);
-               /* Dummy op - must do something useless after P_LVL3 read */
+               /* Dummy wait op (see above) */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Get end time (ticks) */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
@@ -762,7 +768,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
                status = -EFAULT;
 
       end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
        return status;
 }
@@ -1064,7 +1070,7 @@ static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
                           PDE(inode)->data);
 }
 
-static struct file_operations acpi_processor_power_fops = {
+static const struct file_operations acpi_processor_power_fops = {
        .open = acpi_processor_power_open_fs,
        .read = seq_read,
        .llseek = seq_lseek,