diff options
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvfc.c')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 8715a7b140cc..2aa3d695d548 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
@@ -561,7 +561,7 @@ static void ibmvfc_init_host(struct ibmvfc_host *vhost, int relogin) | |||
561 | struct ibmvfc_target *tgt; | 561 | struct ibmvfc_target *tgt; |
562 | 562 | ||
563 | if (vhost->action == IBMVFC_HOST_ACTION_INIT_WAIT) { | 563 | if (vhost->action == IBMVFC_HOST_ACTION_INIT_WAIT) { |
564 | if (++vhost->init_retries > IBMVFC_MAX_INIT_RETRIES) { | 564 | if (++vhost->init_retries > IBMVFC_MAX_HOST_INIT_RETRIES) { |
565 | dev_err(vhost->dev, | 565 | dev_err(vhost->dev, |
566 | "Host initialization retries exceeded. Taking adapter offline\n"); | 566 | "Host initialization retries exceeded. Taking adapter offline\n"); |
567 | ibmvfc_link_down(vhost, IBMVFC_HOST_OFFLINE); | 567 | ibmvfc_link_down(vhost, IBMVFC_HOST_OFFLINE); |
@@ -845,11 +845,12 @@ static void ibmvfc_reset_host(struct ibmvfc_host *vhost) | |||
845 | static void ibmvfc_retry_host_init(struct ibmvfc_host *vhost) | 845 | static void ibmvfc_retry_host_init(struct ibmvfc_host *vhost) |
846 | { | 846 | { |
847 | if (vhost->action == IBMVFC_HOST_ACTION_INIT_WAIT) { | 847 | if (vhost->action == IBMVFC_HOST_ACTION_INIT_WAIT) { |
848 | if (++vhost->init_retries > IBMVFC_MAX_INIT_RETRIES) { | 848 | vhost->delay_init = 1; |
849 | if (++vhost->init_retries > IBMVFC_MAX_HOST_INIT_RETRIES) { | ||
849 | dev_err(vhost->dev, | 850 | dev_err(vhost->dev, |
850 | "Host initialization retries exceeded. Taking adapter offline\n"); | 851 | "Host initialization retries exceeded. Taking adapter offline\n"); |
851 | ibmvfc_link_down(vhost, IBMVFC_HOST_OFFLINE); | 852 | ibmvfc_link_down(vhost, IBMVFC_HOST_OFFLINE); |
852 | } else if (vhost->init_retries == IBMVFC_MAX_INIT_RETRIES) | 853 | } else if (vhost->init_retries == IBMVFC_MAX_HOST_INIT_RETRIES) |
853 | __ibmvfc_reset_host(vhost); | 854 | __ibmvfc_reset_host(vhost); |
854 | else | 855 | else |
855 | ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT); | 856 | ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT); |
@@ -2756,7 +2757,7 @@ static void ibmvfc_init_tgt(struct ibmvfc_target *tgt, | |||
2756 | static void ibmvfc_retry_tgt_init(struct ibmvfc_target *tgt, | 2757 | static void ibmvfc_retry_tgt_init(struct ibmvfc_target *tgt, |
2757 | void (*job_step) (struct ibmvfc_target *)) | 2758 | void (*job_step) (struct ibmvfc_target *)) |
2758 | { | 2759 | { |
2759 | if (++tgt->init_retries > IBMVFC_MAX_INIT_RETRIES) { | 2760 | if (++tgt->init_retries > IBMVFC_MAX_TGT_INIT_RETRIES) { |
2760 | ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT); | 2761 | ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT); |
2761 | wake_up(&tgt->vhost->work_wait_q); | 2762 | wake_up(&tgt->vhost->work_wait_q); |
2762 | } else | 2763 | } else |
@@ -3613,7 +3614,13 @@ static void ibmvfc_do_work(struct ibmvfc_host *vhost) | |||
3613 | break; | 3614 | break; |
3614 | case IBMVFC_HOST_ACTION_INIT: | 3615 | case IBMVFC_HOST_ACTION_INIT: |
3615 | BUG_ON(vhost->state != IBMVFC_INITIALIZING); | 3616 | BUG_ON(vhost->state != IBMVFC_INITIALIZING); |
3616 | vhost->job_step(vhost); | 3617 | if (vhost->delay_init) { |
3618 | vhost->delay_init = 0; | ||
3619 | spin_unlock_irqrestore(vhost->host->host_lock, flags); | ||
3620 | ssleep(5); | ||
3621 | return; | ||
3622 | } else | ||
3623 | vhost->job_step(vhost); | ||
3617 | break; | 3624 | break; |
3618 | case IBMVFC_HOST_ACTION_QUERY: | 3625 | case IBMVFC_HOST_ACTION_QUERY: |
3619 | list_for_each_entry(tgt, &vhost->targets, queue) | 3626 | list_for_each_entry(tgt, &vhost->targets, queue) |