Lines Matching refs:erp_action

96 		zfcp_erp_action_dismiss(&zfcp_sdev->erp_action);  in zfcp_erp_action_dismiss_lun()
104 zfcp_erp_action_dismiss(&port->erp_action); in zfcp_erp_action_dismiss_port()
116 zfcp_erp_action_dismiss(&adapter->erp_action); in zfcp_erp_action_dismiss_adapter()
181 struct zfcp_erp_action *erp_action; in zfcp_erp_setup_act() local
192 erp_action = &zfcp_sdev->erp_action; in zfcp_erp_setup_act()
193 memset(erp_action, 0, sizeof(struct zfcp_erp_action)); in zfcp_erp_setup_act()
194 erp_action->port = port; in zfcp_erp_setup_act()
195 erp_action->sdev = sdev; in zfcp_erp_setup_act()
207 erp_action = &port->erp_action; in zfcp_erp_setup_act()
208 memset(erp_action, 0, sizeof(struct zfcp_erp_action)); in zfcp_erp_setup_act()
209 erp_action->port = port; in zfcp_erp_setup_act()
218 erp_action = &adapter->erp_action; in zfcp_erp_setup_act()
219 memset(erp_action, 0, sizeof(struct zfcp_erp_action)); in zfcp_erp_setup_act()
229 erp_action->adapter = adapter; in zfcp_erp_setup_act()
230 erp_action->action = need; in zfcp_erp_setup_act()
231 erp_action->status = act_status; in zfcp_erp_setup_act()
233 return erp_action; in zfcp_erp_setup_act()
485 zfcp_dbf_rec_run("eraubl1", &adapter->erp_action); in zfcp_erp_adapter_unblock()
492 zfcp_dbf_rec_run("erpubl1", &port->erp_action); in zfcp_erp_port_unblock()
501 zfcp_dbf_rec_run("erlubl1", &sdev_to_zfcp(sdev)->erp_action); in zfcp_erp_lun_unblock()
505 static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) in zfcp_erp_action_to_running() argument
507 list_move(&erp_action->list, &erp_action->adapter->erp_running_head); in zfcp_erp_action_to_running()
508 zfcp_dbf_rec_run("erator1", erp_action); in zfcp_erp_action_to_running()
521 if (req && req->erp_action == act) { in zfcp_erp_strategy_check_fsfreq()
526 req->erp_action = NULL; in zfcp_erp_strategy_check_fsfreq()
542 void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask) in zfcp_erp_notify() argument
544 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_notify()
548 if (zfcp_erp_action_exists(erp_action) == ZFCP_ERP_ACTION_RUNNING) { in zfcp_erp_notify()
549 erp_action->status |= set_mask; in zfcp_erp_notify()
550 zfcp_erp_action_ready(erp_action); in zfcp_erp_notify()
570 static void zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy_memwait() argument
572 init_timer(&erp_action->timer); in zfcp_erp_strategy_memwait()
573 erp_action->timer.function = zfcp_erp_memwait_handler; in zfcp_erp_strategy_memwait()
574 erp_action->timer.data = (unsigned long) erp_action; in zfcp_erp_strategy_memwait()
575 erp_action->timer.expires = jiffies + HZ; in zfcp_erp_strategy_memwait()
576 add_timer(&erp_action->timer); in zfcp_erp_strategy_memwait()
657 static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) in zfcp_erp_adapter_strat_fsf_xconf() argument
661 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_adapter_strat_fsf_xconf()
669 zfcp_erp_action_to_running(erp_action); in zfcp_erp_adapter_strat_fsf_xconf()
671 if (zfcp_fsf_exchange_config_data(erp_action)) { in zfcp_erp_adapter_strat_fsf_xconf()
679 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) in zfcp_erp_adapter_strat_fsf_xconf()
824 static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_port_forced_strategy() argument
826 struct zfcp_port *port = erp_action->port; in zfcp_erp_port_forced_strategy()
829 switch (erp_action->step) { in zfcp_erp_port_forced_strategy()
834 return zfcp_erp_port_forced_strategy_close(erp_action); in zfcp_erp_port_forced_strategy()
845 static int zfcp_erp_port_strategy_close(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy_close() argument
849 retval = zfcp_fsf_close_port(erp_action); in zfcp_erp_port_strategy_close()
852 erp_action->step = ZFCP_ERP_STEP_PORT_CLOSING; in zfcp_erp_port_strategy_close()
858 static int zfcp_erp_port_strategy_open_port(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy_open_port() argument
862 retval = zfcp_fsf_open_port(erp_action); in zfcp_erp_port_strategy_open_port()
865 erp_action->step = ZFCP_ERP_STEP_PORT_OPENING; in zfcp_erp_port_strategy_open_port()
920 static int zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy() argument
922 struct zfcp_port *port = erp_action->port; in zfcp_erp_port_strategy()
929 switch (erp_action->step) { in zfcp_erp_port_strategy()
933 return zfcp_erp_port_strategy_close(erp_action); in zfcp_erp_port_strategy()
943 if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) in zfcp_erp_port_strategy()
946 return zfcp_erp_port_strategy_open_common(erp_action); in zfcp_erp_port_strategy()
958 static int zfcp_erp_lun_strategy_close(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy_close() argument
960 int retval = zfcp_fsf_close_lun(erp_action); in zfcp_erp_lun_strategy_close()
963 erp_action->step = ZFCP_ERP_STEP_LUN_CLOSING; in zfcp_erp_lun_strategy_close()
969 static int zfcp_erp_lun_strategy_open(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy_open() argument
971 int retval = zfcp_fsf_open_lun(erp_action); in zfcp_erp_lun_strategy_open()
974 erp_action->step = ZFCP_ERP_STEP_LUN_OPENING; in zfcp_erp_lun_strategy_open()
980 static int zfcp_erp_lun_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy() argument
982 struct scsi_device *sdev = erp_action->sdev; in zfcp_erp_lun_strategy()
985 switch (erp_action->step) { in zfcp_erp_lun_strategy()
989 return zfcp_erp_lun_strategy_close(erp_action); in zfcp_erp_lun_strategy()
994 if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) in zfcp_erp_lun_strategy()
996 return zfcp_erp_lun_strategy_open(erp_action); in zfcp_erp_lun_strategy()
1094 static int zfcp_erp_strategy_check_target(struct zfcp_erp_action *erp_action, in zfcp_erp_strategy_check_target() argument
1097 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_strategy_check_target()
1098 struct zfcp_port *port = erp_action->port; in zfcp_erp_strategy_check_target()
1099 struct scsi_device *sdev = erp_action->sdev; in zfcp_erp_strategy_check_target()
1101 switch (erp_action->action) { in zfcp_erp_strategy_check_target()
1176 static void zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) in zfcp_erp_action_dequeue() argument
1178 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_action_dequeue()
1182 if (erp_action->status & ZFCP_STATUS_ERP_LOWMEM) { in zfcp_erp_action_dequeue()
1184 erp_action->status &= ~ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_action_dequeue()
1187 list_del(&erp_action->list); in zfcp_erp_action_dequeue()
1188 zfcp_dbf_rec_run("eractd1", erp_action); in zfcp_erp_action_dequeue()
1190 switch (erp_action->action) { in zfcp_erp_action_dequeue()
1192 zfcp_sdev = sdev_to_zfcp(erp_action->sdev); in zfcp_erp_action_dequeue()
1200 &erp_action->port->status); in zfcp_erp_action_dequeue()
1205 &erp_action->adapter->status); in zfcp_erp_action_dequeue()
1243 static int zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy_do_action() argument
1245 switch (erp_action->action) { in zfcp_erp_strategy_do_action()
1247 return zfcp_erp_adapter_strategy(erp_action); in zfcp_erp_strategy_do_action()
1249 return zfcp_erp_port_forced_strategy(erp_action); in zfcp_erp_strategy_do_action()
1251 return zfcp_erp_port_strategy(erp_action); in zfcp_erp_strategy_do_action()
1253 return zfcp_erp_lun_strategy(erp_action); in zfcp_erp_strategy_do_action()
1258 static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy() argument
1262 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_strategy()
1267 zfcp_erp_strategy_check_fsfreq(erp_action); in zfcp_erp_strategy()
1269 if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED) { in zfcp_erp_strategy()
1270 zfcp_erp_action_dequeue(erp_action); in zfcp_erp_strategy()
1275 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { in zfcp_erp_strategy()
1280 zfcp_erp_action_to_running(erp_action); in zfcp_erp_strategy()
1284 retval = zfcp_erp_strategy_do_action(erp_action); in zfcp_erp_strategy()
1287 if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED) in zfcp_erp_strategy()
1292 if (!(erp_action->status & ZFCP_STATUS_ERP_LOWMEM)) { in zfcp_erp_strategy()
1294 erp_action->status |= ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_strategy()
1299 zfcp_erp_strategy_memwait(erp_action); in zfcp_erp_strategy()
1305 if (erp_action->status & ZFCP_STATUS_ERP_LOWMEM) { in zfcp_erp_strategy()
1307 erp_action->status &= ~ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_strategy()
1313 retval = zfcp_erp_strategy_check_target(erp_action, retval); in zfcp_erp_strategy()
1314 zfcp_erp_action_dequeue(erp_action); in zfcp_erp_strategy()
1315 retval = zfcp_erp_strategy_statechange(erp_action, retval); in zfcp_erp_strategy()
1319 zfcp_erp_strategy_followup_success(erp_action); in zfcp_erp_strategy()
1321 zfcp_erp_strategy_followup_failed(erp_action); in zfcp_erp_strategy()
1327 zfcp_erp_action_cleanup(erp_action, retval); in zfcp_erp_strategy()