public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: David C Somayajulu <david.somayajulu@qlogic.com>
To: linux-scsi@vger.kernel.org
Cc: open-iscsi@googlegroups.com,
	David Wagner <david.wagner@qlogic.com>,
	David Somayajulu <david.somayajulu@qlogic.com>
Subject: Re: [PATCH] [SCSI] qla4xxx: fix for timing issue for nvram accesses.
Date: Fri, 17 Nov 2006 18:38:08 -0800	[thread overview]
Message-ID: <1163817489.4136.6.camel@dcslnxpc.site> (raw)
In-Reply-To: <1163637669.3867.12.camel@dcslnxpc.site>

This patch fixes a timing issue related to nvram accesses in qla4xxx driver for some cpu/slot speed combination.

Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>

---
 drivers/scsi/qla4xxx/ql4_nvram.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_nvram.c b/drivers/scsi/qla4xxx/ql4_nvram.c
index fc50203..a84ed3e 100644
--- a/drivers/scsi/qla4xxx/ql4_nvram.c
+++ b/drivers/scsi/qla4xxx/ql4_nvram.c
@@ -29,7 +29,9 @@ static int fm93c56a_select(struct scsi_q
 
 	ha->eeprom_cmd_data = AUBURN_EEPROM_CS_1 | 0x000f0000;
 	writel(ha->eeprom_cmd_data, isp_nvram(ha));
+	udelay(1);
 	readl(isp_nvram(ha));
+	udelay(1);
 	return 1;
 }
 
@@ -42,11 +44,15 @@ static int fm93c56a_cmd(struct scsi_qla_
 
 	/* Clock in a zero, then do the start bit. */
 	writel(ha->eeprom_cmd_data | AUBURN_EEPROM_DO_1, isp_nvram(ha));
+	udelay(1);
 	writel(ha->eeprom_cmd_data | AUBURN_EEPROM_DO_1 |
 	       AUBURN_EEPROM_CLK_RISE, isp_nvram(ha));
+	udelay(1);
 	writel(ha->eeprom_cmd_data | AUBURN_EEPROM_DO_1 |
 	       AUBURN_EEPROM_CLK_FALL, isp_nvram(ha));
+	udelay(1);
 	readl(isp_nvram(ha));
+	udelay(1);
 	mask = 1 << (FM93C56A_CMD_BITS - 1);
 
 	/* Force the previous data bit to be different. */
@@ -61,13 +67,17 @@ static int fm93c56a_cmd(struct scsi_qla_
 			 * match.
 			 */
 			writel(ha->eeprom_cmd_data | dataBit, isp_nvram(ha));
+			udelay(1);
 			previousBit = dataBit;
 		}
 		writel(ha->eeprom_cmd_data | dataBit |
 		       AUBURN_EEPROM_CLK_RISE, isp_nvram(ha));
+		udelay(1);
 		writel(ha->eeprom_cmd_data | dataBit |
 		       AUBURN_EEPROM_CLK_FALL, isp_nvram(ha));
+		udelay(1);
 		readl(isp_nvram(ha));
+		udelay(1);
 		cmd = cmd << 1;
 	}
 	mask = 1 << (eeprom_no_addr_bits(ha) - 1);
@@ -83,13 +93,17 @@ static int fm93c56a_cmd(struct scsi_qla_
 			 * match.
 			 */
 			writel(ha->eeprom_cmd_data | dataBit, isp_nvram(ha));
+			udelay(1);
 			previousBit = dataBit;
 		}
 		writel(ha->eeprom_cmd_data | dataBit |
 		       AUBURN_EEPROM_CLK_RISE, isp_nvram(ha));
+		udelay(1);
 		writel(ha->eeprom_cmd_data | dataBit |
 		       AUBURN_EEPROM_CLK_FALL, isp_nvram(ha));
+		udelay(1);
 		readl(isp_nvram(ha));
+		udelay(1);
 		addr = addr << 1;
 	}
 	return 1;
@@ -99,7 +113,9 @@ static int fm93c56a_deselect(struct scsi
 {
 	ha->eeprom_cmd_data = AUBURN_EEPROM_CS_0 | 0x000f0000;
 	writel(ha->eeprom_cmd_data, isp_nvram(ha));
+	udelay(1);
 	readl(isp_nvram(ha));
+	udelay(1);
 	return 1;
 }
 
@@ -114,10 +130,13 @@ static int fm93c56a_datain(struct scsi_q
 	for (i = 0; i < eeprom_no_data_bits(ha); i++) {
 		writel(ha->eeprom_cmd_data |
 		       AUBURN_EEPROM_CLK_RISE, isp_nvram(ha));
+		udelay(1);
 		writel(ha->eeprom_cmd_data |
 		       AUBURN_EEPROM_CLK_FALL, isp_nvram(ha));
+		udelay(1);
 		dataBit =
 			(readw(isp_nvram(ha)) & AUBURN_EEPROM_DI_1) ? 1 : 0;
+		udelay(1);
 		data = (data << 1) | dataBit;
 	}
 
-- 
1.4.2.3



  reply	other threads:[~2006-11-18  2:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1163548841.3938.14.camel@dcslnxpc.site>
2006-11-16  0:41 ` [PATCH] [SCSI] qla4xxx: bug fix: driver hardware semaphore needs to be grabbed before soft reset David C Somayajulu
2006-11-18  2:38   ` David C Somayajulu [this message]
2006-11-21  0:20     ` [PATCH] [SCSI] qla4xxx: fix for timing issue for nvram accesses David C Somayajulu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1163817489.4136.6.camel@dcslnxpc.site \
    --to=david.somayajulu@qlogic.com \
    --cc=david.wagner@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=open-iscsi@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox