NVMe: Time out initialisation after a few seconds

THe device reports (in its capability register) how long it will take
to initialise.  If that time elapses before the ready bit becomes set,
conclude the device is broken and refuse to initialise it.  Log a nice
error message so the user knows why we did nothing.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
This commit is contained in:
Matthew Wilcox
2011-04-19 15:04:20 -04:00
parent aba2080f3f
commit 22605f9681
2 changed files with 12 additions and 0 deletions

View File

@@ -35,6 +35,8 @@ struct nvme_bar {
__u64 acq; /* Admin CQ Base Address */
};
#define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff)
enum {
NVME_CC_ENABLE = 1 << 0,
NVME_CC_CSS_NVM = 0 << 4,