Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

be2iscsi : Fix the retry count for boot targets

Increment the retry count to get the boot target info when
port async event is received by the driver. Update sysfs enteries
with the boot target parameters.

Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
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@Odin.com>

authored by

John Soni Jose and committed by
James Bottomley
3efde862 a9555534

+28 -3
+4
drivers/scsi/be2iscsi/be_cmds.c
··· 452 452 ((evt->port_link_status & ASYNC_EVENT_LOGICAL) && 453 453 (evt->port_fault == BEISCSI_PHY_LINK_FAULT_NONE))) { 454 454 phba->state = BE_ADAPTER_LINK_UP | BE_ADAPTER_CHECK_BOOT; 455 + phba->get_boot = BE_GET_BOOT_RETRIES; 455 456 456 457 beiscsi_log(phba, KERN_ERR, 457 458 BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, ··· 481 480 case ASYNC_EVENT_NEW_ISCSI_CONN: 482 481 case ASYNC_EVENT_NEW_TCP_CONN: 483 482 phba->state |= BE_ADAPTER_CHECK_BOOT; 483 + phba->get_boot = BE_GET_BOOT_RETRIES; 484 484 beiscsi_log(phba, KERN_ERR, 485 485 BEISCSI_LOG_CONFIG | 486 486 BEISCSI_LOG_MBOX, ··· 490 488 compl->flags); 491 489 break; 492 490 default: 491 + phba->state |= BE_ADAPTER_CHECK_BOOT; 492 + phba->get_boot = BE_GET_BOOT_RETRIES; 493 493 beiscsi_log(phba, KERN_ERR, 494 494 BEISCSI_LOG_CONFIG | 495 495 BEISCSI_LOG_MBOX,
+20 -3
drivers/scsi/be2iscsi/be_main.c
··· 2037 2037 /* Interpret compl as a async link evt */ 2038 2038 beiscsi_async_link_state_process(phba, 2039 2039 (struct be_async_event_link_state *) mcc_compl); 2040 - else 2040 + else { 2041 2041 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_MBOX, 2042 2042 "BM_%d : Unsupported Async Event, flags" 2043 2043 " = 0x%08x\n", 2044 2044 mcc_compl->flags); 2045 + if (phba->state & BE_ADAPTER_LINK_UP) { 2046 + phba->state |= BE_ADAPTER_CHECK_BOOT; 2047 + phba->get_boot = BE_GET_BOOT_RETRIES; 2048 + } 2049 + } 2045 2050 } else if (mcc_compl->flags & CQE_FLAGS_COMPLETED_MASK) { 2046 2051 be_mcc_compl_process_isr(&phba->ctrl, mcc_compl); 2047 2052 atomic_dec(&phba->ctrl.mcc_obj.q.used); ··· 4333 4328 beiscsi_log(phba, KERN_ERR, 4334 4329 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG, 4335 4330 "BM_%d : No boot session\n"); 4331 + 4332 + if (ret == -ENXIO) 4333 + phba->get_boot = 0; 4334 + 4335 + 4336 4336 return ret; 4337 4337 } 4338 + phba->get_boot = 0; 4338 4339 nonemb_cmd.va = pci_zalloc_consistent(phba->ctrl.pdev, 4339 4340 sizeof(*session_resp), 4340 4341 &nonemb_cmd.dma); ··· 5385 5374 be_eqd_update(phba); 5386 5375 5387 5376 if (phba->state & BE_ADAPTER_CHECK_BOOT) { 5388 - phba->state &= ~BE_ADAPTER_CHECK_BOOT; 5389 - be_check_boot_session(phba); 5377 + if ((phba->get_boot > 0) && (!phba->boot_kset)) { 5378 + phba->get_boot--; 5379 + if (!(phba->get_boot % BE_GET_BOOT_TO)) 5380 + be_check_boot_session(phba); 5381 + } else { 5382 + phba->state &= ~BE_ADAPTER_CHECK_BOOT; 5383 + phba->get_boot = 0; 5384 + } 5390 5385 } 5391 5386 5392 5387 beiscsi_ue_detect(phba);
+4
drivers/scsi/be2iscsi/be_main.h
··· 109 109 110 110 #define BEISCSI_CLEAN_UNLOAD 0x01 111 111 #define BEISCSI_EEH_UNLOAD 0x02 112 + 113 + #define BE_GET_BOOT_RETRIES 45 114 + #define BE_GET_BOOT_TO 20 112 115 /** 113 116 * hardware needs the async PDU buffers to be posted in multiples of 8 114 117 * So have atleast 8 of them by default ··· 416 413 } fw_config; 417 414 418 415 unsigned int state; 416 + int get_boot; 419 417 bool fw_timeout; 420 418 bool ue_detected; 421 419 struct delayed_work beiscsi_hw_check_task;