Skip to contentSkip to conversation

lpfc 8.3.31: Fix driver crash during back-to-back ramp events

PATCH New James Smart 1 participant 1 message May 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 13/20 lpfc 8.3.31: Fix driver crash during back-to-back ramp events

Fix driver crash during back-to-back ramp events.

---

 lpfc_scsi.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/scsi/lpfc/lpfc_scsi.c +8 -0
diff -upNr 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
 	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++) {