Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[pandora-kernel.git] / drivers / scsi / lpfc / lpfc_sli.c
index b9edfeb..4d4104f 100644 (file)
@@ -6127,12 +6127,20 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
                goto out_free_mbox;
        }
 
+       /* Create all the SLI4 queues */
+       rc = lpfc_sli4_queue_create(phba);
+       if (rc) {
+               lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+                               "3089 Failed to allocate queues\n");
+               rc = -ENODEV;
+               goto out_stop_timers;
+       }
        /* Set up all the queues to the device */
        rc = lpfc_sli4_queue_setup(phba);
        if (unlikely(rc)) {
                lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
                                "0381 Error %d during queue setup.\n ", rc);
-               goto out_stop_timers;
+               goto out_destroy_queue;
        }
 
        /* Arm the CQs and then EQs on device */
@@ -6205,15 +6213,20 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
        spin_lock_irq(&phba->hbalock);
        phba->link_state = LPFC_LINK_DOWN;
        spin_unlock_irq(&phba->hbalock);
-       if (phba->cfg_suppress_link_up == LPFC_INITIALIZE_LINK)
+       if (phba->cfg_suppress_link_up == LPFC_INITIALIZE_LINK) {
                rc = phba->lpfc_hba_init_link(phba, MBX_NOWAIT);
+               if (rc)
+                       goto out_unset_queue;
+       }
+       mempool_free(mboxq, phba->mbox_mem_pool);
+       return rc;
 out_unset_queue:
        /* Unset all the queues set up in this routine when error out */
-       if (rc)
-               lpfc_sli4_queue_unset(phba);
+       lpfc_sli4_queue_unset(phba);
+out_destroy_queue:
+       lpfc_sli4_queue_destroy(phba);
 out_stop_timers:
-       if (rc)
-               lpfc_stop_hba_timers(phba);
+       lpfc_stop_hba_timers(phba);
 out_free_mbox:
        mempool_free(mboxq, phba->mbox_mem_pool);
        return rc;
@@ -7525,6 +7538,8 @@ lpfc_sli4_bpl2sgl(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq,
                                if (inbound == 1)
                                        offset = 0;
                                bf_set(lpfc_sli4_sge_offset, sgl, offset);
+                               bf_set(lpfc_sli4_sge_type, sgl,
+                                       LPFC_SGE_TYPE_DATA);
                                offset += bde.tus.f.bdeSize;
                        }
                        sgl->word2 = cpu_to_le32(sgl->word2);
@@ -9562,7 +9577,6 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq,
 
        /* now issue the command */
        retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT);
-
        if (retval == MBX_BUSY || retval == MBX_SUCCESS) {
                wait_event_interruptible_timeout(done_q,
                                pmboxq->mbox_flag & LPFC_MBX_WAKE,
@@ -11319,6 +11333,8 @@ lpfc_sli4_sp_intr_handler(int irq, void *dev_id)
 
        /* Get to the EQ struct associated with this vector */
        speq = phba->sli4_hba.sp_eq;
+       if (unlikely(!speq))
+               return IRQ_NONE;
 
        /* Check device state for handling interrupt */
        if (unlikely(lpfc_intr_state_check(phba))) {
@@ -11396,6 +11412,8 @@ lpfc_sli4_fp_intr_handler(int irq, void *dev_id)
 
        if (unlikely(!phba))
                return IRQ_NONE;
+       if (unlikely(!phba->sli4_hba.fp_eq))
+               return IRQ_NONE;
 
        /* Get to the EQ struct associated with this vector */
        fpeq = phba->sli4_hba.fp_eq[fcp_eqidx];