Commit 04b4e461 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[PATCH] PATCH [10/15] qla2xxx: Use readX_relaxed

  Jeremy Higdon <jeremy () sgi ! com>:

  	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.

 drivers/scsi/qla2xxx/qla_def.h  |    3 +++
 drivers/scsi/qla2xxx/qla_iocb.c |    6 +++---
 drivers/scsi/qla2xxx/qla_isr.c  |    2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)
parent f3ec0ce4
...@@ -154,6 +154,9 @@ ...@@ -154,6 +154,9 @@
#define RD_REG_BYTE(addr) readb(addr) #define RD_REG_BYTE(addr) readb(addr)
#define RD_REG_WORD(addr) readw(addr) #define RD_REG_WORD(addr) readw(addr)
#define RD_REG_DWORD(addr) readl(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_BYTE(addr, data) writeb(data,addr)
#define WRT_REG_WORD(addr, data) writew(data,addr) #define WRT_REG_WORD(addr, data) writew(data,addr)
#define WRT_REG_DWORD(addr, data) writel(data,addr) #define WRT_REG_DWORD(addr, data) writel(data,addr)
......
...@@ -390,7 +390,7 @@ qla2x00_start_scsi(srb_t *sp) ...@@ -390,7 +390,7 @@ qla2x00_start_scsi(srb_t *sp)
if (ha->req_q_cnt < (sp->req_cnt + 2)) { if (ha->req_q_cnt < (sp->req_cnt + 2)) {
/* Calculate number of free request entries */ /* 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) if (ha->req_ring_index < cnt)
ha->req_q_cnt = cnt - ha->req_ring_index; ha->req_q_cnt = cnt - ha->req_ring_index;
else else
...@@ -499,7 +499,7 @@ qla2x00_start_scsi(srb_t *sp) ...@@ -499,7 +499,7 @@ qla2x00_start_scsi(srb_t *sp)
/* Set chip new ring index. */ /* Set chip new ring index. */
WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_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); spin_unlock_irqrestore(&ha->hardware_lock, flags);
return (QLA_SUCCESS); return (QLA_SUCCESS);
...@@ -748,5 +748,5 @@ qla2x00_isp_cmd(scsi_qla_host_t *ha) ...@@ -748,5 +748,5 @@ qla2x00_isp_cmd(scsi_qla_host_t *ha)
/* Set chip new ring index. */ /* Set chip new ring index. */
WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_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. */
} }
...@@ -165,7 +165,7 @@ qla2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs) ...@@ -165,7 +165,7 @@ qla2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
break; break;
} }
WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT); WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
RD_REG_WORD(&reg->hccr); RD_REG_WORD_RELAXED(&reg->hccr);
} }
} }
......
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