From: Jeremy Higdon <jeremy@sgi.com>
To: linux-scsi@vger.kernel.org, jbarnes@cthulhu.engr.sgi.com
Subject: [PATCH] 2.6.3 qla2xxx driver -- use readX_relaxed
Date: Wed, 25 Feb 2004 20:05:35 -0800 [thread overview]
Message-ID: <20040226040535.GA559454@sgi.com> (raw)
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(®->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(®->hccr, HCCR_CLR_RISC_INT);
- RD_REG_WORD(®->hccr);
+ RD_REG_WORD_relaxed(®->hccr);
}
}
next reply other threads:[~2004-02-26 4:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-26 4:05 Jeremy Higdon [this message]
2004-02-26 8:52 ` [PATCH] 2.6.3 qla2xxx driver -- use readX_relaxed Arjan van de Ven
2004-02-26 16:47 ` Jesse Barnes
-- strict thread matches above, loose matches on Subject: below --
2004-03-02 0:45 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
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=20040226040535.GA559454@sgi.com \
--to=jeremy@sgi.com \
--cc=jbarnes@cthulhu.engr.sgi.com \
--cc=linux-scsi@vger.kernel.org \
/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