Skip to content

Commit

Permalink
[SCSI] lpfc 8.3.39: Fixed not returning FAILED status when SCSI invok…
Browse files Browse the repository at this point in the history
…ing host reset handler failed

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
James Smart authored and James Bottomley committed May 2, 2013
1 parent 711ea88 commit a88dbb6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/lpfc/lpfc_crtn.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,3 +470,4 @@ int lpfc_sli4_xri_sgl_update(struct lpfc_hba *);
void lpfc_free_sgl_list(struct lpfc_hba *, struct list_head *);
uint32_t lpfc_sli_port_speed_get(struct lpfc_hba *);
int lpfc_sli4_request_firmware_update(struct lpfc_hba *, uint8_t);
void lpfc_sli4_offline_eratt(struct lpfc_hba *);
2 changes: 1 addition & 1 deletion drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ lpfc_offline_eratt(struct lpfc_hba *phba)
* This routine is called to bring a SLI4 HBA offline when HBA hardware error
* other than Port Error 6 has been detected.
**/
static void
void
lpfc_sli4_offline_eratt(struct lpfc_hba *phba)
{
lpfc_offline_prep(phba, LPFC_MBX_NO_WAIT);
Expand Down
14 changes: 11 additions & 3 deletions drivers/scsi/lpfc/lpfc_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5376,16 +5376,24 @@ lpfc_host_reset_handler(struct scsi_cmnd *cmnd)
struct lpfc_hba *phba = vport->phba;
int rc, ret = SUCCESS;

lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"3172 SCSI layer issued Host Reset Data:\n");

lpfc_offline_prep(phba, LPFC_MBX_WAIT);
lpfc_offline(phba);
rc = lpfc_sli_brdrestart(phba);
if (rc)
ret = FAILED;
lpfc_online(phba);
rc = lpfc_online(phba);
if (rc)
ret = FAILED;
lpfc_unblock_mgmt_io(phba);

lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
"3172 SCSI layer issued Host Reset Data: x%x\n", ret);
if (ret == FAILED) {
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"3323 Failed host reset, bring it offline\n");
lpfc_sli4_offline_eratt(phba);
}
return ret;
}

Expand Down

0 comments on commit a88dbb6

Please sign in to comment.