]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
nvme: expose cntrltype and dctype through sysfs
authorMartin Belanger <martin.belanger@dell.com>
Tue, 21 Jun 2022 21:53:00 +0000 (23:53 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Jul 2022 08:34:43 +0000 (10:34 +0200)
commitd913e3aebfa26e32afd66e4cd040d77db6a95515
tree61927ded7d7fc428f3a5f483e38d9dd86a23c3ed
parentc181de7dd04790e7bb3c1c07fedcca15f9ab345a
nvme: expose cntrltype and dctype through sysfs

TP8010 introduces the Discovery Controller Type attribute (dctype).
The dctype is returned in the response to the Identify command. This
patch exposes the dctype through the sysfs. Since the dctype depends on
the Controller Type (cntrltype), another attribute of the Identify
response, the patch also exposes the cntrltype as well. The dctype will
only be displayed for discovery controllers.

A note about the naming of this attribute:
Although TP8010 calls this attribute the Discovery Controller Type,
note that the dctype is now part of the response to the Identify
command for all controller types. I/O, Discovery, and Admin controllers
all share the same Identify response PDU structure. Non-discovery
controllers as well as pre-TP8010 discovery controllers will continue
to set this field to 0 (which has always been the default for reserved
bytes). Per TP8010, the value 0 now means "Discovery controller type is
not reported" instead of "Reserved". One could argue that this
definition is correct even for non-discovery controllers, and by
extension, exposing it in the sysfs for non-discovery controllers is
appropriate.

BugLink: https://bugs.launchpad.net/bugs/1948626
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: John Meneghini <jmeneghi@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
(cherry picked from commit 86c2457a8e8112f16af8fd10a3e1dd7a302c3c3e)
Signed-off-by: Michael Reed <Michael.Reed@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
include/linux/nvme.h