"0296 Restart HBA Data: x%x x%x\n",
                        phba->pport->port_state, psli->sli_flag);
 
+       lpfc_sli4_queue_unset(phba);
+
        rc = lpfc_sli4_brdreset(phba);
        if (rc) {
                phba->link_state = LPFC_HBA_ERROR;
        if (!eq)
                return -ENODEV;
 
+       if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
+               goto list_remove;
+
        mbox = mempool_alloc(eq->phba->mbox_mem_pool, GFP_KERNEL);
        if (!mbox)
                return -ENOMEM;
                                shdr_status, shdr_add_status, rc);
                status = -ENXIO;
        }
+       mempool_free(mbox, eq->phba->mbox_mem_pool);
 
+list_remove:
        /* Remove eq from any list */
        list_del_init(&eq->list);
-       mempool_free(mbox, eq->phba->mbox_mem_pool);
+
        return status;
 }
 
        /* sanity check on queue memory */
        if (!cq)
                return -ENODEV;
+
+       if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
+               goto list_remove;
+
        mbox = mempool_alloc(cq->phba->mbox_mem_pool, GFP_KERNEL);
        if (!mbox)
                return -ENOMEM;
                                shdr_status, shdr_add_status, rc);
                status = -ENXIO;
        }
+       mempool_free(mbox, cq->phba->mbox_mem_pool);
+
+list_remove:
        /* Remove cq from any list */
        list_del_init(&cq->list);
-       mempool_free(mbox, cq->phba->mbox_mem_pool);
        return status;
 }
 
        /* sanity check on queue memory */
        if (!mq)
                return -ENODEV;
+
+       if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
+               goto list_remove;
+
        mbox = mempool_alloc(mq->phba->mbox_mem_pool, GFP_KERNEL);
        if (!mbox)
                return -ENOMEM;
                                shdr_status, shdr_add_status, rc);
                status = -ENXIO;
        }
+       mempool_free(mbox, mq->phba->mbox_mem_pool);
+
+list_remove:
        /* Remove mq from any list */
        list_del_init(&mq->list);
-       mempool_free(mbox, mq->phba->mbox_mem_pool);
        return status;
 }
 
        /* sanity check on queue memory */
        if (!wq)
                return -ENODEV;
+
+       if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
+               goto list_remove;
+
        mbox = mempool_alloc(wq->phba->mbox_mem_pool, GFP_KERNEL);
        if (!mbox)
                return -ENOMEM;
                                shdr_status, shdr_add_status, rc);
                status = -ENXIO;
        }
+       mempool_free(mbox, wq->phba->mbox_mem_pool);
+
+list_remove:
        /* Remove wq from any list */
        list_del_init(&wq->list);
        kfree(wq->pring);
        wq->pring = NULL;
-       mempool_free(mbox, wq->phba->mbox_mem_pool);
        return status;
 }
 
        /* sanity check on queue memory */
        if (!hrq || !drq)
                return -ENODEV;
+
+       if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
+               goto list_remove;
+
        mbox = mempool_alloc(hrq->phba->mbox_mem_pool, GFP_KERNEL);
        if (!mbox)
                return -ENOMEM;
                                shdr_status, shdr_add_status, rc);
                status = -ENXIO;
        }
+       mempool_free(mbox, hrq->phba->mbox_mem_pool);
+
+list_remove:
        list_del_init(&hrq->list);
        list_del_init(&drq->list);
-       mempool_free(mbox, hrq->phba->mbox_mem_pool);
        return status;
 }