mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
[SCSI] lpfc 8.1.7: Add lpfc_sli_flush_mbox_queue() function
Add lpfc_sli_flush_mbox_queue() function and use it in lpfc_offline() call to avoid deadlock on thread block. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
parent
ce8b3ce55b
commit
b4c026520f
3 changed files with 21 additions and 1 deletions
|
@ -147,6 +147,7 @@ int lpfc_sli_hba_setup(struct lpfc_hba *);
|
||||||
int lpfc_sli_hba_down(struct lpfc_hba *);
|
int lpfc_sli_hba_down(struct lpfc_hba *);
|
||||||
int lpfc_sli_issue_mbox(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t);
|
int lpfc_sli_issue_mbox(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t);
|
||||||
int lpfc_sli_handle_mb_event(struct lpfc_hba *);
|
int lpfc_sli_handle_mb_event(struct lpfc_hba *);
|
||||||
|
int lpfc_sli_flush_mbox_queue(struct lpfc_hba *);
|
||||||
int lpfc_sli_handle_slow_ring_event(struct lpfc_hba *,
|
int lpfc_sli_handle_slow_ring_event(struct lpfc_hba *,
|
||||||
struct lpfc_sli_ring *, uint32_t);
|
struct lpfc_sli_ring *, uint32_t);
|
||||||
void lpfc_sli_def_mbox_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *);
|
void lpfc_sli_def_mbox_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *);
|
||||||
|
|
|
@ -1353,6 +1353,7 @@ lpfc_offline(struct lpfc_hba * phba)
|
||||||
psli = &phba->sli;
|
psli = &phba->sli;
|
||||||
|
|
||||||
lpfc_linkdown(phba);
|
lpfc_linkdown(phba);
|
||||||
|
lpfc_sli_flush_mbox_queue(phba);
|
||||||
|
|
||||||
for (i = 0; i < psli->num_rings; i++) {
|
for (i = 0; i < psli->num_rings; i++) {
|
||||||
pring = &psli->ring[i];
|
pring = &psli->ring[i];
|
||||||
|
|
|
@ -578,7 +578,7 @@ lpfc_sli_handle_mb_event(struct lpfc_hba * phba)
|
||||||
/* Stray Mailbox Interrupt, mbxCommand <cmd> mbxStatus
|
/* Stray Mailbox Interrupt, mbxCommand <cmd> mbxStatus
|
||||||
<status> */
|
<status> */
|
||||||
lpfc_printf_log(phba,
|
lpfc_printf_log(phba,
|
||||||
KERN_ERR,
|
KERN_WARNING,
|
||||||
LOG_MBOX | LOG_SLI,
|
LOG_MBOX | LOG_SLI,
|
||||||
"%d:0304 Stray Mailbox Interrupt "
|
"%d:0304 Stray Mailbox Interrupt "
|
||||||
"mbxCommand x%x mbxStatus x%x\n",
|
"mbxCommand x%x mbxStatus x%x\n",
|
||||||
|
@ -3085,6 +3085,24 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq,
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
lpfc_sli_flush_mbox_queue(struct lpfc_hba * phba)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
while (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE && !phba->stopped) {
|
||||||
|
if (i++ > LPFC_MBOX_TMO * 1000)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if (lpfc_sli_handle_mb_event(phba) == 0)
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
msleep(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
irqreturn_t
|
irqreturn_t
|
||||||
lpfc_intr_handler(int irq, void *dev_id, struct pt_regs * regs)
|
lpfc_intr_handler(int irq, void *dev_id, struct pt_regs * regs)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue