[PATCH 0/1] nvme: Export CSTS register via sysfs

Alan Adamson alan.adamson at oracle.com
Wed Mar 17 20:46:14 GMT 2021


This patch exports the NVMe Controller CSTS register via sysfs.  This
feature can be used by userland executables that accessed CSTS and
possibly other registers by mapping them into user space.  Since this ability
may not always available, exporting certain registers via sysfs provides
a safe/read-only way to access registers from outside the kernel.

Testing:

# Controller in the RDY state
# cat /sys/devices/pci0000:00/0000:00:04.0/nvme/nvme0/csts
1

# Controller in the FAILED state
# cat /sys/devices/pci0000:00/0000:00:04.0/nvme/nvme0/csts
2

# A virtualized csts register can be accessed for fabric devices 
# cat /sys/devices/virtual/nvme-fabrics/ctl/nvme1/csts
1

Alan Adamson (1):
  Export CSTS register via sysfs

 drivers/nvme/host/core.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

-- 
2.18.4




More information about the Linux-nvme mailing list