diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-07-13 09:06:09 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-07-30 09:49:57 -0400 |
commit | 85600f7f8370fe5b4be0debd8b401de7986b52ae (patch) | |
tree | 04b35f05814a74b3b1e5e71abd722ee164b3ca9c /drivers/s390/scsi/zfcp_erp.c | |
parent | ddb3e0c111fed0a8bf74884dc918274acec2b618 (diff) |
[SCSI] zfcp: Fix erp escalation procedure
If an action fails, retry it until the erp count exceeds the
threshold. If there is something fundamentally wrong, the FSF layer
will trigger a more appropriate action depending on the FSF status
codes.
The followup for successful actions is a different followup than
retrying failed actions, so split the code two functions to make this
clear.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_erp.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 0a7c6aef532a..b5562f952654 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -553,40 +553,35 @@ static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear, | |||
553 | _zfcp_erp_unit_reopen(unit, clear, id, ref); | 553 | _zfcp_erp_unit_reopen(unit, clear, id, ref); |
554 | } | 554 | } |
555 | 555 | ||
556 | static void zfcp_erp_strategy_followup_actions(struct zfcp_erp_action *act) | 556 | static void zfcp_erp_strategy_followup_failed(struct zfcp_erp_action *act) |
557 | { | 557 | { |
558 | struct zfcp_adapter *adapter = act->adapter; | ||
559 | struct zfcp_port *port = act->port; | ||
560 | struct zfcp_unit *unit = act->unit; | ||
561 | u32 status = act->status; | ||
562 | |||
563 | /* initiate follow-up actions depending on success of finished action */ | ||
564 | switch (act->action) { | 558 | switch (act->action) { |
565 | |||
566 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | 559 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
567 | if (status == ZFCP_ERP_SUCCEEDED) | 560 | _zfcp_erp_adapter_reopen(act->adapter, 0, "ersff_1", NULL); |
568 | _zfcp_erp_port_reopen_all(adapter, 0, "ersfa_1", NULL); | ||
569 | else | ||
570 | _zfcp_erp_adapter_reopen(adapter, 0, "ersfa_2", NULL); | ||
571 | break; | 561 | break; |
572 | |||
573 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | 562 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
574 | if (status == ZFCP_ERP_SUCCEEDED) | 563 | _zfcp_erp_port_forced_reopen(act->port, 0, "ersff_2", NULL); |
575 | _zfcp_erp_port_reopen(port, 0, "ersfa_3", NULL); | ||
576 | else | ||
577 | _zfcp_erp_adapter_reopen(adapter, 0, "ersfa_4", NULL); | ||
578 | break; | 564 | break; |
579 | |||
580 | case ZFCP_ERP_ACTION_REOPEN_PORT: | 565 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
581 | if (status == ZFCP_ERP_SUCCEEDED) | 566 | _zfcp_erp_port_reopen(act->port, 0, "ersff_3", NULL); |
582 | _zfcp_erp_unit_reopen_all(port, 0, "ersfa_5", NULL); | ||
583 | else | ||
584 | _zfcp_erp_port_forced_reopen(port, 0, "ersfa_6", NULL); | ||
585 | break; | 567 | break; |
586 | |||
587 | case ZFCP_ERP_ACTION_REOPEN_UNIT: | 568 | case ZFCP_ERP_ACTION_REOPEN_UNIT: |
588 | if (status != ZFCP_ERP_SUCCEEDED) | 569 | _zfcp_erp_unit_reopen(act->unit, 0, "ersff_4", NULL); |
589 | _zfcp_erp_port_reopen(unit->port, 0, "ersfa_7", NULL); | 570 | break; |
571 | } | ||
572 | } | ||
573 | |||
574 | static void zfcp_erp_strategy_followup_success(struct zfcp_erp_action *act) | ||
575 | { | ||
576 | switch (act->action) { | ||
577 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | ||
578 | _zfcp_erp_port_reopen_all(act->adapter, 0, "ersfs_1", NULL); | ||
579 | break; | ||
580 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | ||
581 | _zfcp_erp_port_reopen(act->port, 0, "ersfs_2", NULL); | ||
582 | break; | ||
583 | case ZFCP_ERP_ACTION_REOPEN_PORT: | ||
584 | _zfcp_erp_unit_reopen_all(act->port, 0, "ersfs_3", NULL); | ||
590 | break; | 585 | break; |
591 | } | 586 | } |
592 | } | 587 | } |
@@ -1289,7 +1284,10 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action) | |||
1289 | retval = zfcp_erp_strategy_statechange(erp_action, retval); | 1284 | retval = zfcp_erp_strategy_statechange(erp_action, retval); |
1290 | if (retval == ZFCP_ERP_EXIT) | 1285 | if (retval == ZFCP_ERP_EXIT) |
1291 | goto unlock; | 1286 | goto unlock; |
1292 | zfcp_erp_strategy_followup_actions(erp_action); | 1287 | if (retval == ZFCP_ERP_SUCCEEDED) |
1288 | zfcp_erp_strategy_followup_success(erp_action); | ||
1289 | if (retval == ZFCP_ERP_FAILED) | ||
1290 | zfcp_erp_strategy_followup_failed(erp_action); | ||
1293 | 1291 | ||
1294 | unlock: | 1292 | unlock: |
1295 | write_unlock(&adapter->erp_lock); | 1293 | write_unlock(&adapter->erp_lock); |