aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@gmail.com>2013-09-28 18:35:51 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-10-25 04:58:08 -0400
commitbd41c2bd86000514cf199891dabff86599796c0c (patch)
tree17ec8294c2f84751b944af51dcea392987f86877 /drivers/scsi/be2iscsi
parent1e4be6ff41573139620080268a1aa6d1d8726358 (diff)
[SCSI] be2iscsi: Fix chute cleanup during drivers unload.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r--drivers/scsi/be2iscsi/be_main.c14
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c17
2 files changed, 23 insertions, 8 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index d539b17e4a80..b323569e5eb3 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -4433,10 +4433,16 @@ static void beiscsi_clean_port(struct beiscsi_hba *phba)
4433 int mgmt_status, ulp_num; 4433 int mgmt_status, ulp_num;
4434 struct ulp_cid_info *ptr_cid_info = NULL; 4434 struct ulp_cid_info *ptr_cid_info = NULL;
4435 4435
4436 mgmt_status = mgmt_epfw_cleanup(phba, CMD_CONNECTION_CHUTE_0); 4436 for (ulp_num = 0; ulp_num < BEISCSI_ULP_COUNT; ulp_num++) {
4437 if (mgmt_status) 4437 if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) {
4438 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_INIT, 4438 mgmt_status = mgmt_epfw_cleanup(phba, ulp_num);
4439 "BM_%d : mgmt_epfw_cleanup FAILED\n"); 4439 if (mgmt_status)
4440 beiscsi_log(phba, KERN_WARNING,
4441 BEISCSI_LOG_INIT,
4442 "BM_%d : mgmt_epfw_cleanup FAILED"
4443 " for ULP_%d\n", ulp_num);
4444 }
4445 }
4440 4446
4441 hwi_purge_eq(phba); 4447 hwi_purge_eq(phba);
4442 hwi_cleanup(phba); 4448 hwi_cleanup(phba);
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index bcddc9fb23a2..a542bbbdb06e 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -491,7 +491,16 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl,
491 return tag; 491 return tag;
492} 492}
493 493
494int mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short chute) 494/**
495 * mgmt_epfw_cleanup()- Inform FW to cleanup data structures.
496 * @phba: pointer to dev priv structure
497 * @ulp_num: ULP number.
498 *
499 * return
500 * Success: 0
501 * Failure: Non-Zero Value
502 **/
503int mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short ulp_num)
495{ 504{
496 struct be_ctrl_info *ctrl = &phba->ctrl; 505 struct be_ctrl_info *ctrl = &phba->ctrl;
497 struct be_mcc_wrb *wrb = wrb_from_mccq(phba); 506 struct be_mcc_wrb *wrb = wrb_from_mccq(phba);
@@ -505,9 +514,9 @@ int mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short chute)
505 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, 514 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI,
506 OPCODE_COMMON_ISCSI_CLEANUP, sizeof(*req)); 515 OPCODE_COMMON_ISCSI_CLEANUP, sizeof(*req));
507 516
508 req->chute = chute; 517 req->chute = (1 << ulp_num);
509 req->hdr_ring_id = cpu_to_le16(HWI_GET_DEF_HDRQ_ID(phba, 0)); 518 req->hdr_ring_id = cpu_to_le16(HWI_GET_DEF_HDRQ_ID(phba, ulp_num));
510 req->data_ring_id = cpu_to_le16(HWI_GET_DEF_BUFQ_ID(phba, 0)); 519 req->data_ring_id = cpu_to_le16(HWI_GET_DEF_BUFQ_ID(phba, ulp_num));
511 520
512 status = be_mcc_notify_wait(phba); 521 status = be_mcc_notify_wait(phba);
513 if (status) 522 if (status)