PCI: revert "pcie: utilize pcie transaction pending bit"

Revert as it is reported to cause problems for people.

commit 4348a2dc49f9baecd34a9b0904245488c6189398
Author: Shaohua Li <shaohua.li@intel.com>
Date: Wed Oct 24 10:45:08 2007 +0800

pcie: utilize pcie transaction pending bit

PCIE has a mechanism to wait for Non-Posted request to complete. I think
pci_disable_device is a good place to do this.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Due to the regression reported at
http://bugzilla.kernel.org/show_bug.cgi?id=10065

Cc: Shaohua Li <shaohua.li@intel.com>
Cc: Soeren Sonnenburg <kernel@nn7.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Andrew Morton and committed by Greg Kroah-Hartman 49741c4d 8a443df4

-25
-21
drivers/pci/pci.c
··· 314 } 315 EXPORT_SYMBOL_GPL(pci_find_ht_capability); 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, &reg16); 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 /** 336 * pci_find_parent_resource - return resource region of parent bus of given region 337 * @dev: PCI device structure contains resources to be searched ··· 917 918 if (atomic_sub_return(1, &dev->enable_cnt) != 0) 919 return; 920 - 921 - /* Wait for all transactions are finished before disabling the device */ 922 - pcie_wait_pending_transaction(dev); 923 924 pci_read_config_word(dev, PCI_COMMAND, &pci_command); 925 if (pci_command & PCI_COMMAND_MASTER) {
··· 314 } 315 EXPORT_SYMBOL_GPL(pci_find_ht_capability); 316 317 /** 318 * pci_find_parent_resource - return resource region of parent bus of given region 319 * @dev: PCI device structure contains resources to be searched ··· 935 936 if (atomic_sub_return(1, &dev->enable_cnt) != 0) 937 return; 938 939 pci_read_config_word(dev, PCI_COMMAND, &pci_command); 940 if (pci_command & PCI_COMMAND_MASTER) {
-4
include/linux/pci.h
··· 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); 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); 518 519 struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, ··· 882 { 883 return 0; 884 } 885 - 886 - static inline void pcie_wait_pending_transaction(struct pci_dev *dev) 887 - { } 888 889 /* Power management related routines */ 890 static inline int pci_save_state(struct pci_dev *dev)
··· 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); 515 int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 516 struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 517 518 struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, ··· 883 { 884 return 0; 885 } 886 887 /* Power management related routines */ 888 static inline int pci_save_state(struct pci_dev *dev)