Re: [PATCH V8 1/2] PCI: handle CRS returned by device after FLR

2017-08-08 Thread Sinan Kaya
On 8/8/2017 5:19 PM, Bjorn Helgaas wrote: > On Sun, Aug 06, 2017 at 10:09:51PM -0400, Sinan Kaya wrote: > > We should include some high-level description of the problem we're > trying to solve here. > > I *think* the problem is that we do something like this: > > - perform an FLR > - sleep

Re: [PATCH V8 1/2] PCI: handle CRS returned by device after FLR

2017-08-08 Thread Sinan Kaya
On 8/8/2017 5:19 PM, Bjorn Helgaas wrote: > On Sun, Aug 06, 2017 at 10:09:51PM -0400, Sinan Kaya wrote: > > We should include some high-level description of the problem we're > trying to solve here. > > I *think* the problem is that we do something like this: > > - perform an FLR > - sleep

Re: [PATCH V8 1/2] PCI: handle CRS returned by device after FLR

2017-08-08 Thread Bjorn Helgaas
On Sun, Aug 06, 2017 at 10:09:51PM -0400, Sinan Kaya wrote: We should include some high-level description of the problem we're trying to solve here. I *think* the problem is that we do something like this: - perform an FLR - sleep up to 1000ms total - read ~0 from PCI_COMMAND - warn

Re: [PATCH V8 1/2] PCI: handle CRS returned by device after FLR

2017-08-08 Thread Bjorn Helgaas
On Sun, Aug 06, 2017 at 10:09:51PM -0400, Sinan Kaya wrote: We should include some high-level description of the problem we're trying to solve here. I *think* the problem is that we do something like this: - perform an FLR - sleep up to 1000ms total - read ~0 from PCI_COMMAND - warn

Re: [PATCH V8 1/2] PCI: handle CRS returned by device after FLR

2017-08-06 Thread Sinan Kaya
On 8/6/2017 10:09 PM, Sinan Kaya wrote: > + pcie_capability_read_word(dev, PCI_EXP_RTCAP, _cap); > + if (root_cap & PCI_EXP_RTCAP_CRSVIS) { > + /* don't touch the HW before waiting 100ms */ > + msleep(100); This is obviously broken. I should have checked the

Re: [PATCH V8 1/2] PCI: handle CRS returned by device after FLR

2017-08-06 Thread Sinan Kaya
On 8/6/2017 10:09 PM, Sinan Kaya wrote: > + pcie_capability_read_word(dev, PCI_EXP_RTCAP, _cap); > + if (root_cap & PCI_EXP_RTCAP_CRSVIS) { > + /* don't touch the HW before waiting 100ms */ > + msleep(100); This is obviously broken. I should have checked the

[PATCH V8 1/2] PCI: handle CRS returned by device after FLR

2017-08-06 Thread Sinan Kaya
An endpoint is allowed to issue Configuration Request Retry Status (CRS) following a Function Level Reset (FLR) request to indicate that it is not ready to accept new requests. CRS is defined in PCIe r3.1, sec 2.3.1. Request Handling Rules and CRS usage in FLR context is mentioned in PCIe r3.1,

[PATCH V8 1/2] PCI: handle CRS returned by device after FLR

2017-08-06 Thread Sinan Kaya
An endpoint is allowed to issue Configuration Request Retry Status (CRS) following a Function Level Reset (FLR) request to indicate that it is not ready to accept new requests. CRS is defined in PCIe r3.1, sec 2.3.1. Request Handling Rules and CRS usage in FLR context is mentioned in PCIe r3.1,