From: Bjorn Helgaas Date: Fri, 14 Sep 2012 18:08:40 +0000 (-0600) Subject: Merge branch 'pci/tejun-workqueue' into next X-Git-Tag: next-20120917~92^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8693c9dea0d0ee875644cbb66a13768a56b69685;p=karo-tx-linux.git Merge branch 'pci/tejun-workqueue' into next * pci/tejun-workqueue: PCI: Rewrite pci_call_probe() to use workqueue instead of work_on_cpu() Conflicts: drivers/pci/pci-driver.c --- 8693c9dea0d0ee875644cbb66a13768a56b69685 diff --cc drivers/pci/pci-driver.c index d6fd6b6d9d4b,0be142844cee..8f87ea085a9f --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@@ -274,18 -274,17 +274,21 @@@ struct drv_dev_and_id struct pci_driver *drv; struct pci_dev *dev; const struct pci_device_id *id; + struct work_struct work; + int error; }; - static long local_pci_probe(void *_ddi) + static void pci_probe_fn(struct work_struct *work) { - struct drv_dev_and_id *ddi = _ddi; + struct drv_dev_and_id *ddi = container_of(work, struct drv_dev_and_id, + work); struct device *dev = &ddi->dev->dev; + struct device *parent = dev->parent; int rc; + /* The parent bridge must be in active state when probing */ + if (parent) + pm_runtime_get_sync(parent); /* Unbound PCI devices are always set to disabled and suspended. * During probe, the device is set to enabled and active and the * usage count is incremented. If the driver supports runtime PM, @@@ -302,9 -301,8 +305,10 @@@ pm_runtime_set_suspended(dev); pm_runtime_put_noidle(dev); } + if (parent) + pm_runtime_put(parent); - return rc; + + ddi->error = rc; } static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,