Lines Matching refs:erp_action
115 zfcp_erp_action_dismiss(&zfcp_sdev->erp_action); in zfcp_erp_action_dismiss_lun()
123 zfcp_erp_action_dismiss(&port->erp_action); in zfcp_erp_action_dismiss_port()
138 zfcp_erp_action_dismiss(&adapter->erp_action); in zfcp_erp_action_dismiss_adapter()
243 struct zfcp_erp_action *erp_action; in zfcp_erp_setup_act() local
260 erp_action = &zfcp_sdev->erp_action; in zfcp_erp_setup_act()
261 WARN_ON_ONCE(erp_action->port != port); in zfcp_erp_setup_act()
262 WARN_ON_ONCE(erp_action->sdev != sdev); in zfcp_erp_setup_act()
274 erp_action = &port->erp_action; in zfcp_erp_setup_act()
275 WARN_ON_ONCE(erp_action->port != port); in zfcp_erp_setup_act()
276 WARN_ON_ONCE(erp_action->sdev != NULL); in zfcp_erp_setup_act()
285 erp_action = &adapter->erp_action; in zfcp_erp_setup_act()
286 WARN_ON_ONCE(erp_action->port != NULL); in zfcp_erp_setup_act()
287 WARN_ON_ONCE(erp_action->sdev != NULL); in zfcp_erp_setup_act()
297 WARN_ON_ONCE(erp_action->adapter != adapter); in zfcp_erp_setup_act()
298 memset(&erp_action->list, 0, sizeof(erp_action->list)); in zfcp_erp_setup_act()
299 memset(&erp_action->timer, 0, sizeof(erp_action->timer)); in zfcp_erp_setup_act()
300 erp_action->step = ZFCP_ERP_STEP_UNINITIALIZED; in zfcp_erp_setup_act()
301 erp_action->fsf_req_id = 0; in zfcp_erp_setup_act()
302 erp_action->action = need; in zfcp_erp_setup_act()
303 erp_action->status = act_status; in zfcp_erp_setup_act()
305 return erp_action; in zfcp_erp_setup_act()
566 zfcp_dbf_rec_run("eraubl1", &adapter->erp_action); in zfcp_erp_adapter_unblock()
573 zfcp_dbf_rec_run("erpubl1", &port->erp_action); in zfcp_erp_port_unblock()
582 zfcp_dbf_rec_run("erlubl1", &sdev_to_zfcp(sdev)->erp_action); in zfcp_erp_lun_unblock()
586 static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) in zfcp_erp_action_to_running() argument
588 list_move(&erp_action->list, &erp_action->adapter->erp_running_head); in zfcp_erp_action_to_running()
589 zfcp_dbf_rec_run("erator1", erp_action); in zfcp_erp_action_to_running()
602 if (req && req->erp_action == act) { in zfcp_erp_strategy_check_fsfreq()
607 req->erp_action = NULL; in zfcp_erp_strategy_check_fsfreq()
623 void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask) in zfcp_erp_notify() argument
625 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_notify()
629 if (zfcp_erp_action_exists(erp_action) == ZFCP_ERP_ACTION_RUNNING) { in zfcp_erp_notify()
630 erp_action->status |= set_mask; in zfcp_erp_notify()
631 zfcp_erp_action_ready(erp_action); in zfcp_erp_notify()
651 static void zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy_memwait() argument
653 setup_timer(&erp_action->timer, zfcp_erp_memwait_handler, in zfcp_erp_strategy_memwait()
654 (unsigned long) erp_action); in zfcp_erp_strategy_memwait()
655 erp_action->timer.expires = jiffies + HZ; in zfcp_erp_strategy_memwait()
656 add_timer(&erp_action->timer); in zfcp_erp_strategy_memwait()
753 static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) in zfcp_erp_adapter_strat_fsf_xconf() argument
757 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_adapter_strat_fsf_xconf()
765 zfcp_erp_action_to_running(erp_action); in zfcp_erp_adapter_strat_fsf_xconf()
767 if (zfcp_fsf_exchange_config_data(erp_action)) { in zfcp_erp_adapter_strat_fsf_xconf()
775 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) in zfcp_erp_adapter_strat_fsf_xconf()
915 static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_port_forced_strategy() argument
917 struct zfcp_port *port = erp_action->port; in zfcp_erp_port_forced_strategy()
920 switch (erp_action->step) { in zfcp_erp_port_forced_strategy()
924 return zfcp_erp_port_forced_strategy_close(erp_action); in zfcp_erp_port_forced_strategy()
935 static int zfcp_erp_port_strategy_close(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy_close() argument
939 retval = zfcp_fsf_close_port(erp_action); in zfcp_erp_port_strategy_close()
942 erp_action->step = ZFCP_ERP_STEP_PORT_CLOSING; in zfcp_erp_port_strategy_close()
948 static int zfcp_erp_port_strategy_open_port(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy_open_port() argument
952 retval = zfcp_fsf_open_port(erp_action); in zfcp_erp_port_strategy_open_port()
955 erp_action->step = ZFCP_ERP_STEP_PORT_OPENING; in zfcp_erp_port_strategy_open_port()
1010 static int zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_port_strategy() argument
1012 struct zfcp_port *port = erp_action->port; in zfcp_erp_port_strategy()
1019 switch (erp_action->step) { in zfcp_erp_port_strategy()
1022 return zfcp_erp_port_strategy_close(erp_action); in zfcp_erp_port_strategy()
1032 if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) in zfcp_erp_port_strategy()
1035 return zfcp_erp_port_strategy_open_common(erp_action); in zfcp_erp_port_strategy()
1046 static int zfcp_erp_lun_strategy_close(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy_close() argument
1048 int retval = zfcp_fsf_close_lun(erp_action); in zfcp_erp_lun_strategy_close()
1051 erp_action->step = ZFCP_ERP_STEP_LUN_CLOSING; in zfcp_erp_lun_strategy_close()
1057 static int zfcp_erp_lun_strategy_open(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy_open() argument
1059 int retval = zfcp_fsf_open_lun(erp_action); in zfcp_erp_lun_strategy_open()
1062 erp_action->step = ZFCP_ERP_STEP_LUN_OPENING; in zfcp_erp_lun_strategy_open()
1068 static int zfcp_erp_lun_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_lun_strategy() argument
1070 struct scsi_device *sdev = erp_action->sdev; in zfcp_erp_lun_strategy()
1073 switch (erp_action->step) { in zfcp_erp_lun_strategy()
1077 return zfcp_erp_lun_strategy_close(erp_action); in zfcp_erp_lun_strategy()
1082 if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) in zfcp_erp_lun_strategy()
1084 return zfcp_erp_lun_strategy_open(erp_action); in zfcp_erp_lun_strategy()
1182 static int zfcp_erp_strategy_check_target(struct zfcp_erp_action *erp_action, in zfcp_erp_strategy_check_target() argument
1185 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_strategy_check_target()
1186 struct zfcp_port *port = erp_action->port; in zfcp_erp_strategy_check_target()
1187 struct scsi_device *sdev = erp_action->sdev; in zfcp_erp_strategy_check_target()
1189 switch (erp_action->action) { in zfcp_erp_strategy_check_target()
1264 static void zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) in zfcp_erp_action_dequeue() argument
1266 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_action_dequeue()
1270 if (erp_action->status & ZFCP_STATUS_ERP_LOWMEM) { in zfcp_erp_action_dequeue()
1272 erp_action->status &= ~ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_action_dequeue()
1275 list_del(&erp_action->list); in zfcp_erp_action_dequeue()
1276 zfcp_dbf_rec_run("eractd1", erp_action); in zfcp_erp_action_dequeue()
1278 switch (erp_action->action) { in zfcp_erp_action_dequeue()
1280 zfcp_sdev = sdev_to_zfcp(erp_action->sdev); in zfcp_erp_action_dequeue()
1288 &erp_action->port->status); in zfcp_erp_action_dequeue()
1293 &erp_action->adapter->status); in zfcp_erp_action_dequeue()
1318 zfcp_dbf_rec_run_lvl(4, "ertru_p", &port->erp_action); in zfcp_erp_try_rport_unblock()
1343 zfcp_dbf_rec_run_lvl(4, "ertru_l", &zsdev->erp_action); in zfcp_erp_try_rport_unblock()
1397 static int zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy_do_action() argument
1399 switch (erp_action->action) { in zfcp_erp_strategy_do_action()
1401 return zfcp_erp_adapter_strategy(erp_action); in zfcp_erp_strategy_do_action()
1403 return zfcp_erp_port_forced_strategy(erp_action); in zfcp_erp_strategy_do_action()
1405 return zfcp_erp_port_strategy(erp_action); in zfcp_erp_strategy_do_action()
1407 return zfcp_erp_lun_strategy(erp_action); in zfcp_erp_strategy_do_action()
1412 static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action) in zfcp_erp_strategy() argument
1416 struct zfcp_adapter *adapter = erp_action->adapter; in zfcp_erp_strategy()
1421 zfcp_erp_strategy_check_fsfreq(erp_action); in zfcp_erp_strategy()
1423 if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED) { in zfcp_erp_strategy()
1424 zfcp_erp_action_dequeue(erp_action); in zfcp_erp_strategy()
1429 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { in zfcp_erp_strategy()
1434 zfcp_erp_action_to_running(erp_action); in zfcp_erp_strategy()
1438 retval = zfcp_erp_strategy_do_action(erp_action); in zfcp_erp_strategy()
1441 if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED) in zfcp_erp_strategy()
1446 if (!(erp_action->status & ZFCP_STATUS_ERP_LOWMEM)) { in zfcp_erp_strategy()
1448 erp_action->status |= ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_strategy()
1453 zfcp_erp_strategy_memwait(erp_action); in zfcp_erp_strategy()
1459 if (erp_action->status & ZFCP_STATUS_ERP_LOWMEM) { in zfcp_erp_strategy()
1461 erp_action->status &= ~ZFCP_STATUS_ERP_LOWMEM; in zfcp_erp_strategy()
1467 retval = zfcp_erp_strategy_check_target(erp_action, retval); in zfcp_erp_strategy()
1468 zfcp_erp_action_dequeue(erp_action); in zfcp_erp_strategy()
1469 retval = zfcp_erp_strategy_statechange(erp_action, retval); in zfcp_erp_strategy()
1473 zfcp_erp_strategy_followup_success(erp_action); in zfcp_erp_strategy()
1475 zfcp_erp_strategy_followup_failed(erp_action); in zfcp_erp_strategy()
1481 zfcp_erp_action_cleanup(erp_action, retval); in zfcp_erp_strategy()