public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] 2.6.3 qla2xxx driver -- use readX_relaxed
@ 2004-03-02  0:45 Andrew Vasquez
  2004-03-02  1:02 ` Jeremy Higdon
  2004-03-03 10:10 ` Jeremy Higdon
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Vasquez @ 2004-03-02  0:45 UTC (permalink / raw)
  To: Jeremy Higdon; +Cc: linux-scsi

On Wednesday, February 25, 2004 8:06 PM,
linux-scsi-owner@vger.kernel.org wrote: 
> For those to whom this is new (it was discussed on linux-kernel and
> linux-ia64 I believe), normal PCI register reads imply that PCI DMA
> writes that occured prior to the PCI MMR (memory mapped register)
> read (on the PCI bus) will be reflected in system memory once the
> MMR read is complete.
> 
> On our platforms, we can speed up the MMR read significantly if that
> ordering requirement is "relaxed".
> 

Interesting...but this implementation seems to be applying a different
set of semantic rules to the term 'relaxed' in comparison to the
'relaxed ordering' rules defined by PCI-X and PCI-Express, no?

> So I attempted to find the common register reads that don't have a
> need for this ordering so that I could make them use this faster
> read.
> 
> I did not change this line (111 of drivers/scsi/qla2xxx/qla_isr.c),
> because it may in some cases imply that a DMA write has completed.
> 
> 		stat = RD_REG_DWORD(&reg->u.isp2300.host_status);
> 

Yes in several cases it would.

> Andrew, if you have a chance to look at this and incorporate it in
> the driver, it would be great.  Also, any comments would be welcome.
> 

Sounds good, I just wish I had an Altix machine to test with.  You
seem to have covered most of the fast-path cases, I'll look some more
tonight for any others.  I guess my only nit-pick is the lowercase
_relaxed() suffix applied to RD_REG* #defines.

Thanks,
Andrew Vasquez

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] 2.6.3 qla2xxx driver -- use readX_relaxed
@ 2004-02-26  4:05 Jeremy Higdon
  2004-02-26  8:52 ` Arjan van de Ven
  0 siblings, 1 reply; 9+ messages in thread
From: Jeremy Higdon @ 2004-02-26  4:05 UTC (permalink / raw)
  To: linux-scsi, jbarnes

I'm submitting a patch for comment and consideration.  The relaxed read
interface was added a few weeks back, and this patch lets the qla2xxx driver
take advantage of it.

For those to whom this is new (it was discussed on linux-kernel and linux-ia64
I believe), normal PCI register reads imply that PCI DMA writes that occured
prior to the PCI MMR (memory mapped register) read (on the PCI bus) will be
reflected in system memory once the MMR read is complete.

On our platforms, we can speed up the MMR read significantly if that ordering
requirement is "relaxed".

So I attempted to find the common register reads that don't have a need
for this ordering so that I could make them use this faster read.

I did not change this line (111 of drivers/scsi/qla2xxx/qla_isr.c),
because it may in some cases imply that a DMA write has completed.

		stat = RD_REG_DWORD(&reg->u.isp2300.host_status);


Andrew, if you have a chance to look at this and incorporate it in the
driver, it would be great.  Also, any comments would be welcome.

thanks

jeremy

===== drivers/scsi/qla2xxx/qla_def.h 1.5 vs edited =====
--- 1.5/drivers/scsi/qla2xxx/qla_def.h	Mon Feb  2 08:02:02 2004
+++ edited/drivers/scsi/qla2xxx/qla_def.h	Wed Feb 25 16:14:18 2004
@@ -154,6 +154,9 @@
 #define RD_REG_BYTE(addr)		readb(addr)
 #define RD_REG_WORD(addr)		readw(addr)
 #define RD_REG_DWORD(addr)		readl(addr)
+#define RD_REG_BYTE_relaxed(addr)	readb_relaxed(addr)
+#define RD_REG_WORD_relaxed(addr)	readw_relaxed(addr)
+#define RD_REG_DWORD_relaxed(addr)	readl_relaxed(addr)
 #define WRT_REG_BYTE(addr, data)	writeb(data,addr)
 #define WRT_REG_WORD(addr, data)	writew(data,addr)
 #define WRT_REG_DWORD(addr, data)	writel(data,addr)
===== drivers/scsi/qla2xxx/qla_iocb.c 1.2 vs edited =====
--- 1.2/drivers/scsi/qla2xxx/qla_iocb.c	Mon Feb  2 07:41:39 2004
+++ edited/drivers/scsi/qla2xxx/qla_iocb.c	Wed Feb 25 01:23:36 2004
@@ -388,7 +388,7 @@
 
 	if (ha->req_q_cnt < (req_cnt + 2)) {
 		/* Calculate number of free request entries */
-		cnt = RD_REG_WORD(ISP_REQ_Q_OUT(ha, reg));
+		cnt = RD_REG_WORD_relaxed(ISP_REQ_Q_OUT(ha, reg));
 		if (ha->req_ring_index < cnt)
 			ha->req_q_cnt = cnt - ha->req_ring_index;
 		else
@@ -496,7 +496,7 @@
 
 	/* Set chip new ring index. */
 	WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
-	RD_REG_WORD(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
+	RD_REG_WORD_relaxed(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
 
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 	return (QLA_SUCCESS);
@@ -748,5 +748,5 @@
 
 	/* Set chip new ring index. */
 	WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
-	RD_REG_WORD(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
+	RD_REG_WORD_relaxed(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
 }
===== drivers/scsi/qla2xxx/qla_isr.c 1.5 vs edited =====
--- 1.5/drivers/scsi/qla2xxx/qla_isr.c	Tue Feb 10 13:51:30 2004
+++ edited/drivers/scsi/qla2xxx/qla_isr.c	Wed Feb 25 01:18:04 2004
@@ -165,7 +165,7 @@
 				break;
 			}
 			WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
-			RD_REG_WORD(&reg->hccr);
+			RD_REG_WORD_relaxed(&reg->hccr);
 		}
 	}
 

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

end of thread, other threads:[~2004-03-05  6:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-02  0:45 [PATCH] 2.6.3 qla2xxx driver -- use readX_relaxed Andrew Vasquez
2004-03-02  1:02 ` Jeremy Higdon
2004-03-02 17:19   ` Jesse Barnes
2004-03-03 10:10 ` Jeremy Higdon
2004-03-05  5:51   ` Andrew Vasquez
2004-03-05  6:52     ` Jeremy Higdon
  -- strict thread matches above, loose matches on Subject: below --
2004-02-26  4:05 Jeremy Higdon
2004-02-26  8:52 ` Arjan van de Ven
2004-02-26 16:47   ` Jesse Barnes

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