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

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Thu Mar 18 01:06:19 GMT 2021


On 3/17/21 14:05, Alan Adamson wrote:
> 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(+)
>

This patch looks good the usecase mentioned, but I'd really like to
see blktests for this since we are exporting it to userspace.





More information about the Linux-nvme mailing list