Re: [PATCH] nvme-pci: Prevent mmio reads if pci channel offline

From: Austin.Bolen
Date: Thu Feb 28 2019 - 18:43:54 EST


On 2/28/2019 5:20 PM, Keith Busch wrote:
>
> [EXTERNAL EMAIL]
>
> On Thu, Feb 28, 2019 at 11:10:11PM +0000, Austin.Bolen@xxxxxxxx wrote:
>> I'd also note that in PCIe, things that intentionally take the link down
>> like SBR or Link Disable suppress surprise down error reporting. But
>> NSSR doesn't have this requirement to suppress surprise down reporting.
>> I think that's a gap on the part of the NVMe spec.
>
> SBR and Link Disable are done from the down stream port, though, so the
> host can still communicate with the function that took the link down.
> That's entirely different than taking the link down from the end device,
> so I'm not sure how NVMe can fix that.
>

Agreed it is different. Here is one way they could have solved it: host
writes magic value to NSSRC but device latches this instead of
resetting. Then require host to do SBR. When device sees SBR with
magic value in NSSRC it does an NSSR.

> But I can't even recall why NVMe defined NSSR to require PCIe LTSSM
> Detect. That seems entirely unnecessary and is just asking for trouble.
>

Not sure why but maybe they wanted a full reset of everything including
the PCIe block. I can ask around. Also agree it is asking for trouble
to have device take the link down without parent bridge knowing what's
going on. There are new mechanism being proposed in NVMe that would
also allow the device to initiate link down with no co-ordination with
the parent bridge so may need to think on ways to avoid this issue for
these new similar mechanisms.

-Austin