PCI: Tune secondary bus reset timing
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 8 Aug 2013 20:10:13 +0000 (14:10 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 14 Aug 2013 21:25:17 +0000 (15:25 -0600)
commitde0c548c33429cc78fd47a3c190c6d00b0e4e441
tree0c9fef4deaee4cb6195d5c1e6dd5e4d4c779e98c
parenta6cbaadea0af9b4aa6eee2882f2aa761ab91a4f8
PCI: Tune secondary bus reset timing

The PCI spec indicates that with stable power, reset needs to be
asserted for a minimum of 1ms (Trst).  We should be able to assume
stable power for a Hot Reset, but we add another millisecond as
a fudge factor to make sure the reset is seen on the bus for at least
a full 1ms.

After reset is de-asserted we must wait for devices to complete
initialization.  The specs refer to this as "recovery time" (Trhfa).
For PCI this is 2^25 clock cycles or 2^26 for PCI-X.  For minimum
bus speeds, both of those come to 1s.  PCIe "softens" this
requirement with the Configuration Request Retry Status (CRS)
completion status.  Theoretically we could use CRS to shorten the
wait time.  We don't make use of that here, using a fixed 1s delay
to allow devices to re-initialize.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c