linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/9] lpfc 8.1.3 : Fix polling mode panic
@ 2006-02-22 17:33 James Smart
  0 siblings, 0 replies; 2+ messages in thread
From: James Smart @ 2006-02-22 17:33 UTC (permalink / raw)
  To: linux-scsi


Fix polling mode panic

Cause: Race between interrupt driven and polling path in harvesting iocbs from
the response ring.


Signed-off-by: James Smart <James.Smart@emulex.com>

--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -467,6 +467,11 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
  	sdev = cmd->device;
  	cmd->scsi_done(cmd);

+	if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
+		lpfc_release_scsi_buf(phba, lpfc_cmd);
+		return;
+	}
+
  	if (!result && pnode != NULL &&
  	   ((jiffies - pnode->last_ramp_up_time) >
  		LPFC_Q_RAMP_UP_INTERVAL * HZ) &&
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -1154,12 +1154,17 @@ lpfc_sli_handle_fast_ring_event(struct l
  			cmdiocbq = lpfc_sli_iocbq_lookup(phba, pring,
  							 &rspiocbq);
  			if ((cmdiocbq) && (cmdiocbq->iocb_cmpl)) {
-				spin_unlock_irqrestore(
-				       phba->host->host_lock, iflag);
-				(cmdiocbq->iocb_cmpl)(phba, cmdiocbq,
-						      &rspiocbq);
-				spin_lock_irqsave(phba->host->host_lock,
-						  iflag);
+				if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
+					(cmdiocbq->iocb_cmpl)(phba, cmdiocbq,
+							      &rspiocbq);
+				} else {
+					spin_unlock_irqrestore(
+						phba->host->host_lock, iflag);
+					(cmdiocbq->iocb_cmpl)(phba, cmdiocbq,
+							      &rspiocbq);
+					spin_lock_irqsave(phba->host->host_lock,
+							  iflag);
+				}
  			}
  			break;
  		default:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 7/9] lpfc 8.1.3: Fix polling mode panic
@ 2006-03-01  3:33 Jamie Wellnitz
  0 siblings, 0 replies; 2+ messages in thread
From: Jamie Wellnitz @ 2006-03-01  3:33 UTC (permalink / raw)
  To: linux-scsi

Fix polling mode panic

Cause: Race between interrupt driven and polling path in harvesting iocbs
from
the response ring.

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>

--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -467,6 +467,11 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba 
 	sdev = cmd->device;
 	cmd->scsi_done(cmd);
 
+	if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
+		lpfc_release_scsi_buf(phba, lpfc_cmd);
+		return;
+	}
+
 	if (!result && pnode != NULL &&
 	   ((jiffies - pnode->last_ramp_up_time) >
 		LPFC_Q_RAMP_UP_INTERVAL * HZ) &&
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -1154,12 +1154,17 @@ lpfc_sli_handle_fast_ring_event(struct l
 			cmdiocbq = lpfc_sli_iocbq_lookup(phba, pring,
 							 &rspiocbq);
 			if ((cmdiocbq) && (cmdiocbq->iocb_cmpl)) {
-				spin_unlock_irqrestore(
-				       phba->host->host_lock, iflag);
-				(cmdiocbq->iocb_cmpl)(phba, cmdiocbq,
-						      &rspiocbq);
-				spin_lock_irqsave(phba->host->host_lock,
-						  iflag);
+				if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
+					(cmdiocbq->iocb_cmpl)(phba, cmdiocbq,
+							      &rspiocbq);
+				} else {
+					spin_unlock_irqrestore(
+						phba->host->host_lock, iflag);
+					(cmdiocbq->iocb_cmpl)(phba, cmdiocbq,
+							      &rspiocbq);
+					spin_lock_irqsave(phba->host->host_lock,
+							  iflag);
+				}
 			}
 			break;
 		default:

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-01  3:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-22 17:33 [PATCH 7/9] lpfc 8.1.3 : Fix polling mode panic James Smart
  -- strict thread matches above, loose matches on Subject: below --
2006-03-01  3:33 [PATCH 7/9] lpfc 8.1.3: " Jamie Wellnitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).