From aa2356632e3efd2da5dffc3bfa7ae430487603fa Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 25 Aug 2019 01:57:50 +0000 Subject: [PATCH] qla2x00t-32gbit: Allow NVMe IO to resume with short cable pull Current driver report dev_loss_tmo to 0 for NVMe devices with short cable pull. This causes NVMe controller to be freed along with NVMe namespace. The side affect is IO would stop. By not setting dev_loss_tmo to 0, NVMe namespace would stay until cable is plugged back in. This allows IO to resume afterward. [ commit 03cc44bf682af289d6536eb911e928b415bd0e1f upstream ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8535 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_nvme.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qla2x00t-32gbit/qla_nvme.c b/qla2x00t-32gbit/qla_nvme.c index aaca5ca1e..e4ba0381a 100644 --- a/qla2x00t-32gbit/qla_nvme.c +++ b/qla2x00t-32gbit/qla_nvme.c @@ -664,7 +664,8 @@ void qla_nvme_unregister_remote_port(struct fc_port *fcport) __func__, fcport, fcport->port_name); #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) - nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); + if (test_bit(PFLG_DRIVER_REMOVING, &fcport->vha->pci_flags)) + nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); #endif init_completion(&fcport->nvme_del_done); ret = nvme_fc_unregister_remoteport(fcport->nvme_remote_port);