From b946d8f99a86aed9cf1f423c3da3b275505ccba0 Mon Sep 17 00:00:00 2001 From: Laine Walker-Avina Date: Wed, 21 Jul 2021 09:53:49 +0800 Subject: [PATCH] nvme: copy MTFA field from identify controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mainline inclusion from mainline-5.2-rc2 commit 2d466c7a574d0b893a233735f133c60115013c0e category: bugfix bugzilla: 167363 CVE: NA --------------------------- 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 Reviewed-by: Christoph Hellwig Reviewed-by: Minwoo Im Signed-off-by: Laine Walker-Avina [changelog, fix endian] Signed-off-by: Keith Busch Conflicts: drivers/nvme/host/core.c [ Cleanup 43e2d08d0790a0("nvme: avoid double dereference to convert le to cpu") is not applied. ] Signed-off-by: Zhihao Cheng Reviewed-by: Hou Tao Signed-off-by: Yang Yingliang --- 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 7247dbbc68e1..880994fdc022 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2566,6 +2566,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl) ctrl->oacs = le16_to_cpu(id->oacs); ctrl->oncs = le16_to_cpup(&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; -- GitLab