Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp762843rdg; Thu, 12 Oct 2023 23:25:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4vNGqtJSys4LMov9kuHUMeY1l1Sf83l8Xh8l/5m3DSlMEiLiBt81B6vd/5DrF/EnLSbfr X-Received: by 2002:a05:6a20:4292:b0:16b:c9f2:b632 with SMTP id o18-20020a056a20429200b0016bc9f2b632mr21591989pzj.62.1697178326917; Thu, 12 Oct 2023 23:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697178326; cv=none; d=google.com; s=arc-20160816; b=0oNkJ3q2g0Ik8Wg2v/1mw2aKXuLvJHmT8CiXmLmFdoUUiS8Mzn+uh+mlh33E4HXSov /5hIo3FUhaj27DJeZhgzuWT1swzJZQUQcf6Dyjm91ICncVGmK47odPLNkFvRIzNO7WIX b4jIUeo1dDh4oVfCp0IpiiYzWhxTj7Cgplq9g3vZ02UPb/P7ReF0yxyhj2dwYNmbOgcX k4QCNddmkqrT53Tj3gkTLK5rkGjirKOZFBUMeH/NBXaYNiSo8v+IxX+H0oG6uRpHbQZh gkpqDB/o6YAa9WfQS5ugJ+K7IGWBeSbyAFcQQ0PlTPx2YzREFXBJ/nLcHQ7/zi/em0GQ W2iQ== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=T9TmIodEecjXhOeeyVrpi/lTsL8WIjPMSwLYTMa8tvQ=; fh=MO7PhMb8ok0Y0DF3Q1DBbn2ZS9Oc1sAgLO8XSCwICUg=; b=ZLzEyshHL+bRMeE+JBCDSkXAhakMHmJJIKTtzpGknyEQ5ABlMAOuf783ijA78+aFi2 qs+4oJpf+soKH4bqsYxr+UR87gCgJDEn/tXBxnlvy3Mi1qe/UfB85cRfys361miv05Qd Y9hJFSbvpW0w1VYmSx+kj4heu1TpqRsm7isQfHcfyCOuzLVRSLCpEe876s49qbWblt0z b8QjFY4CX4Hm5t8nHEXINYgUDucsEZJiSk5SJgdpFzeYJY9+i+xOqSmw5GNRFb0cX8dv NXjEnMmOakIOGfGdL562I57bvQ8IVvjIUhjVh+XWLW1le+CK/TYm2OYlRsxXlm1FerET 8USg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=JLCLMy6w; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id p11-20020a170902c70b00b001c9d9050b37si3561913plp.260.2023.10.12.23.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 23:25:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=JLCLMy6w; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5E44081F361D; Thu, 12 Oct 2023 23:25:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229740AbjJMGZR (ORCPT + 99 others); Fri, 13 Oct 2023 02:25:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjJMGZQ (ORCPT ); Fri, 13 Oct 2023 02:25:16 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B67B7 for ; Thu, 12 Oct 2023 23:25:14 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7F27E2188E; Fri, 13 Oct 2023 06:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697178313; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=T9TmIodEecjXhOeeyVrpi/lTsL8WIjPMSwLYTMa8tvQ=; b=JLCLMy6wswunI8hU6sPbjwoP/t0Ty/c1IeLSfXcWEuOBv28FvZWwfXG+kGX0L0Wl2ItZdD S3PaaGn1Jf6TSo1slBFf0sxtePdCdMP1uQXZ5fBfPCT6GRl4eaHvwuaBNC9Q1lFgsfbWyE 3X81qg0HtXKG5100/xI+weOypjXniQI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697178313; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=T9TmIodEecjXhOeeyVrpi/lTsL8WIjPMSwLYTMa8tvQ=; b=7AjiLkauuPFUix9b7kF2COHEbA56vaqruZLElPf2aJkyNCInFjhKjCW81fMGi8QcLuAW3b PJuVEysxjDJ3ihBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 713BE138EF; Fri, 13 Oct 2023 06:25:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bkqXG8niKGX/NwAAMHmgww (envelope-from ); Fri, 13 Oct 2023 06:25:13 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Keith Busch , Christoph Hellwig , Daniel Wagner Subject: [PATCH] nvme: update firmware version after commit Date: Fri, 13 Oct 2023 08:26:23 +0200 Message-ID: <20231013062623.6745-1-dwagner@suse.de> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: 0.50 X-Spamd-Result: default: False [0.50 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-3.00)[-1.000]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.40)[77.76%] X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 12 Oct 2023 23:25:23 -0700 (PDT) The firmware version sysfs entry needs to be updated after a successfully firmware activation. nvme-cli stopped issuing an Identify Controller command to list the current firmware information and relies on sysfs showing the current firmware version. Signed-off-by: Daniel Wagner --- drivers/nvme/host/core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 62612f87aafa..bb15d878e8a2 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4079,6 +4079,20 @@ static void nvme_get_fw_slot_info(struct nvme_ctrl *ctrl) kfree(log); } +static void nvme_update_firmware_rev(struct nvme_ctrl *ctrl) +{ + struct nvme_id_ctrl *id; + int ret; + + ret = nvme_identify_ctrl(ctrl, &id); + if (ret) { + dev_warn(ctrl->device, "Identify Controller failed (%d)\n", ret); + return; + } + memcpy(ctrl->subsys->firmware_rev, id->fr, + sizeof(ctrl->subsys->firmware_rev)); +} + static void nvme_fw_act_work(struct work_struct *work) { struct nvme_ctrl *ctrl = container_of(work, @@ -4109,6 +4123,7 @@ static void nvme_fw_act_work(struct work_struct *work) nvme_unquiesce_io_queues(ctrl); /* read FW slot information to clear the AER */ nvme_get_fw_slot_info(ctrl); + nvme_update_firmware_rev(ctrl); queue_work(nvme_wq, &ctrl->async_event_work); } -- 2.42.0