Merge branches 'bugzilla-13121+', 'bugzilla-13233', 'redhat-bugzilla-500311', 'pci...
authorLen Brown <len.brown@intel.com>
Sat, 30 May 2009 01:30:01 +0000 (21:30 -0400)
committerLen Brown <len.brown@intel.com>
Sat, 30 May 2009 01:30:01 +0000 (21:30 -0400)
drivers/acpi/pci_bind.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/video.c
drivers/dma/ioat_dma.c
drivers/idle/i7300_idle.c
include/linux/i7300_idle.h

index 95650f8..bc46de3 100644 (file)
@@ -116,9 +116,6 @@ int acpi_pci_bind(struct acpi_device *device)
        struct acpi_pci_data *pdata;
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        acpi_handle handle;
-       struct pci_dev *dev;
-       struct pci_bus *bus;
-
 
        if (!device || !device->parent)
                return -EINVAL;
@@ -176,20 +173,9 @@ int acpi_pci_bind(struct acpi_device *device)
         * Locate matching device in PCI namespace.  If it doesn't exist
         * this typically means that the device isn't currently inserted
         * (e.g. docking station, port replicator, etc.).
-        * We cannot simply search the global pci device list, since
-        * PCI devices are added to the global pci list when the root
-        * bridge start ops are run, which may not have happened yet.
         */
-       bus = pci_find_bus(data->id.segment, data->id.bus);
-       if (bus) {
-               list_for_each_entry(dev, &bus->devices, bus_list) {
-                       if (dev->devfn == PCI_DEVFN(data->id.device,
-                                                   data->id.function)) {
-                               data->dev = dev;
-                               break;
-                       }
-               }
-       }
+       data->dev = pci_get_slot(pdata->bus,
+                               PCI_DEVFN(data->id.device, data->id.function));
        if (!data->dev) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Device %04x:%02x:%02x.%d not present in PCI namespace\n",
@@ -259,9 +245,10 @@ int acpi_pci_bind(struct acpi_device *device)
 
       end:
        kfree(buffer.pointer);
-       if (result)
+       if (result) {
+               pci_dev_put(data->dev);
                kfree(data);
-
+       }
        return result;
 }
 
@@ -303,6 +290,7 @@ static int acpi_pci_unbind(struct acpi_device *device)
        if (data->dev->subordinate) {
                acpi_pci_irq_del_prt(data->id.segment, data->bus->number);
        }
+       pci_dev_put(data->dev);
        kfree(data);
 
       end:
index 72069ba..10a2d91 100644 (file)
@@ -148,6 +148,9 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
        if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT))
                return;
 
+       if (boot_cpu_has(X86_FEATURE_AMDC1E))
+               type = ACPI_STATE_C1;
+
        /*
         * Check, if one of the previous states already marked the lapic
         * unstable
@@ -611,6 +614,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
                switch (cx->type) {
                case ACPI_STATE_C1:
                        cx->valid = 1;
+                       acpi_timer_check_state(i, pr, cx);
                        break;
 
                case ACPI_STATE_C2:
@@ -830,11 +834,12 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
 
        /* Do not access any ACPI IO ports in suspend path */
        if (acpi_idle_suspend) {
-               acpi_safe_halt();
                local_irq_enable();
+               cpu_relax();
                return 0;
        }
 
+       acpi_state_timer_broadcast(pr, cx, 1);
        kt1 = ktime_get_real();
        acpi_idle_do_entry(cx);
        kt2 = ktime_get_real();
@@ -842,6 +847,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
 
        local_irq_enable();
        cx->usage++;
+       acpi_state_timer_broadcast(pr, cx, 0);
 
        return idle_time;
 }
index cafb410..60e543d 100644 (file)
@@ -309,9 +309,15 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
                                  (u32) px->bus_master_latency,
                                  (u32) px->control, (u32) px->status));
 
