Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp985276rdg; Fri, 13 Oct 2023 07:07:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrIa7EsZexug23KHeOgiUdOW0wsN6ZxAmFtL2D4q9MN7VKi4BdxJZECgHDtW0H4+wPrLiL X-Received: by 2002:a05:6358:2817:b0:12b:da97:aba6 with SMTP id k23-20020a056358281700b0012bda97aba6mr28067301rwb.24.1697206072854; Fri, 13 Oct 2023 07:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697206072; cv=none; d=google.com; s=arc-20160816; b=aBxkFuqRgVQRxuotu9EJCfh3JxczKhhkN3ebPoYnP+DZg0uXTlWbnZMFfpJGV7lOW0 l2VTMDuxUTqfJowgJ3J94WkRY0ATbkhv67sngQEPhaSiEoQtF8/nrYA+BC2G31g2SiVi xyhRbmdaN7MHZRgpp4eoJ8zR60VWHc2e9jbbYXS6E6hXeUt7pH9QOr1Ae0L5xZYsq8pe m2+FpdhhSkyKrxqzZKIPCK/7KJgGEc9H8AyC9IBhTHgXfgwzZ7pw/Pkz2FeWltln95+E +tp4wipdtYK7bgO+veur4G0+OO50q5+x+gDYqLiKl2mYnEluV29XFZLLzOGWobWqVpWg ubyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ra2aXed8uArUI7TwjFcHN89SN3CjIBH2+/864FeYqEo=; fh=jlyQdItdyvI0X7+BMIINqDndqr1wUDF7P5D8o7CBZEg=; b=OvNDXo6bW86FCr35kIDFu42J2P2EJGnfryalwch6VULxjrWlopXS923wQpyRZPyMwk B0j157quT561q0/9L6hpVs+/NrJj4ppngOvM8u6ikepX4RKtJt3OvlvnvOo+v8G5ryYK 9nwvIj0xWMv8AbtD0BtEtJeW18DLvxPxWVLepWcPmT/APovgeyL3dNtO6h2Chl4harP+ wbLcWP7x/YghbPgBe705rT6sDQoCuomacjMc0z8phOJFFSwYWNSECFMIiXALcO+S60YS 3yAXny8KypF2AeJosQkqRL59GPIDaOuWPzNejoTKal/QeG8KecDbQ6UV4cNqM8R8VkYC Iw6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="eTT0h/SD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q1-20020a056a00150100b006b7d62ed178si27835pfu.5.2023.10.13.07.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 07:07:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="eTT0h/SD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E55CA82F05CB; Fri, 13 Oct 2023 07:07:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232034AbjJMOHt (ORCPT + 99 others); Fri, 13 Oct 2023 10:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231963AbjJMOHs (ORCPT ); Fri, 13 Oct 2023 10:07:48 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1BB8BD for ; Fri, 13 Oct 2023 07:07:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F572C433C8; Fri, 13 Oct 2023 14:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697206067; bh=w/mdAXQ4DIZNVExM6+HaBdT5TCkbE6ZvzTL0s1NL0EU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eTT0h/SDDSXoXOqvm4V87CtMdIqrsWe9l3sCV0TdNFc8QE/PG2bfTzBWAqNdmqdLe ThjDf2biYkFOMh/2RxiANbMq8dZA6G1ZJbLWr1gVwAHmH3lcqMYYtiK0XD+rO0JtLk AkJBkYar4rnpuj5HUV3AAQdZ7IZhjCCVLmSm/udfvd2PND6EjpbjXEgio8fdDTDB5w 39E0e6AX+hL+YeDreXFmuthXHOLR9xWHy97lDeUGgYXULbYmjJl+1ixmNfmF9mUKvI 9dmQ1zDw9kf4AMMcL+f5rDhJtfgM7MwdG3G8PM9XCH5itqRvH35tSdLNkifxHgRLQr NX1eMCoe4mqyQ== Date: Fri, 13 Oct 2023 08:07:45 -0600 From: Keith Busch To: Daniel Wagner Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH] nvme: update firmware version after commit Message-ID: References: <20231013062623.6745-1-dwagner@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231013062623.6745-1-dwagner@suse.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 13 Oct 2023 07:07:52 -0700 (PDT) On Fri, Oct 13, 2023 at 08:26:23AM +0200, Daniel Wagner wrote: > +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); The "fw_slot_info()" call also gets the firmware version, so no need to do it a different way. Just add the memcpy to that function instead of introducing a new one.