aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2006-07-06 15:50:43 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-09 11:48:38 -0400
commitb4c026520ff0a4cb838a941bb0ed8996075e3d8c (patch)
treec280062f59f802cfbc92d967e54cdd0191ce4e36 /drivers/scsi/lpfc/lpfc_sli.c
parentce8b3ce55bb0bd9318954efab0f714b088178978 (diff)
[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>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 8193a384a9fb..c441e37eb053 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -578,7 +578,7 @@ lpfc_sli_handle_mb_event(struct lpfc_hba * phba)
578 /* Stray Mailbox Interrupt, mbxCommand <cmd> mbxStatus 578 /* Stray Mailbox Interrupt, mbxCommand <cmd> mbxStatus
579 <status> */ 579 <status> */
580 lpfc_printf_log(phba, 580 lpfc_printf_log(phba,
581 KERN_ERR, 581 KERN_WARNING,
582 LOG_MBOX | LOG_SLI, 582 LOG_MBOX | LOG_SLI,
583 "%d:0304 Stray Mailbox Interrupt " 583 "%d:0304 Stray Mailbox Interrupt "
584 "mbxCommand x%x mbxStatus x%x\n", 584 "mbxCommand x%x mbxStatus x%x\n",
@@ -3085,6 +3085,24 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq,
3085 return retval; 3085 return retval;
3086} 3086}
3087 3087
3088int
3089lpfc_sli_flush_mbox_queue(struct lpfc_hba * phba)
3090{
3091 int i = 0;
3092
3093 while (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE && !phba->stopped) {
3094 if (i++ > LPFC_MBOX_TMO * 1000)
3095 return 1;
3096
3097 if (lpfc_sli_handle_mb_event(phba) == 0)
3098 i = 0;
3099
3100 msleep(1);
3101 }
3102
3103 return (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE) ? 1 : 0;
3104}
3105
3088irqreturn_t 3106irqreturn_t
3089lpfc_intr_handler(int irq, void *dev_id, struct pt_regs * regs) 3107lpfc_intr_handler(int irq, void *dev_id, struct pt_regs * regs)
3090{ 3108{