]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/pci-driver.c
Suspend/Resume bug in PCI layer wrt quirks
[linux-2.6-omap-h63xx.git] / drivers / pci / pci-driver.c
index e571c72e67531017f140ee6e323e89644f7320b0..677fd9d6db1228e16cdcc5072842463e5a0d8254 100644 (file)
@@ -182,15 +182,18 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
        struct mempolicy *oldpol;
        cpumask_t oldmask = current->cpus_allowed;
        int node = pcibus_to_node(dev->bus);
-       if (node >= 0 && node_online(node))
-           set_cpus_allowed(current, node_to_cpumask(node));
+
+       if (node >= 0) {
+               node_to_cpumask_ptr(nodecpumask, node);
+               set_cpus_allowed_ptr(current, nodecpumask);
+       }
        /* And set default memory allocation policy */
        oldpol = current->mempolicy;
        current->mempolicy = NULL;      /* fall back to system default policy */
 #endif
        error = drv->probe(dev, id);
 #ifdef CONFIG_NUMA
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, &oldmask);
        current->mempolicy = oldpol;
 #endif
        return error;
@@ -289,6 +292,9 @@ static int pci_device_suspend(struct device * dev, pm_message_t state)
                if (pci_dev->current_state == PCI_D0)
                        pci_dev->current_state = PCI_UNKNOWN;
        }
+
+       pci_fixup_device(pci_fixup_suspend, pci_dev);
+
        return i;
 }
 
@@ -334,6 +340,7 @@ static int pci_device_resume(struct device * dev)
                error = drv->resume(pci_dev);
        else
                error = pci_default_resume(pci_dev);
+       pci_fixup_device(pci_fixup_resume, pci_dev);
        return error;
 }
 
@@ -343,7 +350,7 @@ static int pci_device_resume_early(struct device * dev)
        struct pci_dev * pci_dev = to_pci_dev(dev);
        struct pci_driver * drv = pci_dev->driver;
 
-       pci_fixup_device(pci_fixup_resume, pci_dev);
+       pci_fixup_device(pci_fixup_resume_early, pci_dev);
 
        if (drv && drv->resume_early)
                error = drv->resume_early(pci_dev);
@@ -357,6 +364,8 @@ static void pci_device_shutdown(struct device *dev)
 
        if (drv && drv->shutdown)
                drv->shutdown(pci_dev);
+       pci_msi_shutdown(pci_dev);
+       pci_msix_shutdown(pci_dev);
 }
 
 /**