From nobody Fri Apr 3 11:02:31 2026 Received: from mail-qv1-f99.google.com (mail-qv1-f99.google.com [209.85.219.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC42227FB2D for ; Fri, 20 Feb 2026 03:28:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.99 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771558100; cv=none; b=uaX55sMQ3pTpoqUbLhb1QIA+1CfM6FX8bgfnsuu5bxmOU2KJ1BynqAwmeXUpxEXmE0A/TtHufkBAo+PkKUUBx/XRYLJdunQCOBHfO1ccmHHdPLdnp0hpVef0lHya7LaUdnREYQxVzTN0+Asam3+VHE7W2HreLJzpx0VrvjmJyPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771558100; c=relaxed/simple; bh=Rcw/Fsp67BuWmYt4ZmR1agIyycWBJoEV5piBgRUp98I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pPXJJnKq3ySG/CBE1oFRw2GxgjvSIQ3UL1ff1FUYnja8+m5rpGzU2A+3H5sMuDwgczHX36l9/DyfKhS8zQkg0KyZMny6Uvso2y/SOg0dtCCkn//InnkCMXrEhJ5jSod7P+3fliygotqxrY2I23XjZxoa4aagiU35KF1oOWauIY8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=Af8LoFFx; arc=none smtp.client-ip=209.85.219.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="Af8LoFFx" Received: by mail-qv1-f99.google.com with SMTP id 6a1803df08f44-895498f3819so2539546d6.3 for ; Thu, 19 Feb 2026 19:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1771558097; x=1772162897; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ptMOCF8NjnbTdAq6XG34n7GRmdz+Z/rsqtMtW/eBnI0=; b=Af8LoFFxmP2YRT5F4E6HBOwVlriGOdOgA0Wn7AkFC5+xs+f9XGMqAlw+eZ/IvFgJgD iCERZ83AOrJ4h0GkdEi1nFFAWtvZxqDqVc5k8AmNbAYnBgMPR786H5/j5KPdBjINIB02 Dmn35OntXu2Poewx7138PPOaAnQQCs7nIgcjvP2EN0hUU/n1kRWycXYV9FKXAkbw83fj FblDbMkAQ3aGlIO5rhoBIqZAu/Linhez0jMq9cYDuVACfgQuh7tf4bYd6TmF9aHmt+ky EiQP9r3NX+VG753RdpEnohTUDI1Q8ZU9WyuLueSBImf1YpsqDBDxUY2QOhjKwYn2kEhz 1Ruw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771558097; x=1772162897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ptMOCF8NjnbTdAq6XG34n7GRmdz+Z/rsqtMtW/eBnI0=; b=rwPWSpbTM5R5UlMYO3mfmRSgI95dSlSe8dKH4HwZk8Xd7LabpSFxq2YJL1GehSQMOM EiGSc2jrsFms5c2199OOaUaBYHjXQ99zNqYearPPhM5Dnuq8/DFs+NVY73l6oa9/K8ks 71nY6ChhDlVvJCq9OlQjPtBJmn4q3Do1lla4LTkKndZfXMmdm0Sfhv1sIsJMbbiZe86w XFmrzN3jQdM2j+0jNkVBdAROk4GPyAiRE76X9JBUmf7z1FMx+GSOXhpdIpCVnaMnYvbC JPNUKjB2R2AZWP9a1vqui9dQn4EpvZvuIo7zci+VAOEJgDgCiEA/AQYcnYZEsXFy8kWA nHdw== X-Forwarded-Encrypted: i=1; AJvYcCVBjTXLJR7HL7VsMLv9ArTIzEmL1j+pI+d+g8EQ8+W2gRqOlKDAXckvSwh3fCFIurffIN4FrYqNapJ5x6c=@vger.kernel.org X-Gm-Message-State: AOJu0YyW2ZRZ/my+dM4wnfpm3prFiB5tjQXgnFVTOf7qBIFeZwQhfgab Y/jrKUdnNWhv2ObW8j94c8FcKQ5LV5wTeSS1mrxNJmR+x8XQjTsn+SUCzAZz7/Wz+r+azBSLVQN lu9Tjz8eLlXkiaEg4WgGHl/M81+QLXyJaFryn3M+t5G9UAO2QCejT X-Gm-Gg: AZuq6aLs9AFzuE9TgwdvtcHn+cUugXRMvQHyeCCe7rkIvCj3TnIhdpxlQ0NBysrHGIX NrT4PPQh/ku+Ioz1zLlJDs9WD4wYq/kenHi3as/5rYv9oO0yKKLjhR743XarFFstPc93YQcWmtg XCryGO+n35ltl/h76FA3SOVbLj7MrMvloKKGifCGitOmNfMJsXTNrG+exLVgkKT8Ix7caZ0VLnE enJsQ/1CdExrNuAsJxcGO9a8zgUu9HO0vubFLURf3ftJonne7f6esZYvJyqy1sGK4L8FUH7sPYT ifLk2tG07aJKy/Lzr/eifbFX0H7owNcZqY2CfOusHuz1DTeun2AEc/kIMFOo1pNKBm/87+t/1Ch /tu2VGER07snS2bYY/o74UC5+eLIn/ZbAUHjRbDo= X-Received: by 2002:ac8:5e53:0:b0:4ee:1db1:a61d with SMTP id d75a77b69052e-506a6831f24mr237407291cf.3.1771558096686; Thu, 19 Feb 2026 19:28:16 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id d75a77b69052e-50684a3e737sm27357291cf.2.2026.02.19.19.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Feb 2026 19:28:16 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.29.101]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 0B2FF3408B8; Thu, 19 Feb 2026 20:28:16 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 0814AE420F8; Thu, 19 Feb 2026 20:28:16 -0700 (MST) From: Caleb Sander Mateos To: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH 2/6] nvme: update nvme_id_ns OPTPERF constants Date: Thu, 19 Feb 2026 20:28:05 -0700 Message-ID: <20260220032809.758089-3-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260220032809.758089-1-csander@purestorage.com> References: <20260220032809.758089-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since NVM Command Spec 1.1, OPTPERF comprises both bits 4 and 5 of NSFEAT in the Identify Namespace structure. Replace NVME_NS_FEAT_IO_OPT, which represented only bit 4, with NVME_NS_FEAT_OPTPERF_SHIFT and NVME_NS_FEAT_OPTPERF_MASK. Update nvme_update_disk_info() to check both OPTPERF bits, as NPWG and NOWS are supported even if only bit 5 is set. Signed-off-by: Caleb Sander Mateos --- drivers/nvme/host/core.c | 3 ++- include/linux/nvme.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 3a2126584a23..674dd823b209 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2095,11 +2095,12 @@ static bool nvme_update_disk_info(struct nvme_ns *n= s, struct nvme_id_ns *id, } =20 phys_bs =3D bs; atomic_bs =3D nvme_configure_atomic_write(ns, id, lim, bs); =20 - if (id->nsfeat & NVME_NS_FEAT_IO_OPT) { + if (id->nsfeat >> NVME_NS_FEAT_OPTPERF_SHIFT & + NVME_NS_FEAT_OPTPERF_MASK) { /* NPWG =3D Namespace Preferred Write Granularity */ phys_bs =3D bs * (1 + le16_to_cpu(id->npwg)); /* NOWS =3D Namespace Optimal Write Size */ if (id->nows) io_opt =3D bs * (1 + le16_to_cpu(id->nows)); diff --git a/include/linux/nvme.h b/include/linux/nvme.h index bc991d4ae89d..f279e5d72e2d 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -593,11 +593,12 @@ enum { }; =20 enum { NVME_NS_FEAT_THIN =3D 1 << 0, NVME_NS_FEAT_ATOMICS =3D 1 << 1, - NVME_NS_FEAT_IO_OPT =3D 1 << 4, + NVME_NS_FEAT_OPTPERF_SHIFT =3D 4, + NVME_NS_FEAT_OPTPERF_MASK =3D 0x3, NVME_NS_ATTR_RO =3D 1 << 0, NVME_NS_FLBAS_LBA_MASK =3D 0xf, NVME_NS_FLBAS_LBA_UMASK =3D 0x60, NVME_NS_FLBAS_LBA_SHIFT =3D 1, NVME_NS_FLBAS_META_EXT =3D 0x10, --=20 2.45.2