aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/io.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-09-01 08:09:29 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-03 14:40:53 -0400
commit5c97f6d48701d464dfd6e8782399383686603b65 (patch)
treea72acce8629e6493afd31981d0f38e08bb1e243d /drivers/net/sfc/io.h
parent621ad27ca68f318db0d416e5c1401d35c95c6d91 (diff)
Revert "sfc: Use write-combining to reduce TX latency" and follow-ups
[ Upstream commit 86c432ca5d6da90a26ac8d3e680f2268b502d9c5 ] This reverts commits 65f0b417dee94f779ce9b77102b7d73c93723b39, d88d6b05fee3cc78e5b0273eb58c31201dcc6b76, fcfa060468a4edcf776f0c1211d826d5de1668c1, 747df2258b1b9a2e25929ef496262c339c380009 and 867955f5682f7157fdafe8670804b9f8ea077bc7. Depending on the processor model, write-combining may result in reordering that the NIC will not tolerate. This typically results in a DMA error event and reset by the driver, logged as: sfc 0000:0e:00.0: eth2: TX DMA Q reports TX_EV_PKT_ERR. sfc 0000:0e:00.0: eth2: resetting (ALL) Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/sfc/io.h')
-rw-r--r--drivers/net/sfc/io.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/sfc/io.h b/drivers/net/sfc/io.h
index cc978803d48..dc45110b245 100644
--- a/drivers/net/sfc/io.h
+++ b/drivers/net/sfc/io.h
@@ -48,9 +48,9 @@
48 * replacing the low 96 bits with zero does not affect functionality. 48 * replacing the low 96 bits with zero does not affect functionality.
49 * - If the host writes to the last dword address of such a register 49 * - If the host writes to the last dword address of such a register
50 * (i.e. the high 32 bits) the underlying register will always be 50 * (i.e. the high 32 bits) the underlying register will always be
51 * written. If the collector and the current write together do not 51 * written. If the collector does not hold values for the low 96
52 * provide values for all 128 bits of the register, the low 96 bits 52 * bits of the register, they will be written as zero. Writing to
53 * will be written as zero. 53 * the last qword does not have this effect and must not be done.
54 * - If the host writes to the address of any other part of such a 54 * - If the host writes to the address of any other part of such a
55 * register while the collector already holds values for some other 55 * register while the collector already holds values for some other
56 * register, the write is discarded and the collector maintains its 56 * register, the write is discarded and the collector maintains its
@@ -103,7 +103,6 @@ static inline void efx_writeo(struct efx_nic *efx, efx_oword_t *value,
103 _efx_writed(efx, value->u32[2], reg + 8); 103 _efx_writed(efx, value->u32[2], reg + 8);
104 _efx_writed(efx, value->u32[3], reg + 12); 104 _efx_writed(efx, value->u32[3], reg + 12);
105#endif 105#endif
106 wmb();
107 mmiowb(); 106 mmiowb();
108 spin_unlock_irqrestore(&efx->biu_lock, flags); 107 spin_unlock_irqrestore(&efx->biu_lock, flags);
109} 108}
@@ -126,7 +125,6 @@ static inline void efx_sram_writeq(struct efx_nic *efx, void __iomem *membase,
126 __raw_writel((__force u32)value->u32[0], membase + addr); 125 __raw_writel((__force u32)value->u32[0], membase + addr);
127 __raw_writel((__force u32)value->u32[1], membase + addr + 4); 126 __raw_writel((__force u32)value->u32[1], membase + addr + 4);
128#endif 127#endif
129 wmb();
130 mmiowb(); 128 mmiowb();
131 spin_unlock_irqrestore(&efx->biu_lock, flags); 129 spin_unlock_irqrestore(&efx->biu_lock, flags);
132} 130}
@@ -141,7 +139,6 @@ static inline void efx_writed(struct efx_nic *efx, efx_dword_t *value,
141 139
142 /* No lock required */ 140 /* No lock required */
143 _efx_writed(efx, value->u32[0], reg); 141 _efx_writed(efx, value->u32[0], reg);
144 wmb();
145} 142}
146 143
147/* Read a 128-bit CSR, locking as appropriate. */ 144/* Read a 128-bit CSR, locking as appropriate. */
@@ -152,7 +149,6 @@ static inline void efx_reado(struct efx_nic *efx, efx_oword_t *value,
152 149
153 spin_lock_irqsave(&efx->biu_lock, flags); 150 spin_lock_irqsave(&efx->biu_lock, flags);
154 value->u32[0] = _efx_readd(efx, reg + 0); 151 value->u32[0] = _efx_readd(efx, reg + 0);
155 rmb();
156 value->u32[1] = _efx_readd(efx, reg + 4); 152 value->u32[1] = _efx_readd(efx, reg + 4);
157 value->u32[2] = _efx_readd(efx, reg + 8); 153 value->u32[2] = _efx_readd(efx, reg + 8);
158 value->u32[3] = _efx_readd(efx, reg + 12); 154 value->u32[3] = _efx_readd(efx, reg + 12);
@@ -175,7 +171,6 @@ static inline void efx_sram_readq(struct efx_nic *efx, void __iomem *membase,
175 value->u64[0] = (__force __le64)__raw_readq(membase + addr); 171 value->u64[0] = (__force __le64)__raw_readq(membase + addr);
176#else 172#else
177 value->u32[0] = (__force __le32)__raw_readl(membase + addr); 173 value->u32[0] = (__force __le32)__raw_readl(membase + addr);
178 rmb();
179 value->u32[1] = (__force __le32)__raw_readl(membase + addr + 4); 174 value->u32[1] = (__force __le32)__raw_readl(membase + addr + 4);
180#endif 175#endif
181 spin_unlock_irqrestore(&efx->biu_lock, flags); 176 spin_unlock_irqrestore(&efx->biu_lock, flags);
@@ -242,14 +237,12 @@ static inline void _efx_writeo_page(struct efx_nic *efx, efx_oword_t *value,
242 237
243#ifdef EFX_USE_QWORD_IO 238#ifdef EFX_USE_QWORD_IO
244 _efx_writeq(efx, value->u64[0], reg + 0); 239 _efx_writeq(efx, value->u64[0], reg + 0);
245 _efx_writeq(efx, value->u64[1], reg + 8);
246#else 240#else
247 _efx_writed(efx, value->u32[0], reg + 0); 241 _efx_writed(efx, value->u32[0], reg + 0);
248 _efx_writed(efx, value->u32[1], reg + 4); 242 _efx_writed(efx, value->u32[1], reg + 4);
243#endif
249 _efx_writed(efx, value->u32[2], reg + 8); 244 _efx_writed(efx, value->u32[2], reg + 8);
250 _efx_writed(efx, value->u32[3], reg + 12); 245 _efx_writed(efx, value->u32[3], reg + 12);
251#endif
252 wmb();
253} 246}
254#define efx_writeo_page(efx, value, reg, page) \ 247#define efx_writeo_page(efx, value, reg, page) \
255 _efx_writeo_page(efx, value, \ 248 _efx_writeo_page(efx, value, \