public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Update for scsi-misc-2.6
@ 2010-09-08  3:55 madhu.iyengar
  2010-09-08  3:55 ` [PATCH 1/1] qla2xxx: ROM lock recovery if fw hangs while holding the lock madhu.iyengar
  0 siblings, 1 reply; 4+ messages in thread
From: madhu.iyengar @ 2010-09-08  3:55 UTC (permalink / raw)
  To: James.Bottomley
  Cc: giridhar.malavali, madhu.iyengar, andrew.vasquez, linux-scsi

From: Giridhar Malavali <giridhar.malavali@qlogic.com>

James,

We missed this patch a few days ago. Can you please include this.

Thanks.

Shyam Sundar (1):
  qla2xxx: ROM lock recovery if fw hangs while holding the lock.

 drivers/scsi/qla2xxx/qla_nx.c |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 deletions(-)


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

* [PATCH 1/1] qla2xxx: ROM lock recovery if fw hangs while holding the lock.
  2010-09-08  3:55 [PATCH 0/1] Update for scsi-misc-2.6 madhu.iyengar
@ 2010-09-08  3:55 ` madhu.iyengar
  2010-09-14 18:45   ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: madhu.iyengar @ 2010-09-08  3:55 UTC (permalink / raw)
  To: James.Bottomley
  Cc: giridhar.malavali, madhu.iyengar, andrew.vasquez, linux-scsi,
	Shyam Sundar

From: Shyam Sundar <shyam.sundar@qlogic.com>


Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_nx.c |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index c5ac876..73bd86d 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -3165,6 +3165,20 @@ qla82xx_start_iocbs(srb_t *sp)
 	}
 }
 
+void qla82xx_rom_lock_recovery(struct qla_hw_data *ha)
+{
+	if (qla82xx_rom_lock(ha))
+		/* Someone else is holding the lock. */
+		qla_printk(KERN_INFO, ha, "Resetting rom_lock\n");
+
+	/*
+	 * Either we got the lock, or someone
+	 * else died while holding it.
+	 * In either case, unlock.
+	 */
+	qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
+}
+
 /*
  * qla82xx_device_bootstrap
  *    Initialize device, set DEV_READY, start fw
@@ -3179,12 +3193,13 @@ qla82xx_start_iocbs(srb_t *sp)
 static int
 qla82xx_device_bootstrap(scsi_qla_host_t *vha)
 {
-	int rval, i, timeout;
+	int rval = QLA_SUCCESS;
+	int i, timeout;
 	uint32_t old_count, count;
 	struct qla_hw_data *ha = vha->hw;
+	int need_reset = 0, peg_stuck = 1;
 
-	if (qla82xx_need_reset(ha))
-		goto dev_initialize;
+	need_reset = qla82xx_need_reset(ha);
 
 	old_count = qla82xx_rd_32(ha, QLA82XX_PEG_ALIVE_COUNTER);
 
@@ -3198,9 +3213,27 @@ qla82xx_device_bootstrap(scsi_qla_host_t *vha)
 
 		count = qla82xx_rd_32(ha, QLA82XX_PEG_ALIVE_COUNTER);
 		if (count != old_count)
+			peg_stuck = 0;
+	}
+
+	if (need_reset) {
+		/* We are trying to perform a recovery here. */
+		if (peg_stuck)
+			qla82xx_rom_lock_recovery(ha);
+		goto dev_initialize;
+	} else  {
+		/* Start of day for this ha context. */
+		if (peg_stuck) {
+			/* Either we are the first or recovery in progress. */
+			qla82xx_rom_lock_recovery(ha);
+			goto dev_initialize;
+		} else
+			/* Firmware already running. */
 			goto dev_ready;
 	}
 
+	return rval;
+
 dev_initialize:
 	/* set to DEV_INITIALIZING */
 	qla_printk(KERN_INFO, ha, "HW State: INITIALIZING\n");
-- 
1.6.0.2


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

* Re: [PATCH 1/1] qla2xxx: ROM lock recovery if fw hangs while holding the lock.
  2010-09-08  3:55 ` [PATCH 1/1] qla2xxx: ROM lock recovery if fw hangs while holding the lock madhu.iyengar
@ 2010-09-14 18:45   ` James Bottomley
  2010-09-14 22:26     ` Madhu Iyengar
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2010-09-14 18:45 UTC (permalink / raw)
  To: madhu.iyengar; +Cc: giridhar.malavali, andrew.vasquez, linux-scsi, Shyam Sundar

OK, could we get a bit more order to the qlogic patch process, please?

On Tue, 2010-09-07 at 20:55 -0700, madhu.iyengar@qlogic.com wrote:
> From: Shyam Sundar <shyam.sundar@qlogic.com>

There's no signoff from the person authoring the patch

> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>

And unless Giridhar is also an author, why is this signoff here?

Plus your signoff isn't here, but should be as the person transmitting
the patch to me.

I applied this, but next time, please follow the rules.

James



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

* RE: [PATCH 1/1] qla2xxx: ROM lock recovery if fw hangs while holding the lock.
  2010-09-14 18:45   ` James Bottomley
@ 2010-09-14 22:26     ` Madhu Iyengar
  0 siblings, 0 replies; 4+ messages in thread
From: Madhu Iyengar @ 2010-09-14 22:26 UTC (permalink / raw)
  To: James Bottomley
  Cc: Giridhar Malavali, Andrew Vasquez, linux-scsi@vger.kernel.org,
	Shyam Sundar, Madhu Iyengar



-----Original Message-----
From: James Bottomley [mailto:James.Bottomley@suse.de] 
Sent: Tuesday, September 14, 2010 11:45 AM
To: Madhu Iyengar
Cc: Giridhar Malavali; Andrew Vasquez; linux-scsi@vger.kernel.org; Shyam Sundar
Subject: Re: [PATCH 1/1] qla2xxx: ROM lock recovery if fw hangs while holding the lock.

OK, could we get a bit more order to the qlogic patch process, please?

On Tue, 2010-09-07 at 20:55 -0700, madhu.iyengar@qlogic.com wrote:
> From: Shyam Sundar <shyam.sundar@qlogic.com>

There's no signoff from the person authoring the patch

> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>

And unless Giridhar is also an author, why is this signoff here?

Plus your signoff isn't here, but should be as the person transmitting
the patch to me.

I applied this, but next time, please follow the rules.

<MI> We will follow the rules next time. Sorry about this.

James




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

end of thread, other threads:[~2010-09-14 22:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-08  3:55 [PATCH 0/1] Update for scsi-misc-2.6 madhu.iyengar
2010-09-08  3:55 ` [PATCH 1/1] qla2xxx: ROM lock recovery if fw hangs while holding the lock madhu.iyengar
2010-09-14 18:45   ` James Bottomley
2010-09-14 22:26     ` Madhu Iyengar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox