nvme: copy MTFA field from identify controller [Linux 5.2]

nvme: copy MTFA field from identify controller [Linux 5.2]

This Linux kernel change "nvme: copy MTFA field from identify controller" is included in the Linux 5.2 release. This change is authored by Laine Walker-Avina <laine.walker-avina [at] intel.com> on Mon May 20 10:13:04 2019 -0700. The commit for this change in Linux stable tree is 2d466c7 (patch).

nvme: copy MTFA field from identify controller

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”).
Reviewed-by: Max Gurtovoy <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Minwoo Im <[email protected]>
Signed-off-by: Laine Walker-Avina <[email protected]>
[changelog, fix endian]
Signed-off-by: Keith Busch <[email protected]>

There is one line of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/nvme/host/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e1449c1..1b7c2af 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2576,6 +2576,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;

Leave a Reply

Your email address will not be published. Required fields are marked *