[SCSI] lpfc 8.3.38: Fixed deadlock condition in FCF round robin handling
authorJames Smart <james.smart@emulex.com>
Fri, 1 Mar 2013 21:36:54 +0000 (16:36 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 9 Apr 2013 22:20:27 +0000 (15:20 -0700)
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_sli.c

index 6e74a75..d489a0d 100644 (file)
@@ -1793,6 +1793,8 @@ lpfc_sli4_fcf_rec_mbox_parse(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
        virt_addr = mboxq->sge_array->addr[0];
 
        shdr = (union lpfc_sli4_cfg_shdr *)virt_addr;
+       lpfc_sli_pcimem_bcopy(shdr, shdr,
+                             sizeof(union lpfc_sli4_cfg_shdr));
        shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
        shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
        if (shdr_status || shdr_add_status) {
index a0ef439..57cb974 100644 (file)
@@ -15507,11 +15507,18 @@ lpfc_check_next_fcf_pri_level(struct lpfc_hba *phba)
                        LPFC_SLI4_FCF_TBL_INDX_MAX);
        lpfc_printf_log(phba, KERN_INFO, LOG_FIP,
                        "3060 Last IDX %d\n", last_index);
-       if (list_empty(&phba->fcf.fcf_pri_list)) {
+
+       /* Verify the priority list has 2 or more entries */
+       spin_lock_irq(&phba->hbalock);
+       if (list_empty(&phba->fcf.fcf_pri_list) ||
+           list_is_singular(&phba->fcf.fcf_pri_list)) {
+               spin_unlock_irq(&phba->hbalock);
                lpfc_printf_log(phba, KERN_ERR, LOG_FIP,
                        "3061 Last IDX %d\n", last_index);
                return 0; /* Empty rr list */
        }
+       spin_unlock_irq(&phba->hbalock);
+
        next_fcf_pri = 0;
        /*
         * Clear the rr_bmask and set all of the bits that are at this