aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/host.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-03-04 15:10:29 -0500
committerDan Williams <dan.j.williams@intel.com>2011-07-03 06:55:29 -0400
commit6ad31fec306d532031b2f778f8656385df1b9d8f (patch)
treec23640084d82b5ff534fe837300ac64d3a92143e /drivers/scsi/isci/host.h
parent8acaec1593526f922ff46812d99abf9aab5c8b43 (diff)
isci: replace isci_remote_device completion with event queue
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>
Diffstat (limited to 'drivers/scsi/isci/host.h')
-rw-r--r--drivers/scsi/isci/host.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h
index 7c1f0b5cee7d..6a6304c06976 100644
--- a/drivers/scsi/isci/host.h
+++ b/drivers/scsi/isci/host.h
@@ -212,6 +212,19 @@ static inline void wait_for_stop(struct isci_host *ihost)
212 wait_event(ihost->eventq, !test_bit(IHOST_STOP_PENDING, &ihost->flags)); 212 wait_event(ihost->eventq, !test_bit(IHOST_STOP_PENDING, &ihost->flags));
213} 213}
214 214
215static inline void wait_for_device_start(struct isci_host *ihost, struct isci_remote_device *idev)
216{
217 wait_event(ihost->eventq, !test_bit(IDEV_START_PENDING, &idev->flags));
218}
219
220static inline void wait_for_device_stop(struct isci_host *ihost, struct isci_remote_device *idev)
221{
222 /* todo switch to:
223 * wait_event(ihost->eventq, !test_bit(IDEV_STOP_PENDING, &idev->flags));
224 * once devices are statically allocated
225 */
226 wait_for_completion(idev->cmp);
227}
215 228
216/** 229/**
217 * isci_host_from_sas_ha() - This accessor retrieves the isci_host object 230 * isci_host_from_sas_ha() - This accessor retrieves the isci_host object