From: Yinghai Lu Date: Fri, 27 Jan 2012 18:55:11 +0000 (-0800) Subject: PCI: pciehp: replace unconditional sleep with config space access check X-Git-Tag: v3.4-rc1~114^2~55 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f5d8e4ff947ad6673397083b48719cd6c59cd61;p=pandora-kernel.git PCI: pciehp: replace unconditional sleep with config space access check During reviewing | PCI: pciehp: wait 1000 ms before Link Training check Linus said: >... > That's a *long* time, and it's irritating to the user. It makes the > user think "the machine is slow". >... > And quite frankly, an unconditional one-second delay here seems bad. >Two seconds was unacceptable, one second is just bad. Try to access the pci conf of a pci device that is supposed to show up in 1s. If we can read back a valid vendor/device id, we can return early. Related discussion could be found: https://lkml.org/lkml/2011/12/6/339 -v2: seperate code to pci_bus_read_dev_vendor_id() from pci_scan_device() and reuse it from pciehp code. Suggested by Matthew Wilcox. -v3: According to Kenj, don't use array in stack, and don't wait too long for crs, also return fail status if not found. Also separate pci_bus_dev_read_vendor_id() change to another patch. Signed-off-by: Yinghai Lu Signed-off-by: Jesse Barnes --- Reading git-diff-tree failed