From: Vaios Papadimitriou Date: Tue, 8 May 2012 22:01:26 +0000 (-0500) Subject: Fixed port and system failure in handling SLI4 FC port function reset (CR 126551) X-Git-Tag: v2.6.39-400.9.0~423^2~123^2~11 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fe657b2cc728e300ea8466c747d68e864a2242b5;p=users%2Fjedix%2Flinux-maple.git Fixed port and system failure in handling SLI4 FC port function reset (CR 126551) When performing function reset to LPe16000 port which is connected to a fabric and has targets (LUNs) discovered in the zone, sometimes the reset can fail and end up in the port being unresponsive or system crash or hang. Now, when reposting the SCSI SGL list after function reset, set the logical XRI allocated bit in the logical XRI bmask to account for the XRIs posted, so duplicated XRI will not be allocated later for new SGLs. Also, reset the used xri counts, and updated them properly during function reset. commit id: 41899be7e8b95c9c8b51ad4ff932769af508306f Signed-off-by: Maxim Uvarov --- diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 81ddb10b72501..19b62f2c946ea 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -2768,9 +2768,13 @@ lpfc_scsi_buf_update(struct lpfc_hba *phba) spin_lock_irq(&phba->hbalock); spin_lock(&phba->scsi_buf_list_lock); - list_for_each_entry_safe(sb, sb_next, &phba->lpfc_scsi_buf_list, list) + list_for_each_entry_safe(sb, sb_next, &phba->lpfc_scsi_buf_list, list) { sb->cur_iocbq.sli4_xritag = phba->sli4_hba.xri_ids[sb->cur_iocbq.sli4_lxritag]; + set_bit(sb->cur_iocbq.sli4_lxritag, phba->sli4_hba.xri_bmask); + phba->sli4_hba.max_cfg_param.xri_used++; + phba->sli4_hba.xri_count++; + } spin_unlock(&phba->scsi_buf_list_lock); spin_unlock_irq(&phba->hbalock); return 0; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index d1e1d729ed1e0..442ccd3ccc079 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -5635,6 +5635,8 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba) rc = -ENOMEM; goto free_vpi_ids; } + phba->sli4_hba.max_cfg_param.xri_used = 0; + phba->sli4_hba.xri_count = 0; phba->sli4_hba.xri_ids = kzalloc(count * sizeof(uint16_t), GFP_KERNEL);