diff options
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 77b493b3d97b..cb1dd5f4988c 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1583,8 +1583,10 @@ void pci_pm_init(struct pci_dev *dev) | |||
1583 | int pm; | 1583 | int pm; |
1584 | u16 pmc; | 1584 | u16 pmc; |
1585 | 1585 | ||
1586 | pm_runtime_forbid(&dev->dev); | ||
1586 | device_enable_async_suspend(&dev->dev); | 1587 | device_enable_async_suspend(&dev->dev); |
1587 | dev->wakeup_prepared = false; | 1588 | dev->wakeup_prepared = false; |
1589 | |||
1588 | dev->pm_cap = 0; | 1590 | dev->pm_cap = 0; |
1589 | 1591 | ||
1590 | /* find PCI PM capability in list */ | 1592 | /* find PCI PM capability in list */ |
@@ -2296,35 +2298,6 @@ void pci_msi_off(struct pci_dev *dev) | |||
2296 | } | 2298 | } |
2297 | } | 2299 | } |
2298 | 2300 | ||
2299 | #ifndef HAVE_ARCH_PCI_SET_DMA_MASK | ||
2300 | /* | ||
2301 | * These can be overridden by arch-specific implementations | ||
2302 | */ | ||
2303 | int | ||
2304 | pci_set_dma_mask(struct pci_dev *dev, u64 mask) | ||
2305 | { | ||
2306 | if (!pci_dma_supported(dev, mask)) | ||
2307 | return -EIO; | ||
2308 | |||
2309 | dev->dma_mask = mask; | ||
2310 | dev_dbg(&dev->dev, "using %dbit DMA mask\n", fls64(mask)); | ||
2311 | |||
2312 | return 0; | ||
2313 | } | ||
2314 | |||
2315 | int | ||
2316 | pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | ||
2317 | { | ||
2318 | if (!pci_dma_supported(dev, mask)) | ||
2319 | return -EIO; | ||
2320 | |||
2321 | dev->dev.coherent_dma_mask = mask; | ||
2322 | dev_dbg(&dev->dev, "using %dbit consistent DMA mask\n", fls64(mask)); | ||
2323 | |||
2324 | return 0; | ||
2325 | } | ||
2326 | #endif | ||
2327 | |||
2328 | #ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE | 2301 | #ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE |
2329 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size) | 2302 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size) |
2330 | { | 2303 | { |
@@ -2486,7 +2459,7 @@ static int pci_dev_reset(struct pci_dev *dev, int probe) | |||
2486 | if (!probe) { | 2459 | if (!probe) { |
2487 | pci_block_user_cfg_access(dev); | 2460 | pci_block_user_cfg_access(dev); |
2488 | /* block PM suspend, driver probe, etc. */ | 2461 | /* block PM suspend, driver probe, etc. */ |
2489 | down(&dev->dev.sem); | 2462 | device_lock(&dev->dev); |
2490 | } | 2463 | } |
2491 | 2464 | ||
2492 | rc = pci_dev_specific_reset(dev, probe); | 2465 | rc = pci_dev_specific_reset(dev, probe); |
@@ -2508,7 +2481,7 @@ static int pci_dev_reset(struct pci_dev *dev, int probe) | |||
2508 | rc = pci_parent_bus_reset(dev, probe); | 2481 | rc = pci_parent_bus_reset(dev, probe); |
2509 | done: | 2482 | done: |
2510 | if (!probe) { | 2483 | if (!probe) { |
2511 | up(&dev->dev.sem); | 2484 | device_unlock(&dev->dev); |
2512 | pci_unblock_user_cfg_access(dev); | 2485 | pci_unblock_user_cfg_access(dev); |
2513 | } | 2486 | } |
2514 | 2487 | ||
@@ -3066,8 +3039,6 @@ EXPORT_SYMBOL(pci_set_mwi); | |||
3066 | EXPORT_SYMBOL(pci_try_set_mwi); | 3039 | EXPORT_SYMBOL(pci_try_set_mwi); |
3067 | EXPORT_SYMBOL(pci_clear_mwi); | 3040 | EXPORT_SYMBOL(pci_clear_mwi); |
3068 | EXPORT_SYMBOL_GPL(pci_intx); | 3041 | EXPORT_SYMBOL_GPL(pci_intx); |
3069 | EXPORT_SYMBOL(pci_set_dma_mask); | ||
3070 | EXPORT_SYMBOL(pci_set_consistent_dma_mask); | ||
3071 | EXPORT_SYMBOL(pci_assign_resource); | 3042 | EXPORT_SYMBOL(pci_assign_resource); |
3072 | EXPORT_SYMBOL(pci_find_parent_resource); | 3043 | EXPORT_SYMBOL(pci_find_parent_resource); |
3073 | EXPORT_SYMBOL(pci_select_bars); | 3044 | EXPORT_SYMBOL(pci_select_bars); |