summaryrefslogtreecommitdiff
path: root/drivers/scsi/isci/host.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-03-02 11:49:26 -0800
committerDan Williams <dan.j.williams@intel.com>2011-07-03 03:55:28 -0700
commit7c40a8035815479c7c12ab0cdcea71e0f4c3a9c8 (patch)
tree43290f7b96374f0ff8e80ad5e8620f3dc8242f1a /drivers/scsi/isci/host.c
parent150fc6fc725055b400a8865e6785dc8dd0a2225d (diff)
downloadlwn-7c40a8035815479c7c12ab0cdcea71e0f4c3a9c8.tar.gz
lwn-7c40a8035815479c7c12ab0cdcea71e0f4c3a9c8.zip
isci: rework timer api
Prepare the timer api for the arrival of dynamic creation and destruction events from the core. It pretended to do this previously but the core to date only used it in a static init-time only fashion. This is an interim fix until a cleaner event queue can be developed. 1/ make all locking external to the api (add WARN_ONCE to verify) 2/ add a timer_destroy interface (to be used by the core) 3/ use del_timer_sync() prior to deallocating timer data 4/ delete the "timer_list" indirection, we only have timers allocated for the isci_host 5/ fix detection of timer list allocation errors Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r--drivers/scsi/isci/host.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index d8d6f67bd69c..1bc91f2b4f93 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -349,9 +349,14 @@ void isci_host_deinit(struct isci_host *ihost)
}
set_bit(IHOST_STOP_PENDING, &ihost->flags);
+
+ spin_lock_irq(&ihost->scic_lock);
scic_controller_stop(scic, SCIC_CONTROLLER_STOP_TIMEOUT);
+ spin_unlock_irq(&ihost->scic_lock);
+
wait_for_stop(ihost);
scic_controller_reset(scic);
+ isci_timer_list_destroy(ihost);
}
static void __iomem *scu_base(struct isci_host *isci_host)
@@ -370,8 +375,6 @@ static void __iomem *smu_base(struct isci_host *isci_host)
return pcim_iomap_table(pdev)[SCI_SMU_BAR * 2] + SCI_SMU_BAR_SIZE * id;
}
-#define SCI_MAX_TIMER_COUNT 25
-
int isci_host_init(struct isci_host *isci_host)
{
int err = 0;
@@ -382,11 +385,7 @@ int isci_host_init(struct isci_host *isci_host)
union scic_oem_parameters scic_oem_params;
union scic_user_parameters scic_user_params;
- INIT_LIST_HEAD(&isci_host->timer_list_struct.timers);
- isci_timer_list_construct(
- &isci_host->timer_list_struct,
- SCI_MAX_TIMER_COUNT
- );
+ isci_timer_list_construct(isci_host);
controller = scic_controller_alloc(&isci_host->pdev->dev);
@@ -473,7 +472,17 @@ int isci_host_init(struct isci_host *isci_host)
}
}
+ tasklet_init(&isci_host->completion_tasklet,
+ isci_host_completion_routine, (unsigned long)isci_host);
+
+ INIT_LIST_HEAD(&(isci_host->mdl_struct_list));
+
+ INIT_LIST_HEAD(&isci_host->requests_to_complete);
+ INIT_LIST_HEAD(&isci_host->requests_to_abort);
+
+ spin_lock_irq(&isci_host->scic_lock);
status = scic_controller_initialize(isci_host->core_controller);
+ spin_unlock_irq(&isci_host->scic_lock);
if (status != SCI_SUCCESS) {
dev_warn(&isci_host->pdev->dev,
"%s: scic_controller_initialize failed -"
@@ -482,17 +491,8 @@ int isci_host_init(struct isci_host *isci_host)
return -ENODEV;
}
- tasklet_init(&isci_host->completion_tasklet,
- isci_host_completion_routine, (unsigned long)isci_host);
-
- INIT_LIST_HEAD(&(isci_host->mdl_struct_list));
-
- INIT_LIST_HEAD(&isci_host->requests_to_complete);
- INIT_LIST_HEAD(&isci_host->requests_to_abort);
-
/* populate mdl with dma memory. scu_mdl_allocate_coherent() */
err = isci_host_mdl_allocate_coherent(isci_host);
-
if (err)
return err;