Skip to contentSkip to conversation

nvme: copy MTFA field from identify controller

PATCH New Keith Busch 4 participants 4 messages May 20, 2019 – May 21, 2019 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: copy MTFA field from identify controller

From: Laine Walker-Avina <[email protected]>

We use the controller's reported maximum firmware activation time as our timeout before resetting a controller for a failed activation notice, but this value was never being read so we could only use the default timeout. Copy the Identify Controller MTFA field to the corresponding nvme_ctrl's mtfa field.

Fixes b6dccf7fae433 (?nvme: add support for FW activation without reset?).
Signed-off-by Laine Walker-Avina <laine.walker-avina at intel.com>
[changelog, fix endian]
Signed-off-by Keith Busch <keith.busch at intel.com>
---
 drivers/nvme/host/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/host/core.c +1 -0
index 7da80f375315..eb3fb561b165 100644
@@ -2557,6 +2557,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
 
 	ctrl->oacs = le16_to_cpu(id->oacs);
 	ctrl->oncs = le16_to_cpu(id->oncs);
+	ctrl->mtfa = le16_to_cpu(id->mtfa);
 	ctrl->oaes = le32_to_cpu(id->oaes);
 	atomic_set(&ctrl->abort_limit, id->acl + 1);
 	ctrl->vwc = id->vwc;
Signature · 1 line
2.14.4
#1 lore raw

PATCH 1/1 nvme: copy MTFA field from identify controller

Indeed we don't set that.

root at mat ~/nvme (nvme-5.2-rc2)# grep -ir mtfa host/*.h
host/nvme.h: u16 mtfa;
root at mat ~/nvme (nvme-5.2-rc2)# grep -ir mtfa host/*.c
host/core.c: if (ctrl->mtfa)
host/core.c: msecs_to_jiffies(ctrl->mtfa * 100);
root at mat ~/nvme (nvme-5.2-rc2)#

Reviewed-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
Quoted 29 lines · Keith Busch

From: Laine Walker-Avina <laine.walker-avina at intel.com>

We use the controller's reported maximum firmware activation time as our timeout before resetting a controller for a failed activation notice, but this value was never being read so we could only use the default timeout. Copy the Identify Controller MTFA field to the corresponding nvme_ctrl's mtfa field.

Fixes b6dccf7fae433 (?nvme: add support for FW activation without reset?).
Signed-off-by Laine Walker-Avina <laine.walker-avina at intel.com>
[changelog, fix endian]
Signed-off-by Keith Busch <keith.busch at intel.com>
---
  drivers/nvme/host/core.c | 1 +
  1 file changed, 1 insertion(+)
drivers/nvme/host/core.c +1 -0
index 7da80f375315..eb3fb561b165 100644
@@ -2557,6 +2557,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
 
  	ctrl->oacs = le16_to_cpu(id->oacs);
  	ctrl->oncs = le16_to_cpu(id->oncs);
+	ctrl->mtfa = le16_to_cpu(id->mtfa);
  	ctrl->oaes = le32_to_cpu(id->oaes);
  	atomic_set(&ctrl->abort_limit, id->acl + 1);
  	ctrl->vwc = id->vwc;
#3 lore raw

PATCH 1/1 nvme: copy MTFA field from identify controller

In reply to Keith Busch
Quoted 8 lines · Keith Busch

From: Laine Walker-Avina <laine.walker-avina at intel.com>

We use the controller's reported maximum firmware activation time as our timeout before resetting a controller for a failed activation notice, but this value was never being read so we could only use the default timeout. Copy the Identify Controller MTFA field to the corresponding nvme_ctrl's mtfa field.

Quoted 7 lines
Fixes b6dccf7fae433 (?nvme: add support for FW activation without reset?).
Signed-off-by Laine Walker-Avina <laine.walker-avina at intel.com>
[changelog, fix endian]
Signed-off-by Keith Busch <keith.busch at intel.com>
---
  drivers/nvme/host/core.c | 1 +
  1 file changed, 1 insertion(+)

Looks good,

Reviewed-by Max Gurtovoy <maxg at mellanox.com>