Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp517404rdf; Fri, 3 Nov 2023 07:22:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQGq6g4xVCVREEH4W50YEtC44GmwBk6q3Ukvkky605tArFLGuIcOpoSaSMH7qDWElfZWN7 X-Received: by 2002:a17:90a:3484:b0:27d:310a:b20e with SMTP id p4-20020a17090a348400b0027d310ab20emr18257638pjb.0.1699021356421; Fri, 03 Nov 2023 07:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699021356; cv=none; d=google.com; s=arc-20160816; b=WhPWMB4jgcxIMxSksOV+g6oH0tWe5FkSbv7ENcfapkpX1IWykYQ07rd2twJ5E2yoE+ Xs1p6P2bGI3o9hbLUMn1uZhCH0+2ibfA7M7vjqg3zuQpRZR5DcUdYcFAop1o9FH22xSF 3psXT89+I+Niz1gk/K2VfbRBQbooQcW9TCuE0JOeLfT5Feipfe5fDzVYfSXHHlAubclt +29V/jKI5PQee7Vm43bV0MV9FEAiU8khJTqbig9AvCxpqy15zxYQ48Lslwseac0DO3jN W0IJJYTfa+naz/1HxMgCzrMb/pYMjn89CJL8o36gmuRz2LH7v9Ni/LH3yPAdPXmJnq4X Fd3Q== 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=OLQ0poeG2hTbjPAwCdQl/GpYvsYsztDaO+xenptZW2I=; fh=Eu5B+cuN6F6sCHPkNEiZpHkkB0yJq8jKOZYNK/4/du8=; b=QNP53bjLtF747VufF9mrI4SxMBMUtHq2yrwA2t7FsDT1gk5lOaid3omSNK35bQqDDa 6R6BXDsK3Pm/L/vpWMdv97QUmNzR7sJjNGVzKUSiPMLVvzithEhVZowAD3gwkIShbSe+ upnYHrOQZek87jdC/UzAQyY6dW5mqwg0u4uG2fjKBWebaBzPBws1VifvBtTzLikQzwmG /QBa2XCBTD14s9rFuhSNlUxe3GLC9OZk1YBw+zdzhVAxY6c+JeWjzGk6XjqUMFXGJd37 uVlIfII3oAicL5v1DyYV9ajQScGqlLpd7jG4/sADkYtCx3kl+86dkIfZzGzlpED/3IGb T3Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lBqtSDCs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p2-20020a17090ab90200b0028014e41ff7si1578802pjr.48.2023.11.03.07.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:22:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lBqtSDCs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 8057381F473B; Fri, 3 Nov 2023 07:22:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233140AbjKCOWS (ORCPT + 99 others); Fri, 3 Nov 2023 10:22:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjKCOWR (ORCPT ); Fri, 3 Nov 2023 10:22:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F917D42 for ; Fri, 3 Nov 2023 07:22:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BED2CC433C7; Fri, 3 Nov 2023 14:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699021334; bh=i4n+Ca8lHKiU8bKf7X1drUsWnYBFo6sjVmEhJySGhLc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lBqtSDCsfrF7qq6D7S2hdg43EUXJkXtETu1ye6NCHLfGWUk5WFYCsZrUuYLqAsCG1 RFAFUs7K4GLdJK2NtMq9QdY9FWmbKwh1RcGWD6uf6w5GCk5YfS6pfJ7H6rO5/0O84X WE1GGVz9XFPH42p9ClNiUBdTvuZG5JPovtUIPVNHyWJfcvARVmnRiLtNisMK+M6JYO D1uAxNFEnuVvkamh3TYXPwYoS2xMnQL+NXtUFscHQrryhTKFX06y2oEfTKUd5JTp7Q VEhFhuoYTTwYOfN0q4fzcAO16+d1NjbYo0dMXA6MeyfWwadRjGFOiZ56gR1cZSdtCF 770S+I+gJJoRA== Date: Fri, 3 Nov 2023 08:22:11 -0600 From: Keith Busch To: Christoph Hellwig Cc: Daniel Wagner , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Niklas Cassel , Kenji Tomonaga Subject: Re: [PATCH v3] nvme: update firmware version after commit Message-ID: References: <20231030160044.20355-1-dwagner@suse.de> <20231103135857.GA1871@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231103135857.GA1871@lst.de> X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 07:22:33 -0700 (PDT) On Fri, Nov 03, 2023 at 02:58:57PM +0100, Christoph Hellwig wrote: > On Fri, Nov 03, 2023 at 01:11:02PM +0100, Daniel Wagner wrote: > > This particular firmware seem to interpret afi one based, while > > the this patch assumes it is zero based > > > Active Firmware Info (AFI): Specifies information about the active > > firmware revision. > > > > Bit 7 is reserved. > > Bits 6:4 indicates the firmware slot that is going to be activated > > at the next Controller Level Reset. If this field is 0h, > > then the controller does not indicate the firmware slot that > > is going to be activated at the next Controller Level Reset. > > Bit 3 is reserved. > > Bits 2:0 indicates the firmware slot from which the actively running > > firmware revision was loaded. > > > > > > It's not clear to me if afi bits 2:0 is zero or one based. Bits 6:4 > > indicate to be 1 based. > > All 0's based (what a stupid term..) fields in NVMe are explicitly > marked as such. And even if that wasn't the case I'd very much > expect the same encoding for the two sub-fields. Yeah, it's just the firmware slot number, taken literally. AFI = 1 means slot 1, AFI = 2 means slot 2, etc... Slot 0 either has special meaning (firmware commit SF field, or fw log AFI bits 6:4), or is reserved value, like in Identify Controller FRMW.NOFS, and has no place in the FW Slot Info log page. Our first slot in the log page is defined as slot one, so we have to subtract one from the AFI field to index into the slot array. I messed up for not catching that earlier, but thanks for pointing it out now.