Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08c031e4 authored by Jeff Skirvin's avatar Jeff Skirvin Committed by Dan Williams
Browse files

isci: Make sure all TCs are terminated and cleaned in LUN reset.



In the libsas error path, SATA disks require extra handling in
libata to recover operation.  However, libsas expects to be able
to immediately recover all outstanding I/O once the error handler
escalation stops.  This patch fixes the condition where the libata
error handler is scheduled for operation but libsas has already
deleted the outstanding sas_tasks.

Signed-off-by: default avatarJeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 9608b640
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -439,16 +439,18 @@ int isci_task_lu_reset(struct domain_device *dev, u8 *lun)
		goto out;
	}

	if (dev_is_sata(dev)) {
		sas_ata_schedule_reset(dev);
		ret = TMF_RESP_FUNC_COMPLETE;
	} else {
	/* Suspend the RNC, kill all TCs */
	if (isci_remote_device_suspend_terminate(ihost, idev, NULL)
	    != SCI_SUCCESS) {
		/* The suspend/terminate only fails if isci_get_device fails */
		ret = TMF_RESP_FUNC_FAILED;
		goto out;
	}
	/* All pending I/Os have been terminated and cleaned up. */
	if (dev_is_sata(dev)) {
		sas_ata_schedule_reset(dev);
		ret = TMF_RESP_FUNC_COMPLETE;
	} else {
		/* Send the task management part of the reset. */
		ret = isci_task_send_lu_reset_sas(ihost, idev, lun);
	}