NVMe controller reset

Keith Busch keith.busch at intel.com
Tue Mar 17 13:30:23 PDT 2015


On Tue, 17 Mar 2015, Brandon Schulz wrote:
> What is the preferred way (if there is one) to force a controller reset from user-space?
>
> If, for example, a user-space tool was going to do a firmware activate that required a controller reset, how would one trigger the reset?  I do not see an ioctl defined for this today, or am I missing something?

Like this:

   # echo 1 > /sys/class/nvme/nvme<#>/device/reset

This assumes you're using kernel >= 4.0. Before that'd, the entry was
under "class/misc" instead of "class/nvme". It was moved to a new class
because 'misc' wasn't giving us enough minors to have more than several
dozen NVMe drives in a system, but I want hundreds.

It also assumes you're using a kernel >= 3.15. While the sysfs entry
exists pre-3.15, it wasn't safe to use because there was no notification
callback for drivers to subscribe to.

Had I known what a pain it was to back-port the pci callback to older
kernels (it apparently breaks kABI), I would have used an nvme specific
sysfs entry, but that's where we are today.



More information about the Linux-nvme mailing list