diff options
author | Jayamohan Kallickal <jayamohank@gmail.com> | 2013-04-05 23:38:30 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-02 11:13:21 -0400 |
commit | 6ea9b3b0337d55c901cea38e2d85103e2268d757 (patch) | |
tree | 8e7829cab6203e5b5b79e3ff135d0b7b28dc533c /drivers/scsi/be2iscsi | |
parent | 7ad4dfe187a4ce1eabe7e0c6364e4561dc930564 (diff) |
[SCSI] be2iscsi: Fix the Port Link Status issue
Check the Logical Link status also as part of the port link status.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.c | 26 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.h | 6 |
2 files changed, 16 insertions, 16 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c index 4f3c93a11c50..efd29aba561e 100644 --- a/drivers/scsi/be2iscsi/be_cmds.c +++ b/drivers/scsi/be2iscsi/be_cmds.c | |||
@@ -348,30 +348,26 @@ static void be2iscsi_fail_session(struct iscsi_cls_session *cls_session) | |||
348 | void beiscsi_async_link_state_process(struct beiscsi_hba *phba, | 348 | void beiscsi_async_link_state_process(struct beiscsi_hba *phba, |
349 | struct be_async_event_link_state *evt) | 349 | struct be_async_event_link_state *evt) |
350 | { | 350 | { |
351 | switch (evt->port_link_status) { | 351 | if ((evt->port_link_status == ASYNC_EVENT_LINK_DOWN) || |
352 | case ASYNC_EVENT_LINK_DOWN: | 352 | ((evt->port_link_status & ASYNC_EVENT_LOGICAL) && |
353 | (evt->port_fault != BEISCSI_PHY_LINK_FAULT_NONE))) { | ||
354 | phba->state = BE_ADAPTER_LINK_DOWN; | ||
355 | |||
353 | beiscsi_log(phba, KERN_ERR, | 356 | beiscsi_log(phba, KERN_ERR, |
354 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, | 357 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, |
355 | "BC_%d : Link Down on Physical Port %d\n", | 358 | "BC_%d : Link Down on Port %d\n", |
356 | evt->physical_port); | 359 | evt->physical_port); |
357 | 360 | ||
358 | phba->state |= BE_ADAPTER_LINK_DOWN; | ||
359 | iscsi_host_for_each_session(phba->shost, | 361 | iscsi_host_for_each_session(phba->shost, |
360 | be2iscsi_fail_session); | 362 | be2iscsi_fail_session); |
361 | break; | 363 | } else if ((evt->port_link_status & ASYNC_EVENT_LINK_UP) || |
362 | case ASYNC_EVENT_LINK_UP: | 364 | ((evt->port_link_status & ASYNC_EVENT_LOGICAL) && |
365 | (evt->port_fault == BEISCSI_PHY_LINK_FAULT_NONE))) { | ||
363 | phba->state = BE_ADAPTER_UP; | 366 | phba->state = BE_ADAPTER_UP; |
367 | |||
364 | beiscsi_log(phba, KERN_ERR, | 368 | beiscsi_log(phba, KERN_ERR, |
365 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, | 369 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, |
366 | "BC_%d : Link UP on Physical Port %d\n", | 370 | "BC_%d : Link UP on Port %d\n", |
367 | evt->physical_port); | ||
368 | break; | ||
369 | default: | ||
370 | beiscsi_log(phba, KERN_ERR, | ||
371 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, | ||
372 | "BC_%d : Unexpected Async Notification %d on" | ||
373 | "Physical Port %d\n", | ||
374 | evt->port_link_status, | ||
375 | evt->physical_port); | 371 | evt->physical_port); |
376 | } | 372 | } |
377 | } | 373 | } |
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h index 9b64b3603576..97871cc803d4 100644 --- a/drivers/scsi/be2iscsi/be_cmds.h +++ b/drivers/scsi/be2iscsi/be_cmds.h | |||
@@ -122,7 +122,8 @@ struct be_async_event_trailer { | |||
122 | 122 | ||
123 | enum { | 123 | enum { |
124 | ASYNC_EVENT_LINK_DOWN = 0x0, | 124 | ASYNC_EVENT_LINK_DOWN = 0x0, |
125 | ASYNC_EVENT_LINK_UP = 0x1 | 125 | ASYNC_EVENT_LINK_UP = 0x1, |
126 | ASYNC_EVENT_LOGICAL = 0x2 | ||
126 | }; | 127 | }; |
127 | 128 | ||
128 | /** | 129 | /** |
@@ -134,6 +135,9 @@ struct be_async_event_link_state { | |||
134 | u8 port_link_status; | 135 | u8 port_link_status; |
135 | u8 port_duplex; | 136 | u8 port_duplex; |
136 | u8 port_speed; | 137 | u8 port_speed; |
138 | #define BEISCSI_PHY_LINK_FAULT_NONE 0x00 | ||
139 | #define BEISCSI_PHY_LINK_FAULT_LOCAL 0x01 | ||
140 | #define BEISCSI_PHY_LINK_FAULT_REMOTE 0x02 | ||
137 | u8 port_fault; | 141 | u8 port_fault; |
138 | u8 rsvd0[7]; | 142 | u8 rsvd0[7]; |
139 | struct be_async_event_trailer trailer; | 143 | struct be_async_event_trailer trailer; |