X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fpci%2Fpci.c;h=e4548ab2a93c1d148f8100262671a6ad4a04f52a;hb=babd90b274e6b43a7dc7bb08562bf566cbabdbf8;hp=183fddaa38b74e5854e386c18266b81814eaa5b9;hpb=f8303dd3db57bd7ab2062985ad7a9e898a8ac423;p=linux-2.6 diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 183fddaa38..e4548ab2a9 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -18,6 +18,7 @@ #include #include #include +#include #include /* isa_dma_bridge_buggy */ #include "pci.h" @@ -314,24 +315,6 @@ int pci_find_ht_capability(struct pci_dev *dev, int ht_cap) } EXPORT_SYMBOL_GPL(pci_find_ht_capability); -void pcie_wait_pending_transaction(struct pci_dev *dev) -{ - int pos; - u16 reg16; - - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); - if (!pos) - return; - while (1) { - pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, ®16); - if (!(reg16 & PCI_EXP_DEVSTA_TRPND)) - break; - cpu_relax(); - } - -} -EXPORT_SYMBOL_GPL(pcie_wait_pending_transaction); - /** * pci_find_parent_resource - return resource region of parent bus of given region * @dev: PCI device structure contains resources to be searched @@ -442,7 +425,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) */ if (state != PCI_D0 && dev->current_state > state) { printk(KERN_ERR "%s(): %s: state=%d, current state=%d\n", - __FUNCTION__, pci_name(dev), state, dev->current_state); + __func__, pci_name(dev), state, dev->current_state); return -EINVAL; } else if (dev->current_state == state) return 0; /* we're already there */ @@ -519,6 +502,9 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) if (need_restore) pci_restore_bars(dev); + if (dev->bus->self) + pcie_aspm_pm_state_change(dev->bus->self); + return 0; } @@ -936,9 +922,6 @@ pci_disable_device(struct pci_dev *dev) if (atomic_sub_return(1, &dev->enable_cnt) != 0) return; - /* Wait for all transactions are finished before disabling the device */ - pcie_wait_pending_transaction(dev); - pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER;