On 9/5/2018 9:49 AM, Bjorn Helgaas wrote:
pci_dev_wait() is connected with CRS. There's some reason that function doesn't actually looks for CRS responses, which I can't remember right now. But you can look it up in the changelogs.
We wanted to be able to support virtual functions (that can't read vendor id) as well as systems without CRS visibility support. That was the reason why we are polling a well known register such as command status against ~0 rather than the vendor id register.
So I don't think we should put the Immediate Readiness check in pci_dev_wait().
I agree, it should be outside of pci_dev_wait()