]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Fixed port and system failure in handling SLI4 FC port function reset (CR 126551)
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 8 May 2012 22:01:26 +0000 (17:01 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 9 May 2012 00:01:26 +0000 (17:01 -0700)
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 <maxim.uvarov@oracle.com>
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_sli.c

index 81ddb10b725017adafc4ff5f267717e7a3ca2f05..19b62f2c946ea16f4790905cd8b5d9f710c8187e 100644 (file)
@@ -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;
index d1e1d729ed1e0b14e613391e7428e6c56aaee977..442ccd3ccc079d8bd677984fed2066df798696d0 100644 (file)
@@ -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);