isci: replace isci_remote_device completion with event queue
authorDan Williams <dan.j.williams@intel.com>
Fri, 4 Mar 2011 20:10:29 +0000 (12:10 -0800)
committerDan Williams <dan.j.williams@intel.com>
Sun, 3 Jul 2011 10:55:29 +0000 (03:55 -0700)
Replace the device completion infrastructure with the controller wide
event queue.  There was a potential for the stop and ready notifications
to corrupt each other, now that cannot happen.

The stop pending flag cannot be used until devices are statically
allocated.  We temporarily need to maintain a completion to handle
waiting for an object that has disappeared, but we can at least stop
scribbling on freed memory.

A future change will also get rid of the "stopping" state as it should
not be exposed to the rest of the driver.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/scsi/isci/events.c
drivers/scsi/isci/host.c
drivers/scsi/isci/host.h
drivers/scsi/isci/remote_device.c
drivers/scsi/isci/remote_device.h

index c5cbaed..9d58e45 100644 (file)
@@ -526,7 +526,7 @@ void isci_event_remote_device_start_complete(
 /**
  * isci_event_remote_device_stop_complete() - This user callback method will
  *    inform the user that a stop operation has completed.
- * @controller: This parameter specifies the core controller associated with
+ * @scic: This parameter specifies the core controller associated with
  *    the completion callback.
  * @remote_device: This parameter specifies the remote device associated with
  *    the completion callback.
@@ -534,28 +534,20 @@ void isci_event_remote_device_start_complete(
  *    operation.
  *
  */
-void isci_event_remote_device_stop_complete(
-       struct scic_sds_controller *controller,
-       struct scic_sds_remote_device *remote_device,
-       enum sci_status completion_status)
+void isci_event_remote_device_stop_complete(struct scic_sds_controller *scic,
+                                           struct scic_sds_remote_device *sci_dev,
+                                           enum sci_status completion_status)
 {
-       struct isci_host *isci_host;
-       struct isci_remote_device *isci_device;
+       struct isci_host *ihost;
+       struct isci_remote_device *idev;
 
-       isci_host =
-               (struct isci_host *)sci_object_get_association(controller);
+       ihost = sci_object_get_association(scic);
+       idev = sci_object_get_association(sci_dev);
 
-       isci_device =
-               (struct isci_remote_device *)sci_object_get_association(
-                       remote_device
-                       );
-
-       dev_dbg(&isci_host->pdev->dev,
-               "%s: isci_device = %p\n", __func__, isci_device);
-
-       isci_remote_device_stop_complete(
-               isci_host, isci_device, completion_status);
+       dev_dbg(&ihost->pdev->dev,
+               "%s: idev = %p\n", __func__, idev);
 
+       isci_remote_device_stop_complete(ihost, idev, completion_status);
 }
 
 /**
index da0c0da..8d25566 100644 (file)
@@ -345,7 +345,7 @@ void isci_host_deinit(struct isci_host *ihost)
 
                list_for_each_entry_safe(idev, d, &port->remote_dev_list, node) {
                        isci_remote_device_change_state(idev, isci_stopping);
-                       isci_remote_device_stop(idev);
+                       isci_remote_device_stop(ihost, idev);
                }
        }
 
Simple merge
Simple merge
Simple merge