Page MenuHomeFreeBSD

Put a workaround in for command timeout malfunctioning
ClosedPublic

Authored by imp on Oct 25 2018, 8:52 PM.

Details

Summary

At least one NVMe drive has a bug that makeing the Command Time Out
PCIe feature unreliable. The workaround is to disable this
feature. The driver wouldn't deal correctly with a timeout anyway.
Only do this for drives that are known bad.

Sponsored by: Netflix, Inc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

I think you mean "completion timeout", not "command timeout" - in both the commit message and some of the comments.

sys/dev/nvme/nvme.c
289 ↗(On Diff #49631)

DEVICE_CTL2 is 16 bits, not 32. This functionally still works, but I think a uint16_t would be more precise.

sys/dev/nvme/nvme_private.h
251 ↗(On Diff #49631)

Whitespace looks inconsistent in general with the line before it.

This revision now requires changes to proceed.Oct 25 2018, 9:30 PM
sys/dev/nvme/nvme_private.h
251 ↗(On Diff #49631)

This comment should probably say "PCIe completion timeout" instead of "transaction timeout".

imp marked 2 inline comments as done.Oct 25 2018, 10:33 PM
imp added inline comments.
sys/dev/nvme/nvme.c
289 ↗(On Diff #49631)

OK. I see that now. The vendor spec I got about this problem listed the upper 2 bytes as reserved anyway. The PCIe spec, however is clear that the next two bytes are for status (even though the spec defines it as MBZ).

sys/dev/nvme/nvme_private.h
251 ↗(On Diff #49631)

OK to both.

imp marked 4 inline comments as done.Oct 25 2018, 10:35 PM
imp added inline comments.
sys/dev/nvme/nvme_private.h
251 ↗(On Diff #49631)

I know that this looks misaligned, at least on my screen, but in an X term with fixed font they line up properly.

This revision is now accepted and ready to land.Oct 25 2018, 10:38 PM
This revision was automatically updated to reflect the committed changes.