aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2013-03-26 18:42:41 -0400
committerVinod Koul <vinod.koul@intel.com>2013-04-15 00:21:20 -0400
commitd92a8d7cbb6941d5d985ccb3453a2ac5c92f60e4 (patch)
tree37146d568d6022714cfc3a65d90f12eaf12fba13
parent0132bcef76301a8dc7794c893fd9342a04059082 (diff)
ioatdma: Add 64bit chansts register read for ioat v3.3.
The channel status register for v3.3 is now 64bit. Use readq if available on v3.3 platforms. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Acked-by: Dan Williams <djbw@fb.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/ioat/dma.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index 95ae7b3139ec..9285caadf825 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -201,7 +201,7 @@ ioat_chan_by_index(struct ioatdma_device *device, int index)
201 return device->idx[index]; 201 return device->idx[index];
202} 202}
203 203
204static inline u64 ioat_chansts(struct ioat_chan_common *chan) 204static inline u64 ioat_chansts_32(struct ioat_chan_common *chan)
205{ 205{
206 u8 ver = chan->device->version; 206 u8 ver = chan->device->version;
207 u64 status; 207 u64 status;
@@ -218,6 +218,26 @@ static inline u64 ioat_chansts(struct ioat_chan_common *chan)
218 return status; 218 return status;
219} 219}
220 220
221#if BITS_PER_LONG == 64
222
223static inline u64 ioat_chansts(struct ioat_chan_common *chan)
224{
225 u8 ver = chan->device->version;
226 u64 status;
227
228 /* With IOAT v3.3 the status register is 64bit. */
229 if (ver >= IOAT_VER_3_3)
230 status = readq(chan->reg_base + IOAT_CHANSTS_OFFSET(ver));
231 else
232 status = ioat_chansts_32(chan);
233
234 return status;
235}
236
237#else
238#define ioat_chansts ioat_chansts_32
239#endif
240
221static inline void ioat_start(struct ioat_chan_common *chan) 241static inline void ioat_start(struct ioat_chan_common *chan)
222{ 242{
223 u8 ver = chan->device->version; 243 u8 ver = chan->device->version;