-               if (!px->core_frequency) {
-                       printk(KERN_ERR PREFIX
-                                   "Invalid _PSS data: freq is zero\n");
+               /*
+                * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq
+                */
+               if (!px->core_frequency ||
+                   ((u32)(px->core_frequency * 1000) !=
+                    (px->core_frequency * 1000))) {
+                       printk(KERN_ERR FW_BUG PREFIX
+                              "Invalid BIOS _PSS frequency: 0x%llx MHz\n",
+                              px->core_frequency);
                        result = -EFAULT;
                        kfree(pr->performance->states);
                        goto end;
index a79b885..1bdfb37 100644 (file)
@@ -570,6 +570,22 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
                DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"),
                },
        },
+       {
+        .callback = video_set_bqc_offset,
+        .ident = "eMachines E510",
+        .matches = {
+               DMI_MATCH(DMI_BOARD_VENDOR, "EMACHINES"),
+               DMI_MATCH(DMI_PRODUCT_NAME, "eMachines E510"),
+               },
+       },
+       {
+        .callback = video_set_bqc_offset,
+        .ident = "Acer Aspire 5315",
+        .matches = {
+               DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
+               DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"),
+               },
+       },
        {}
 };
 
index 1955ee8..a600fc0 100644 (file)
@@ -173,7 +173,7 @@ static int ioat_dma_enumerate_channels(struct ioatdma_device *device)
        xfercap = (xfercap_scale == 0 ? -1 : (1UL << xfercap_scale));
 
 #ifdef  CONFIG_I7300_IDLE_IOAT_CHANNEL
-       if (i7300_idle_platform_probe(NULL, NULL) == 0) {
+       if (i7300_idle_platform_probe(NULL, NULL, 1) == 0) {
                device->common.chancnt--;
        }
 #endif
index bf74039..949c97f 100644 (file)
@@ -41,6 +41,10 @@ static int debug;
 module_param_named(debug, debug, uint, 0644);
 MODULE_PARM_DESC(debug, "Enable debug printks in this driver");
 
+static int forceload;
+module_param_named(forceload, forceload, uint, 0644);
+MODULE_PARM_DESC(debug, "Enable driver testing on unvalidated i5000");
+
 #define dprintk(fmt, arg...) \
        do { if (debug) printk(KERN_INFO I7300_PRINT fmt, ##arg); } while (0)
 
@@ -552,7 +556,7 @@ static int __init i7300_idle_init(void)
        cpus_clear(idle_cpumask);
        total_us = 0;
 
-       if (i7300_idle_platform_probe(&fbd_dev, &ioat_dev))
+       if (i7300_idle_platform_probe(&fbd_dev, &ioat_dev, forceload))
                return -ENODEV;
 
        if (i7300_idle_thrt_save())
index 05a80c4..1587b7d 100644 (file)
 struct fbd_ioat {
        unsigned int vendor;
        unsigned int ioat_dev;
+       unsigned int enabled;
 };
 
 /*
  * The i5000 chip-set has the same hooks as the i7300
- * but support is disabled by default because this driver
- * has not been validated on that platform.
+ * but it is not enabled by default and must be manually
+ * manually enabled with "forceload=1" because it is
+ * only lightly validated.
  */
-#define SUPPORT_I5000 0
 
 static const struct fbd_ioat fbd_ioat_list[] = {
-       {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB},
-#if SUPPORT_I5000
-       {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT},
-#endif
+       {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB, 1},
+       {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT, 0},
        {0, 0}
 };
 
 /* table of devices that work with this driver */
 static const struct pci_device_id pci_tbl[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) },
-#if SUPPORT_I5000
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
-#endif
        { } /* Terminating entry */
 };
 
 /* Check for known platforms with I/O-AT */
 static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
-                                               struct pci_dev **ioat_dev)
+                                               struct pci_dev **ioat_dev,
+                                               int enable_all)
 {
        int i;
        struct pci_dev *memdev, *dmadev;
@@ -69,6 +67,8 @@ static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
        for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
                if (dmadev->vendor == fbd_ioat_list[i].vendor &&
                    dmadev->device == fbd_ioat_list[i].ioat_dev) {
+                       if (!(fbd_ioat_list[i].enabled || enable_all))
+                               continue;
                        if (fbd_dev)
                                *fbd_dev = memdev;
                        if (ioat_dev)