Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=275bc6b7f6429afb8d7a883c2e267547dd899066
Commit:     275bc6b7f6429afb8d7a883c2e267547dd899066
Parent:     ce243823af4fee3ab82e1da6b710fbc5f859ad8c
Author:     RafaƂ Bilski <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 5 22:08:50 2007 +0200
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Wed Jun 6 17:22:17 2007 -0400

    [CPUFREQ] Longhaul - Replace ACPI functions with direct I/O
    
    Current version of "bm status" bit test works as long as
    no USB device is in use. When USB device is plugged in ACPI
    function in this context is always returning 1. Until reboot.
    Direct I/O is working fine even when many USB devices are
    connected.
    Change bm_timeout value to less annoying. 1000 is still much
    more then worst case observed and it is much better when status
    bit gets stuck.
    
    Signed-off-by: Rafal Bilski <[EMAIL PROTECTED]>
    Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 arch/i386/kernel/cpu/cpufreq/longhaul.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c 
b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index dde4e31..2841735 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -69,6 +69,7 @@ static unsigned int minmult, maxmult;
 static int can_scale_voltage;
 static struct acpi_processor *pr = NULL;
 static struct acpi_processor_cx *cx = NULL;
+static u32 acpi_regs_addr;
 static u8 longhaul_flags;
 static unsigned int longhaul_index;
 
@@ -247,7 +248,7 @@ static void longhaul_setstate(unsigned int table_index)
        unsigned long flags;
        unsigned int pic1_mask, pic2_mask;
        u32 bm_status = 0;
-       u32 bm_timeout = 100000;
+       u32 bm_timeout = 1000;
        unsigned int dir = 0;
 
        clock_ratio_index = longhaul_table[table_index].index;
@@ -282,12 +283,13 @@ static void longhaul_setstate(unsigned int table_index)
        /* Wait while PCI bus is busy. */
        if (longhaul_flags & USE_NORTHBRIDGE
            || ((pr != NULL) && pr->flags.bm_control)) {
-               acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
+               bm_status = inl(acpi_regs_addr);
+               bm_status &= 1 << 4;
                while (bm_status && bm_timeout) {
-                       acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
+                       outl(1 << 4, acpi_regs_addr);
                        bm_timeout--;
-                       acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS,
-                                         &bm_status);
+                       bm_status = inl(acpi_regs_addr);
+                       bm_status &= 1 << 4;
                }
        }
 
@@ -344,8 +346,7 @@ static void longhaul_setstate(unsigned int table_index)
        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        if (!bm_timeout)
-               printk(KERN_INFO PFX "Warning: Timeout while waiting for "
-                       "idle PCI bus.\n");
+               printk(KERN_INFO PFX "Warning: Timeout while waiting for idle 
PCI bus.\n");
 }
 
 /*
@@ -713,6 +714,14 @@ static int longhaul_setup_southbridge(void)
                pci_read_config_byte(dev, 0xe5, &pci_cmd);
                pci_cmd |= 1 << 7;
                pci_write_config_byte(dev, 0xe5, pci_cmd);
+               /* Get address of ACPI registers block*/
+               pci_read_config_byte(dev, 0x81, &pci_cmd);
+               if (pci_cmd & 1 << 7) {
+                       pci_read_config_dword(dev, 0x88, &acpi_regs_addr);
+                       acpi_regs_addr &= 0xff00;
+                       printk(KERN_INFO PFX "ACPI I/O at 0x%x\n", 
acpi_regs_addr);
+               }
+
                pci_dev_put(dev);
                return 1;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to