From: James Smart Date: Thu, 10 May 2012 01:18:40 +0000 (-0400) Subject: [SCSI] lpfc 8.3.31: Fix driver crash during back-to-back ramp events X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=75ad83a452116c00c092bdc4c842c4401cd24080;p=linux-beck.git [SCSI] lpfc 8.3.31: Fix driver crash during back-to-back ramp events Signed-off-by: Alex Iannicelli Signed-off-by: James Smart Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index d5f3fcc3e548..9434b0379abe 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -399,6 +399,14 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) num_rsrc_err = atomic_read(&phba->num_rsrc_err); num_cmd_success = atomic_read(&phba->num_cmd_success); + /* + * The error and success command counters are global per + * driver instance. If another handler has already + * operated on this error event, just exit. + */ + if (num_rsrc_err == 0) + return; + vports = lpfc_create_vport_work_array(phba); if (vports != NULL) for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {