Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp429175rdf; Fri, 3 Nov 2023 05:12:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYGu39fPUWzypRCNgxSbIwAnUvFzWMdP23wHDO/1aG8+TH2UoEvHaYV/r4cH+cdYCBUyk3 X-Received: by 2002:aa7:800f:0:b0:6c2:cb9a:885a with SMTP id j15-20020aa7800f000000b006c2cb9a885amr8528673pfi.27.1699013550739; Fri, 03 Nov 2023 05:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699013550; cv=none; d=google.com; s=arc-20160816; b=wbYD+DgUZ9Rvllp204s9onzaxF+Nc4E3y3cjbFod9oWgSvpIvy6NGoX3bTkAs7GaMj k7zfmlo04AOo5qbn8GraADzEJtkJaWl1/wRgASEuS9tuVFMZxmFFAMT57ZQ0NzyHew45 uaYImCoFX/40fa5DccN4HVL8RVxCYbgEw86OGemVf6RXqAmAWuByMVjMCdhX/M4lWtdX JulmPfBfxRRBxnf2yUMsPvePmhiVeM+SRnUkLBhe7GUfAQXU0KwxuluneKkeMd27reEL YJ56qyyyoCqARsx4WRUpLcdjNNn5EgXYKzwQ6r5NNRaI0jWuF5orfjvIovYSfLBSmNYU +NiA== 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 :dkim-signature; bh=ekxLl5mg6uyebw0+8QSXiYfL8qTfhDVbDhwInXfLUCs=; fh=kaXpEEB5eKodI+2JGlNZSt5WzgOZyHfL1/2ngQO3ocA=; b=W8TuriR0HcEXwOgMaohiYPS5Zksl09Fh4t0PUmyoxspwrd9zBB2XetW1/HcXCkERkr GbKLD5CJE4t4gXVOTzU3mNPjPv24dggMu+GK1zHtwwPlc/gojMEuxajxqtTW653Ohc7F XCEgTTNA4/AsFJuyt/j60fM1c4w5fGG5DgpMy+dk3ya2kxtj+ridPTAlyNvWZ29A6t2B UQFovsxdQ5B0KXBwbjwxAHd+hQ+0NKUMZ0DTPSueOa2wqvnwaSPFSqc8EQKtkDyV7Gry XP8tV+0RVhTwREz746teT49+RWFeDIJ6KSJS6QsgrLjaXrkHTe8UbUmT2k4QUAHSCh54 sMyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="tkveK/98"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id r7-20020a63e507000000b005b7160263efsi1423561pgh.489.2023.11.03.05.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 05:12:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="tkveK/98"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 981AC82972DE; Fri, 3 Nov 2023 05:12:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346568AbjKCMJb (ORCPT + 99 others); Fri, 3 Nov 2023 08:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbjKCMJa (ORCPT ); Fri, 3 Nov 2023 08:09:30 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55A94A2 for ; Fri, 3 Nov 2023 05:09:24 -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-out2.suse.de (Postfix) with ESMTPS id 4CA291FD69; Fri, 3 Nov 2023 12:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1699013362; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ekxLl5mg6uyebw0+8QSXiYfL8qTfhDVbDhwInXfLUCs=; b=tkveK/98j0/0draXLw8OIwF0WvNEDPyvfxcRnuavegSWlE8FdouNSqwS1LRsQIb5D5Of0+ y0ELxBofh4mgL2JaDDeMS0yfhiiPekUigYUeoUeLDdMnuRx0nxL8M11uUOeB3ArmUXTF9B KZkdZR8AF5qWU8V6CM06T8qdmp0TIxY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1699013362; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ekxLl5mg6uyebw0+8QSXiYfL8qTfhDVbDhwInXfLUCs=; b=dPRuMbCsrgZeA/flW50Cn19TW7Nu/uqqzqN4Nm/6Qn7BB+XbYRBmHtotYop5FARxZubDlO WaqOCBjMvNPl63CA== 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 32B8913907; Fri, 3 Nov 2023 12:09:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PmEMDPLiRGUJTQAAMHmgww (envelope-from ); Fri, 03 Nov 2023 12:09:22 +0000 Date: Fri, 3 Nov 2023 13:11:02 +0100 From: Daniel Wagner To: Keith Busch Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Niklas Cassel , Kenji Tomonaga Subject: Re: [PATCH v3] nvme: update firmware version after commit Message-ID: References: <20231030160044.20355-1-dwagner@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 05:12:16 -0700 (PDT) On Tue, Oct 31, 2023 at 10:08:53AM -0600, Keith Busch wrote: > On Mon, Oct 30, 2023 at 05:00:44PM +0100, Daniel Wagner wrote: > > 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. > > > > Reported-by: Kenji Tomonaga > > Signed-off-by: Daniel Wagner > > Thanks, applied for nvme-6.7. I've got negative feedback from one of our customer. I've annotate the code with dev_info(ctrl->device, "afi: %#x\n", log->afi); for (i = 0; i < 7; i++) { dev_info(ctrl->device, "frs%d: %.*s\n", i + 1, nvme_strlen((char *)&log->frs[i], sizeof(ctrl->subsys->firmware_rev)), (char *)&log->frs[i]); } [ 124.824812] nvme nvme8: afi: 0x3 [ 124.824824] nvme nvme8: frs1: 0.4.0 [ 124.824828] nvme nvme8: frs2: 0.3.0 [ 124.824832] nvme nvme8: frs3: 0.4.0 [ 124.824835] nvme nvme8: frs4: [ 124.824837] nvme nvme8: frs5: [ 124.824840] nvme nvme8: frs6: [ 124.824842] nvme nvme8: frs7: This particular firmware seem to interpret afi one based, while the this patch assumes it is zero based memcpy(ctrl->subsys->firmware_rev, &log->frs[log->afi & 0x7], sizeof(ctrl->subsys->firmware_rev)); The spec says 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. Any ideas how to handle this? Thanks, Daniel