We have a NVMe SSD that requires a power cycle (because of firmware updates that does not work with controller reset). We are exploring using NVMe subsystem reset. But our platform does not support surprise hotplug, so we are trying to use sysfs to remove the drive and rescan the bus.
- To remove: echo 1 > /sys/pci/bus/devices/<pci_address_of_drive>/remove
- To rescan: echo 1 > /sys/pci/bus/rescan
This works majority of the time and the drive is able to enumerate after this. But sometimes, the drive fails to enumerate. A system reboot puts the drive back in good state. We are not seeing any issues with the drive firmware (verified using telemetry).
I am trying to understand if we need surprise hotplug support to remove device and rescan bus through sysfs? I am not able to find any resources related to this. Any leads related to this will be very helpful.
Thanks in advance.