Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp799060rwi; Wed, 19 Oct 2022 03:09:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46M1hf8H1uMEmxjruwrjVCW+3nsE1sQ3MZJ19ckzDs9cnvobHSlcBePutame8orXfRtMvO X-Received: by 2002:a05:6402:274c:b0:45d:4015:cd8c with SMTP id z12-20020a056402274c00b0045d4015cd8cmr6851626edd.268.1666174179117; Wed, 19 Oct 2022 03:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666174179; cv=none; d=google.com; s=arc-20160816; b=pleGR5nTxRB6tscncmXAIVKHVa/asd1ld2iSFt/N9CkqpLrMXbI+rYs4GYrwAeWXdk waCAnHPydBIwQb3is2neuUY2zbtl/wvzPQLKGUpzGd6tJJyeS7H5iGEp3gDz8PfXQzsQ ZlTehhjB8RtLRJC4JSqevTstZ/0B7qejy0Exj4T/eOiBTBLC32WcIcQ1QHPxQAc6swv0 H90qnEPgcyMnuxc8ZcT02Vn3/+EjchdzpNfVAJFs424vpeTeNXWC30PBuNYsRa9jHoug K725/6eMitJm2uK28rq0wVkoJZ+NTTVuAvqVPQgoelIAilduXXX/531zZKVdj1oFdDgH PQGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jlfuvXWu5SeTxVzVxrBULOJJVXhL5e/8NFuwjavM7A0=; b=YGWfCn+HgyX8hHNTYRzjWWKThB0vyuuO6WmBF3JZZRIOmqw8wCJ1+dclJRBgHdX0Zf plGUkRreUQnZBrNaSI7z9WZM3B8du5fW1Vl/UtReSDe0jH6dy49lVy12ZefhWVI0DVii +G30pR48R4g3S8h5v2t/nGY47p4RTyGSEjbOgbiO4f9hw0Yag1sa5VqncLJXUBjMWbYF x2tZooGgmew9jQ9EMTqeavywbUM4rQMG2eWgLohWIGkd5Lhsbpj9S7w9RCb6RvRUDzhe dec9azFndUa62vkGKYEHyg+9LqJW/iOkS5QQyUwQ4uBMFWcagXnt1VQkL5UncN+a5ZeZ aakg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HMgcIrRG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a170906c20600b0078d27c1c8f4si11299919ejz.696.2022.10.19.03.09.12; Wed, 19 Oct 2022 03:09:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HMgcIrRG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234147AbiJSJmv (ORCPT + 99 others); Wed, 19 Oct 2022 05:42:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbiJSJkK (ORCPT ); Wed, 19 Oct 2022 05:40:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56DBBEEAA9; Wed, 19 Oct 2022 02:16:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B713617EC; Wed, 19 Oct 2022 09:14:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EC5CC433D6; Wed, 19 Oct 2022 09:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170898; bh=5qt8H4mypo9d3J9EVjpniftXE2g7dQ0BL2h2ZP4cgy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HMgcIrRGdTULaoW/ZNmkf9oAJ6XbOb5uXiJRDHd+mI3wevSn1TZllVrN0g4E4LHaZ RKnHEmhjwH1WslLluKpikppMboNtAa/fKBeKTZKuDOXwdY81XXtcU093jPqvB70SoE ks1OtwLgztiWJh8UHf10gABcITPEZZplmfZdjXx8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeff Lien , Keith Busch , Sagi Grimberg , Chaitanya Kulkarni , Chao Leng , Christoph Hellwig , Sasha Levin Subject: [PATCH 6.0 829/862] nvme: copy firmware_rev on each init Date: Wed, 19 Oct 2022 10:35:16 +0200 Message-Id: <20221019083326.533671790@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Keith Busch [ Upstream commit a8eb6c1ba48bddea82e8d74cbe6e119f006be97d ] The firmware revision can change on after a reset so copy the most recent info each time instead of just the first time, otherwise the sysfs firmware_rev entry may contain stale data. Reported-by: Jeff Lien Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Chao Leng Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 7991d28e6a6a..59e4b188fc71 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2889,7 +2889,6 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) nvme_init_subnqn(subsys, ctrl, id); memcpy(subsys->serial, id->sn, sizeof(subsys->serial)); memcpy(subsys->model, id->mn, sizeof(subsys->model)); - memcpy(subsys->firmware_rev, id->fr, sizeof(subsys->firmware_rev)); subsys->vendor_id = le16_to_cpu(id->vid); subsys->cmic = id->cmic; @@ -3108,6 +3107,8 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl) ctrl->quirks |= core_quirks[i].quirks; } } + memcpy(ctrl->subsys->firmware_rev, id->fr, + sizeof(ctrl->subsys->firmware_rev)); if (force_apst && (ctrl->quirks & NVME_QUIRK_NO_DEEPEST_PS)) { dev_warn(ctrl->device, "forcibly allowing all power states due to nvme_core.force_apst -- use at your own risk\n"); -- 2.35.1