Lines Matching refs:erp_action

107 		zfcp_erp_action_dismiss(&zfcp_sdev->erp_action);  in zfcp_erp_action_dismiss_lun()
115 zfcp_erp_action_dismiss(&port->erp_action); in zfcp_erp_action_dismiss_port()
130 zfcp_erp_action_dismiss(&adapter->erp_action); in zfcp_erp_action_dismiss_adapter()
238 struct zfcp_erp_action *erp_action; in zfcp_erp_setup_act() local
249 erp_action = &zfcp_sdev->erp_action; in zfcp_erp_setup_act()
250 WARN_ON_ONCE(erp_action->port != port); in zfcp_erp_setup_act()
251 WARN_ON_ONCE(erp_action->sdev != sdev); in zfcp_erp_setup_act()
263 erp_action = &port->erp_action; in zfcp_erp_setup_act()
264 WARN_ON_ONCE(erp_action->port != port); in zfcp_erp_setup_act()
265 WARN_ON_ONCE(erp_action->sdev != NULL); in zfcp_erp_setup_act()
274 erp_action = &adapter->erp_action; in zfcp_erp_setup_act()
275 WARN_ON_ONCE(erp_action->port != NULL); in zfcp_erp_setup_act()
276 WARN_ON_ONCE(erp_action->sdev != NULL); in zfcp_erp_setup_act()
286 WARN_ON_ONCE(erp_action->adapter != adapter); in zfcp_erp_setup_act()
287 memset(&erp_action->list, 0, sizeof(erp_action->list)); in zfcp_erp_setup_act()
288 memset(&erp_action->timer, 0, sizeof(erp_action->timer)); in zfcp_erp_setup_act()
289 erp_action->step = ZFCP_ERP_STEP_UNINITIALIZED; in zfcp_erp_setup_act()
290 erp_action->fsf_req_id = 0; in zfcp_erp_setup_act()
291 erp_action->action = need; in zfcp_erp_setup_act()
292 erp_action->status = act_status; in zfcp_erp_setup_act()
294 return erp_action; in zfcp_erp_setup_act()
548 zfcp_dbf_rec_run("eraubl1", &adapter->erp_action); in zfcp_erp_adapter_unblock()
556 zfcp_dbf_rec_run("erpubl1", &port->erp_action); in zfcp_erp_port_unblock()
566 zfcp_dbf_rec_run("erlubl1", &sdev_to_zfcp(sdev)->erp_action); in zfcp_erp_lun_unblock()
570 static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) in zfcp_erp_action_to_running() argument
572 list_move(&erp_action->list, &erp_action->adapter->erp_running_head); in zfcp_erp_action_to_running()
573 zfcp_dbf_rec_run("erator1", erp_action); in zfcp_erp_action_to_running()
586 if (req && req->erp_action == act) { in zfcp_erp_strategy_check_fsfreq()
591 req->erp_action = NULL; in zfcp_erp_strategy_check_fsfreq()
607 void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask) in zfcp_erp_notify() argument
609 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_notify()
613 if (zfcp_erp_action_is_running(erp_action)) { in zfcp_erp_notify()
614 erp_action->status |= set_mask; in zfcp_erp_notify()
615 zfcp_erp_action_ready(erp_action); in zfcp_erp_notify()
627 struct zfcp_erp_action *act = fsf_req->erp_action; in zfcp_erp_timeout_handler()
639 static void zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy_memwait() argument
641 timer_setup(&erp_action->timer, zfcp_erp_memwait_handler, 0); in zfcp_erp_strategy_memwait()
642 erp_action->timer.expires = jiffies + HZ; in zfcp_erp_strategy_memwait()
643 add_timer(&erp_action->timer); in zfcp_erp_strategy_memwait()
726 static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) in zfcp_erp_adapter_strat_fsf_xconf() argument
730 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_adapter_strat_fsf_xconf()
738 zfcp_erp_action_to_running(erp_action); in zfcp_erp_adapter_strat_fsf_xconf()
740 if (zfcp_fsf_exchange_config_data(erp_action)) { in zfcp_erp_adapter_strat_fsf_xconf()
748 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) in zfcp_erp_adapter_strat_fsf_xconf()
888 static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_port_forced_strategy() argument
890 struct zfcp_port *port = erp_action->port; in zfcp_erp_port_forced_strategy()
893 switch (erp_action->step) { in zfcp_erp_port_forced_strategy()
897 return zfcp_erp_port_forced_strategy_close(erp_action); in zfcp_erp_port_forced_strategy()
908 static int zfcp_erp_port_strategy_close(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy_close() argument
912 retval = zfcp_fsf_close_port(erp_action); in zfcp_erp_port_strategy_close()
915 erp_action->step = ZFCP_ERP_STEP_PORT_CLOSING; in zfcp_erp_port_strategy_close()
921 static int zfcp_erp_port_strategy_open_port(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy_open_port() argument
925 retval = zfcp_fsf_open_port(erp_action); in zfcp_erp_port_strategy_open_port()
928 erp_action->step = ZFCP_ERP_STEP_PORT_OPENING; in zfcp_erp_port_strategy_open_port()
983 static int zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy() argument
985 struct zfcp_port *port = erp_action->port; in zfcp_erp_port_strategy()
992 switch (erp_action->step) { in zfcp_erp_port_strategy()
995 return zfcp_erp_port_strategy_close(erp_action); in zfcp_erp_port_strategy()
1005 if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) in zfcp_erp_port_strategy()
1008 return zfcp_erp_port_strategy_open_common(erp_action); in zfcp_erp_port_strategy()
1019 static int zfcp_erp_lun_strategy_close(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy_close() argument
1021 int retval = zfcp_fsf_close_lun(erp_action); in zfcp_erp_lun_strategy_close()
1024 erp_action->step = ZFCP_ERP_STEP_LUN_CLOSING; in zfcp_erp_lun_strategy_close()
1030 static int zfcp_erp_lun_strategy_open(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy_open() argument
1032 int retval = zfcp_fsf_open_lun(erp_action); in zfcp_erp_lun_strategy_open()
1035 erp_action->step = ZFCP_ERP_STEP_LUN_OPENING; in zfcp_erp_lun_strategy_open()
1041 static int zfcp_erp_lun_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy() argument
1043 struct scsi_device *sdev = erp_action->sdev; in zfcp_erp_lun_strategy()
1046 switch (erp_action->step) { in zfcp_erp_lun_strategy()
1050 return zfcp_erp_lun_strategy_close(erp_action); in zfcp_erp_lun_strategy()
1055 if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) in zfcp_erp_lun_strategy()
1057 return zfcp_erp_lun_strategy_open(erp_action); in zfcp_erp_lun_strategy()
1155 static int zfcp_erp_strategy_check_target(struct zfcp_erp_action *erp_action, in zfcp_erp_strategy_check_target() argument
1158 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_strategy_check_target()
1159 struct zfcp_port *port = erp_action->port; in zfcp_erp_strategy_check_target()
1160 struct scsi_device *sdev = erp_action->sdev; in zfcp_erp_strategy_check_target()
1162 switch (erp_action->action) { in zfcp_erp_strategy_check_target()
1237 static void zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) in zfcp_erp_action_dequeue() argument
1239 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_action_dequeue()
1243 if (erp_action->status & ZFCP_STATUS_ERP_LOWMEM) { in zfcp_erp_action_dequeue()
1245 erp_action->status &= ~ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_action_dequeue()
1248 list_del(&erp_action->list); in zfcp_erp_action_dequeue()
1249 zfcp_dbf_rec_run("eractd1", erp_action); in zfcp_erp_action_dequeue()
1251 switch (erp_action->action) { in zfcp_erp_action_dequeue()
1253 zfcp_sdev = sdev_to_zfcp(erp_action->sdev); in zfcp_erp_action_dequeue()
1261 &erp_action->port->status); in zfcp_erp_action_dequeue()
1266 &erp_action->adapter->status); in zfcp_erp_action_dequeue()
1291 zfcp_dbf_rec_run_lvl(4, "ertru_p", &port->erp_action); in zfcp_erp_try_rport_unblock()
1313 zfcp_dbf_rec_run_lvl(4, "ertru_l", &zsdev->erp_action); in zfcp_erp_try_rport_unblock()
1367 static int zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy_do_action() argument
1369 switch (erp_action->action) { in zfcp_erp_strategy_do_action()
1371 return zfcp_erp_adapter_strategy(erp_action); in zfcp_erp_strategy_do_action()
1373 return zfcp_erp_port_forced_strategy(erp_action); in zfcp_erp_strategy_do_action()
1375 return zfcp_erp_port_strategy(erp_action); in zfcp_erp_strategy_do_action()
1377 return zfcp_erp_lun_strategy(erp_action); in zfcp_erp_strategy_do_action()
1382 static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy() argument
1386 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_strategy()
1391 zfcp_erp_strategy_check_fsfreq(erp_action); in zfcp_erp_strategy()
1393 if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED) { in zfcp_erp_strategy()
1394 zfcp_erp_action_dequeue(erp_action); in zfcp_erp_strategy()
1399 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { in zfcp_erp_strategy()
1404 zfcp_erp_action_to_running(erp_action); in zfcp_erp_strategy()
1408 retval = zfcp_erp_strategy_do_action(erp_action); in zfcp_erp_strategy()
1411 if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED) in zfcp_erp_strategy()
1416 if (!(erp_action->status & ZFCP_STATUS_ERP_LOWMEM)) { in zfcp_erp_strategy()
1418 erp_action->status |= ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_strategy()
1423 zfcp_erp_strategy_memwait(erp_action); in zfcp_erp_strategy()
1429 if (erp_action->status & ZFCP_STATUS_ERP_LOWMEM) { in zfcp_erp_strategy()
1431 erp_action->status &= ~ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_strategy()
1437 retval = zfcp_erp_strategy_check_target(erp_action, retval); in zfcp_erp_strategy()
1438 zfcp_erp_action_dequeue(erp_action); in zfcp_erp_strategy()
1439 retval = zfcp_erp_strategy_statechange(erp_action, retval); in zfcp_erp_strategy()
1443 zfcp_erp_strategy_followup_success(erp_action); in zfcp_erp_strategy()
1445 zfcp_erp_strategy_followup_failed(erp_action); in zfcp_erp_strategy()
1451 zfcp_erp_action_cleanup(erp_action, retval); in zfcp_erp_strategy()