Commit 09cb5719 authored by Andrew Morton's avatar Andrew Morton Committed by James Bottomley

[PATCH] use mmiowb in qla1280.c

From: Jesse Barnes <jbarnes@engr.sgi.com>

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.
Signed-off-by: default avatarJeremy Higdon <jeremy@sgi.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 49233f9d
...@@ -3400,7 +3400,8 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) ...@@ -3400,7 +3400,8 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
sp->flags |= SRB_SENT; sp->flags |= SRB_SENT;
ha->actthreads++; ha->actthreads++;
WRT_REG_WORD(&reg->mailbox4, ha->req_ring_index); WRT_REG_WORD(&reg->mailbox4, ha->req_ring_index);
(void) RD_REG_WORD(&reg->mailbox4); /* PCI posted write flush */ /* Enforce mmio write ordering; see comment in qla1280_isp_cmd(). */
mmiowb();
out: out:
if (status) if (status)
...@@ -3668,7 +3669,8 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) ...@@ -3668,7 +3669,8 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
sp->flags |= SRB_SENT; sp->flags |= SRB_SENT;
ha->actthreads++; ha->actthreads++;
WRT_REG_WORD(&reg->mailbox4, ha->req_ring_index); WRT_REG_WORD(&reg->mailbox4, ha->req_ring_index);
(void) RD_REG_WORD(&reg->mailbox4); /* PCI posted write flush */ /* Enforce mmio write ordering; see comment in qla1280_isp_cmd(). */
mmiowb();
out: out:
if (status) if (status)
...@@ -3778,9 +3780,21 @@ qla1280_isp_cmd(struct scsi_qla_host *ha) ...@@ -3778,9 +3780,21 @@ qla1280_isp_cmd(struct scsi_qla_host *ha)
} else } else
ha->request_ring_ptr++; 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(&reg->mailbox4, ha->req_ring_index); WRT_REG_WORD(&reg->mailbox4, ha->req_ring_index);
(void) RD_REG_WORD(&reg->mailbox4); /* PCI posted write flush */ mmiowb();
LEAVE("qla1280_isp_cmd"); LEAVE("qla1280_isp_cmd");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment