Lines Matching refs:sm
147 void sci_init_sm(struct sci_base_state_machine *sm, in sci_init_sm() argument
152 sm->initial_state_id = initial_state; in sci_init_sm()
153 sm->previous_state_id = initial_state; in sci_init_sm()
154 sm->current_state_id = initial_state; in sci_init_sm()
155 sm->state_table = state_table; in sci_init_sm()
157 handler = sm->state_table[initial_state].enter_state; in sci_init_sm()
159 handler(sm); in sci_init_sm()
163 void sci_change_state(struct sci_base_state_machine *sm, u32 next_state) in sci_change_state() argument
167 handler = sm->state_table[sm->current_state_id].exit_state; in sci_change_state()
169 handler(sm); in sci_change_state()
171 sm->previous_state_id = sm->current_state_id; in sci_change_state()
172 sm->current_state_id = next_state; in sci_change_state()
174 handler = sm->state_table[sm->current_state_id].enter_state; in sci_change_state()
176 handler(sm); in sci_change_state()
595 sci_change_state(&ihost->sm, SCIC_FAILED); in sci_controller_error_handler()
825 if (ihost->sm.current_state_id == SCIC_STARTING) { in sci_controller_transition_to_ready()
830 sci_change_state(&ihost->sm, SCIC_READY); in sci_controller_transition_to_ready()
840 state = iphy->sm.current_state_id; in is_phy_starting()
865 u32 state = iphy->sm.current_state_id; in is_controller_start_complete()
992 if (ihost->sm.current_state_id != SCIC_INITIALIZED) { in sci_controller_start()
994 __func__, ihost->sm.current_state_id); in sci_controller_start()
1040 sci_change_state(&ihost->sm, SCIC_STARTING); in sci_controller_start()
1158 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_stop()
1160 __func__, ihost->sm.current_state_id); in sci_controller_stop()
1165 sci_change_state(&ihost->sm, SCIC_STOPPING); in sci_controller_stop()
1183 switch (ihost->sm.current_state_id) { in sci_controller_reset()
1192 sci_change_state(&ihost->sm, SCIC_RESETTING); in sci_controller_reset()
1196 __func__, ihost->sm.current_state_id); in sci_controller_reset()
1308 static void sci_controller_initial_state_enter(struct sci_base_state_machine *sm) in sci_controller_initial_state_enter() argument
1310 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_initial_state_enter()
1312 sci_change_state(&ihost->sm, SCIC_RESET); in sci_controller_initial_state_enter()
1315 static inline void sci_controller_starting_state_exit(struct sci_base_state_machine *sm) in sci_controller_starting_state_exit() argument
1317 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_starting_state_exit()
1442 static void sci_controller_ready_state_enter(struct sci_base_state_machine *sm) in sci_controller_ready_state_enter() argument
1444 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_ready_state_enter()
1459 static void sci_controller_ready_state_exit(struct sci_base_state_machine *sm) in sci_controller_ready_state_exit() argument
1461 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_ready_state_exit()
1522 static void sci_controller_stopping_state_enter(struct sci_base_state_machine *sm) in sci_controller_stopping_state_enter() argument
1524 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_stopping_state_enter()
1533 static void sci_controller_stopping_state_exit(struct sci_base_state_machine *sm) in sci_controller_stopping_state_exit() argument
1535 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_stopping_state_exit()
1561 static void sci_controller_resetting_state_enter(struct sci_base_state_machine *sm) in sci_controller_resetting_state_enter() argument
1563 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_resetting_state_enter()
1566 sci_change_state(&ihost->sm, SCIC_RESET); in sci_controller_resetting_state_enter()
1597 struct sci_base_state_machine *sm = &ihost->sm; in controller_timeout() local
1605 if (sm->current_state_id == SCIC_STARTING) in controller_timeout()
1607 else if (sm->current_state_id == SCIC_STOPPING) { in controller_timeout()
1608 sci_change_state(sm, SCIC_FAILED); in controller_timeout()
1626 sci_init_sm(&ihost->sm, sci_controller_state_table, SCIC_INITIAL); in sci_controller_construct()
1848 if (current_phy->sm.current_state_id == SCI_PHY_READY && in sci_controller_power_control_queue_insert()
2135 struct sci_base_state_machine *sm = &ihost->sm; in sci_controller_initialize() local
2139 if (ihost->sm.current_state_id != SCIC_RESET) { in sci_controller_initialize()
2141 __func__, ihost->sm.current_state_id); in sci_controller_initialize()
2145 sci_change_state(sm, SCIC_INITIALIZING); in sci_controller_initialize()
2239 sci_change_state(sm, state); in sci_controller_initialize()
2382 switch (ihost->sm.current_state_id) { in sci_controller_link_up()
2398 ihost->sm.current_state_id); in sci_controller_link_up()
2405 switch (ihost->sm.current_state_id) { in sci_controller_link_down()
2417 ihost->sm.current_state_id); in sci_controller_link_down()
2427 (ihost->device_table[index]->sm.current_state_id == SCI_DEV_STOPPING)) in sci_controller_has_remote_devices_stopping()
2437 if (ihost->sm.current_state_id != SCIC_STOPPING) { in sci_controller_remote_device_stopped()
2442 ihost->sm.current_state_id); in sci_controller_remote_device_stopped()
2609 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_start_io()
2611 __func__, ihost->sm.current_state_id); in sci_controller_start_io()
2634 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_terminate_request()
2636 __func__, ihost->sm.current_state_id); in sci_controller_terminate_request()
2674 switch (ihost->sm.current_state_id) { in sci_controller_complete_io()
2687 __func__, ihost->sm.current_state_id); in sci_controller_complete_io()
2697 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_continue_io()
2699 __func__, ihost->sm.current_state_id); in sci_controller_continue_io()
2723 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_start_task()