summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/host.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-02-18 09:25:07 -0800
committerDan Williams <dan.j.williams@intel.com>2011-07-03 03:55:27 -0700
commit0cf89d1d27c1bdd0abf1714096f98ea44704dcff (patch)
tree0bee9fa05aba8a6e1fe4b6b50a3bfc6d0793356f /drivers/scsi/isci/host.h
parentc7ef4031f01301298bbaba2666740183cd399f8c (diff)
isci: cleanup "starting" state handling
The lldd actively disallows requests in the "starting" state. Retrying or holding off commands in this state is sub-optimal: 1/ it adds another state check to the fast path 2/ retrying can cause libsas to give up However, isci's ->lldd_dev_found() routine already waits for controller start to complete before allowing further progress. Checking the "starting" state in isci_task_execute_task and the isr is redundant and misleading. Clean this up and introduce a controller-wide event queue to start reeling in "completion" proliferation in the driver. The "stopping" state cleanups are in a similar vein, rely on the the isr and other paths being precluded from occurring rather than implementing state checking logic. Reported-by: Christoph Hellwig <hch@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> 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.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h
index 421d3debdae..26768c5bbe0 100644
--- a/drivers/scsi/isci/host.h
+++ b/drivers/scsi/isci/host.h
@@ -109,13 +109,15 @@ struct isci_host {
u8 sas_addr[SAS_ADDR_SIZE];
enum isci_status status;
+ #define IHOST_START_PENDING 0
+ #define IHOST_STOP_PENDING 1
+ unsigned long flags;
+ wait_queue_head_t eventq;
struct Scsi_Host *shost;
struct tasklet_struct completion_tasklet;
struct list_head mdl_struct_list;
struct list_head requests_to_complete;
struct list_head requests_to_abort;
- struct completion stop_complete;
- struct completion start_complete;
spinlock_t scic_lock;
struct isci_host *next;
};
@@ -202,6 +204,17 @@ static inline void isci_host_can_dequeue(
spin_unlock_irqrestore(&isci_host->queue_lock, flags);
}
+static inline void wait_for_start(struct isci_host *ihost)
+{
+ wait_event(ihost->eventq, !test_bit(IHOST_START_PENDING, &ihost->flags));
+}
+
+static inline void wait_for_stop(struct isci_host *ihost)
+{
+ wait_event(ihost->eventq, !test_bit(IHOST_STOP_PENDING, &ihost->flags));
+}
+
+
/**
* isci_host_from_sas_ha() - This accessor retrieves the isci_host object
* reference from the Linux sas_ha_struct reference.