From: Jesse Barnes <jbarnes@engr.sgi.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org, jeremy@sgi.com, jes@sgi.com
Subject: [PATCH] use mmiowb in qla1280.c
Date: Thu, 21 Oct 2004 16:17:14 -0700 [thread overview]
Message-ID: <200410211617.14809.jbarnes@engr.sgi.com> (raw)
In-Reply-To: <200410211613.19601.jbarnes@engr.sgi.com>
[-- Attachment #1: Type: text/plain, Size: 467 bytes --]
There are a few spots in qla1280.c that don't need a full PCI write flush to
the device, but rather a simple write ordering guarantee. This patch changes
some of the PIO reads that cause write flushes into mmiowb calls instead,
which is a lighter weight way of ensuring ordering.
Jes and James, can you ack this and/or push it in via the SCSI BK tree?
Thanks,
Jesse
Signed-off-by: Jeremy Higdon <jeremy@sgi.com>
Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
[-- Attachment #2: qla1280-mmiowb-4.patch --]
[-- Type: text/plain, Size: 1654 bytes --]
===== drivers/scsi/qla1280.c 1.69 vs edited =====
--- 1.69/drivers/scsi/qla1280.c 2004-10-20 06:46:21 -07:00
+++ edited/drivers/scsi/qla1280.c 2004-10-21 16:06:11 -07:00
@@ -3400,7 +3400,8 @@
sp->flags |= SRB_SENT;
ha->actthreads++;
WRT_REG_WORD(®->mailbox4, ha->req_ring_index);
- (void) RD_REG_WORD(®->mailbox4); /* PCI posted write flush */
+ /* Enforce mmio write ordering; see comment in qla1280_isp_cmd(). */
+ mmiowb();
out:
if (status)
@@ -3668,7 +3669,8 @@
sp->flags |= SRB_SENT;
ha->actthreads++;
WRT_REG_WORD(®->mailbox4, ha->req_ring_index);
- (void) RD_REG_WORD(®->mailbox4); /* PCI posted write flush */
+ /* Enforce mmio write ordering; see comment in qla1280_isp_cmd(). */
+ mmiowb();
out:
if (status)
@@ -3778,9 +3780,21 @@
} else
ha->request_ring_ptr++;
- /* Set chip new ring index. */
+ /*
+ * Update request index to mailbox4 (Request Queue In).
+ * The mmiowb() ensures that this write is ordered with writes by other
+ * CPUs. Without the mmiowb(), it is possible for the following:
+ * CPUA posts write of index 5 to mailbox4
+ * CPUA releases host lock
+ * CPUB acquires host lock
+ * CPUB posts write of index 6 to mailbox4
+ * On PCI bus, order reverses and write of 6 posts, then index 5,
+ * causing chip to issue full queue of stale commands
+ * The mmiowb() prevents future writes from crossing the barrier.
+ * See Documentation/DocBook/deviceiobook.tmpl for more information.
+ */
WRT_REG_WORD(®->mailbox4, ha->req_ring_index);
- (void) RD_REG_WORD(®->mailbox4); /* PCI posted write flush */
+ mmiowb();
LEAVE("qla1280_isp_cmd");
}
next prev parent reply other threads:[~2004-10-21 23:17 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-21 23:13 [PATCH] I/O space write barrier Jesse Barnes
2004-10-21 23:13 ` Jesse Barnes
2004-10-21 23:17 ` Jesse Barnes [this message]
2004-10-22 9:53 ` [PATCH] use mmiowb in qla1280.c Jes Sorensen
2004-10-24 16:20 ` James Bottomley
2004-10-25 16:18 ` Jesse Barnes
2004-10-25 19:02 ` Andrew Morton
2004-10-25 19:33 ` Jesse Barnes
2004-10-21 23:28 ` [PATCH] use mmiowb in tg3.c Jesse Barnes
2004-10-21 23:40 ` David S. Miller
2004-10-22 1:16 ` Benjamin Herrenschmidt
2004-10-22 1:33 ` akepner
2004-10-22 2:07 ` Benjamin Herrenschmidt
2004-10-22 3:01 ` Jesse Barnes
2004-10-22 4:00 ` Paul Mackerras
2004-10-22 20:51 ` [PATCH] use mmiowb in tg3_poll akepner
2005-05-28 23:12 ` Lennert Buytenhek
2005-05-30 16:30 ` Arthur Kepner
2005-05-31 12:53 ` jamal
2005-05-31 16:45 ` Jesse Barnes
2004-10-22 1:01 ` [PATCH] I/O space write barrier Grant Grundler
2004-10-22 1:01 ` Grant Grundler
2004-10-22 3:05 ` Jesse Barnes
2004-10-22 3:05 ` Jesse Barnes
2004-10-22 4:26 ` Greg Banks
2004-10-22 4:26 ` Greg Banks
2004-10-22 15:26 ` Grant Grundler
2004-10-22 15:26 ` Grant Grundler
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=200410211617.14809.jbarnes@engr.sgi.com \
--to=jbarnes@engr.sgi.com \
--cc=akpm@osdl.org \
--cc=jeremy@sgi.com \
--cc=jes@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.