scic_sds_controller_start_next_phy(scic);
- isci_timer_start(scic->timeout_timer, timeout);
+ sci_mod_timer(&scic->timer, timeout);
sci_base_state_machine_change_state(&scic->state_machine,
SCI_BASE_CONTROLLER_STATE_STARTING);
return SCI_FAILURE_INVALID_STATE;
}
- isci_timer_start(scic->timeout_timer, timeout);
+ sci_mod_timer(&scic->timer, timeout);
sci_base_state_machine_change_state(&scic->state_machine,
SCI_BASE_CONTROLLER_STATE_STOPPING);
return SCI_SUCCESS;
del_timer_sync(&ihost->sci.power_control.timer.timer);
+ del_timer_sync(&ihost->sci.timer.timer);
+
isci_timer_list_destroy(ihost);
}
{
struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);
- isci_timer_stop(scic->timeout_timer);
+ sci_del_timer(&scic->timer);
}
#define INTERRUPT_COALESCE_TIMEOUT_BASE_RANGE_LOWER_BOUND_NS 853
{
struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);
- isci_timer_stop(scic->timeout_timer);
+ sci_del_timer(&scic->timer);
}
scic->user_parameters.sds1.no_outbound_task_timeout = 20;
}
+static void controller_timeout(unsigned long data)
+{
+ struct sci_timer *tmr = (struct sci_timer *)data;
+ struct scic_sds_controller *scic = container_of(tmr, typeof(*scic), timer);
+ struct isci_host *ihost = scic_to_ihost(scic);
+ struct sci_base_state_machine *sm = &scic->state_machine;
+ unsigned long flags;
+
+ spin_lock_irqsave(&ihost->scic_lock, flags);
+
+ if (tmr->cancel)
+ goto done;
+
+ if (sm->current_state_id == SCI_BASE_CONTROLLER_STATE_STARTING)
+ scic_sds_controller_transition_to_ready(scic, SCI_FAILURE_TIMEOUT);
+ else if (sm->current_state_id == SCI_BASE_CONTROLLER_STATE_STOPPING) {
+ sci_base_state_machine_change_state(sm, SCI_BASE_CONTROLLER_STATE_FAILED);
+ isci_host_stop_complete(ihost, SCI_FAILURE_TIMEOUT);
+ } else /* / @todo Now what do we want to do in this case? */
+ dev_err(scic_to_dev(scic),
+ "%s: Controller timer fired when controller was not "
+ "in a state being timed.\n",
+ __func__);
+done:
+ spin_unlock_irqrestore(&ihost->scic_lock, flags);
+}
/**
* scic_controller_construct() - This method will attempt to construct a
scic->invalid_phy_mask = 0;
+ sci_init_timer(&scic->timer, controller_timeout);
+
/* Set the default maximum values */
scic->completion_event_entries = SCU_EVENT_COUNT;
scic->completion_queue_entries = SCU_COMPLETION_QUEUE_COUNT;
memcpy(scic_parms, (&scic->oem_parameters), sizeof(*scic_parms));
}
-static void scic_sds_controller_timeout_handler(void *_scic)
-{
- struct scic_sds_controller *scic = _scic;
- struct isci_host *ihost = scic_to_ihost(scic);
- struct sci_base_state_machine *sm = &scic->state_machine;
-
- if (sm->current_state_id == SCI_BASE_CONTROLLER_STATE_STARTING)
- scic_sds_controller_transition_to_ready(scic, SCI_FAILURE_TIMEOUT);
- else if (sm->current_state_id == SCI_BASE_CONTROLLER_STATE_STOPPING) {
- sci_base_state_machine_change_state(sm, SCI_BASE_CONTROLLER_STATE_FAILED);
- isci_host_stop_complete(ihost, SCI_FAILURE_TIMEOUT);
- } else /* / @todo Now what do we want to do in this case? */
- dev_err(scic_to_dev(scic),
- "%s: Controller timer fired when controller was not "
- "in a state being timed.\n",
- __func__);
-}
-
static enum sci_status scic_sds_controller_initialize_phy_startup(struct scic_sds_controller *scic)
{
struct isci_host *ihost = scic_to_ihost(scic);
sci_base_state_machine_change_state(sm, SCI_BASE_CONTROLLER_STATE_INITIALIZING);
- scic->timeout_timer = isci_timer_create(ihost, scic,
- scic_sds_controller_timeout_handler);
-
scic_sds_controller_initialize_phy_startup(scic);
scic_sds_controller_initialize_power_control(scic);