diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2008-08-15 11:59:23 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-08-16 11:48:40 -0400 |
commit | cf6f10d794ab4a9bd84fce345c3947588670d5f5 (patch) | |
tree | a760b9050b684c74c81b3521fdc35eeb60352a28 /drivers/scsi | |
parent | 915be024414c52e311f795566ac938223ba3c847 (diff) |
[SCSI] ibmvfc: Fix for lost async events
If the client virtual fibre channel adapter is already logged into the
server and does an NPIV Login again, the async queue, which is used for
reporting Link Up/Link Down type of events, does not get reset on the
server side. Fix up the client driver so that we also do not reset it.
This fixes a problem of lost async events following relogins.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 406ab27f80e9..58f8c9e39ae8 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
@@ -556,11 +556,12 @@ static void ibmvfc_link_down(struct ibmvfc_host *vhost, | |||
556 | /** | 556 | /** |
557 | * ibmvfc_init_host - Start host initialization | 557 | * ibmvfc_init_host - Start host initialization |
558 | * @vhost: ibmvfc host struct | 558 | * @vhost: ibmvfc host struct |
559 | * @relogin: is this a re-login? | ||
559 | * | 560 | * |
560 | * Return value: | 561 | * Return value: |
561 | * nothing | 562 | * nothing |
562 | **/ | 563 | **/ |
563 | static void ibmvfc_init_host(struct ibmvfc_host *vhost) | 564 | static void ibmvfc_init_host(struct ibmvfc_host *vhost, int relogin) |
564 | { | 565 | { |
565 | struct ibmvfc_target *tgt; | 566 | struct ibmvfc_target *tgt; |
566 | 567 | ||
@@ -574,6 +575,11 @@ static void ibmvfc_init_host(struct ibmvfc_host *vhost) | |||
574 | } | 575 | } |
575 | 576 | ||
576 | if (!ibmvfc_set_host_state(vhost, IBMVFC_INITIALIZING)) { | 577 | if (!ibmvfc_set_host_state(vhost, IBMVFC_INITIALIZING)) { |
578 | if (!relogin) { | ||
579 | memset(vhost->async_crq.msgs, 0, PAGE_SIZE); | ||
580 | vhost->async_crq.cur = 0; | ||
581 | } | ||
582 | |||
577 | list_for_each_entry(tgt, &vhost->targets, queue) | 583 | list_for_each_entry(tgt, &vhost->targets, queue) |
578 | tgt->need_login = 1; | 584 | tgt->need_login = 1; |
579 | scsi_block_requests(vhost->host); | 585 | scsi_block_requests(vhost->host); |
@@ -2084,11 +2090,11 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, | |||
2084 | case IBMVFC_AE_LINK_UP: | 2090 | case IBMVFC_AE_LINK_UP: |
2085 | case IBMVFC_AE_RESUME: | 2091 | case IBMVFC_AE_RESUME: |
2086 | vhost->events_to_log |= IBMVFC_AE_LINKUP; | 2092 | vhost->events_to_log |= IBMVFC_AE_LINKUP; |
2087 | ibmvfc_init_host(vhost); | 2093 | ibmvfc_init_host(vhost, 1); |
2088 | break; | 2094 | break; |
2089 | case IBMVFC_AE_SCN_FABRIC: | 2095 | case IBMVFC_AE_SCN_FABRIC: |
2090 | vhost->events_to_log |= IBMVFC_AE_RSCN; | 2096 | vhost->events_to_log |= IBMVFC_AE_RSCN; |
2091 | ibmvfc_init_host(vhost); | 2097 | ibmvfc_init_host(vhost, 1); |
2092 | break; | 2098 | break; |
2093 | case IBMVFC_AE_SCN_NPORT: | 2099 | case IBMVFC_AE_SCN_NPORT: |
2094 | case IBMVFC_AE_SCN_GROUP: | 2100 | case IBMVFC_AE_SCN_GROUP: |
@@ -2134,13 +2140,13 @@ static void ibmvfc_handle_crq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost) | |||
2134 | /* Send back a response */ | 2140 | /* Send back a response */ |
2135 | rc = ibmvfc_send_crq_init_complete(vhost); | 2141 | rc = ibmvfc_send_crq_init_complete(vhost); |
2136 | if (rc == 0) | 2142 | if (rc == 0) |
2137 | ibmvfc_init_host(vhost); | 2143 | ibmvfc_init_host(vhost, 0); |
2138 | else | 2144 | else |
2139 | dev_err(vhost->dev, "Unable to send init rsp. rc=%ld\n", rc); | 2145 | dev_err(vhost->dev, "Unable to send init rsp. rc=%ld\n", rc); |
2140 | break; | 2146 | break; |
2141 | case IBMVFC_CRQ_INIT_COMPLETE: | 2147 | case IBMVFC_CRQ_INIT_COMPLETE: |
2142 | dev_info(vhost->dev, "Partner initialization complete\n"); | 2148 | dev_info(vhost->dev, "Partner initialization complete\n"); |
2143 | ibmvfc_init_host(vhost); | 2149 | ibmvfc_init_host(vhost, 0); |
2144 | break; | 2150 | break; |
2145 | default: | 2151 | default: |
2146 | dev_err(vhost->dev, "Unknown crq message type: %d\n", crq->format); | 2152 | dev_err(vhost->dev, "Unknown crq message type: %d\n", crq->format); |
@@ -3358,8 +3364,6 @@ static void ibmvfc_npiv_login(struct ibmvfc_host *vhost) | |||
3358 | mad->buffer.va = vhost->login_buf_dma; | 3364 | mad->buffer.va = vhost->login_buf_dma; |
3359 | mad->buffer.len = sizeof(*vhost->login_buf); | 3365 | mad->buffer.len = sizeof(*vhost->login_buf); |
3360 | 3366 | ||
3361 | memset(vhost->async_crq.msgs, 0, PAGE_SIZE); | ||
3362 | vhost->async_crq.cur = 0; | ||
3363 | ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT_WAIT); | 3367 | ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT_WAIT); |
3364 | 3368 | ||
3365 | if (!ibmvfc_send_event(evt, vhost, default_timeout)) | 3369 | if (!ibmvfc_send_event(evt, vhost, default_timeout)) |