diff options
| -rw-r--r-- | drivers/pci/pci.c | 21 | ||||
| -rw-r--r-- | include/linux/pci.h | 4 |
2 files changed, 0 insertions, 25 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 183fddaa38b7..a4445b7210bf 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -314,24 +314,6 @@ int pci_find_ht_capability(struct pci_dev *dev, int ht_cap) | |||
| 314 | } | 314 | } |
| 315 | EXPORT_SYMBOL_GPL(pci_find_ht_capability); | 315 | EXPORT_SYMBOL_GPL(pci_find_ht_capability); |
| 316 | 316 | ||
| 317 | void pcie_wait_pending_transaction(struct pci_dev *dev) | ||
| 318 | { | ||
| 319 | int pos; | ||
| 320 | u16 reg16; | ||
| 321 | |||
| 322 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | ||
| 323 | if (!pos) | ||
| 324 | return; | ||
| 325 | while (1) { | ||
| 326 | pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, ®16); | ||
| 327 | if (!(reg16 & PCI_EXP_DEVSTA_TRPND)) | ||
| 328 | break; | ||
| 329 | cpu_relax(); | ||
| 330 | } | ||
| 331 | |||
| 332 | } | ||
| 333 | EXPORT_SYMBOL_GPL(pcie_wait_pending_transaction); | ||
| 334 | |||
| 335 | /** | 317 | /** |
| 336 | * pci_find_parent_resource - return resource region of parent bus of given region | 318 | * pci_find_parent_resource - return resource region of parent bus of given region |
| 337 | * @dev: PCI device structure contains resources to be searched | 319 | * @dev: PCI device structure contains resources to be searched |
| @@ -936,9 +918,6 @@ pci_disable_device(struct pci_dev *dev) | |||
| 936 | if (atomic_sub_return(1, &dev->enable_cnt) != 0) | 918 | if (atomic_sub_return(1, &dev->enable_cnt) != 0) |
| 937 | return; | 919 | return; |
| 938 | 920 | ||
| 939 | /* Wait for all transactions are finished before disabling the device */ | ||
| 940 | pcie_wait_pending_transaction(dev); | ||
| 941 | |||
| 942 | pci_read_config_word(dev, PCI_COMMAND, &pci_command); | 921 | pci_read_config_word(dev, PCI_COMMAND, &pci_command); |
| 943 | if (pci_command & PCI_COMMAND_MASTER) { | 922 | if (pci_command & PCI_COMMAND_MASTER) { |
| 944 | pci_command &= ~PCI_COMMAND_MASTER; | 923 | pci_command &= ~PCI_COMMAND_MASTER; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index b7e4b633c69b..ea760e519c46 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -513,7 +513,6 @@ int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); | |||
| 513 | int pci_find_ext_capability(struct pci_dev *dev, int cap); | 513 | int pci_find_ext_capability(struct pci_dev *dev, int cap); |
| 514 | int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); | 514 | int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); |
| 515 | int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); | 515 | int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); |
| 516 | void pcie_wait_pending_transaction(struct pci_dev *dev); | ||
| 517 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); | 516 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); |
| 518 | 517 | ||
| 519 | struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, | 518 | struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, |
| @@ -884,9 +883,6 @@ static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) | |||
| 884 | return 0; | 883 | return 0; |
| 885 | } | 884 | } |
| 886 | 885 | ||
| 887 | static inline void pcie_wait_pending_transaction(struct pci_dev *dev) | ||
| 888 | { } | ||
| 889 | |||
| 890 | /* Power management related routines */ | 886 | /* Power management related routines */ |
| 891 | static inline int pci_save_state(struct pci_dev *dev) | 887 | static inline int pci_save_state(struct pci_dev *dev) |
| 892 | { | 888 | { |
