Skip to content

Commit

Permalink
ioatdma: Add 64bit chansts register read for ioat v3.3.
Browse files Browse the repository at this point in the history
The channel status register for v3.3 is now 64bit. Use readq if available
on v3.3 platforms.

Signed-off-by: Dave Jiang <[email protected]>
Acked-by: Dan Williams <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
davejiang authored and Vinod Koul committed Apr 15, 2013
1 parent 0132bce commit d92a8d7
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion drivers/dma/ioat/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ ioat_chan_by_index(struct ioatdma_device *device, int index)
return device->idx[index];
}

static inline u64 ioat_chansts(struct ioat_chan_common *chan)
static inline u64 ioat_chansts_32(struct ioat_chan_common *chan)
{
u8 ver = chan->device->version;
u64 status;
Expand All @@ -218,6 +218,26 @@ static inline u64 ioat_chansts(struct ioat_chan_common *chan)
return status;
}

#if BITS_PER_LONG == 64

static inline u64 ioat_chansts(struct ioat_chan_common *chan)
{
u8 ver = chan->device->version;
u64 status;

/* With IOAT v3.3 the status register is 64bit. */
if (ver >= IOAT_VER_3_3)
status = readq(chan->reg_base + IOAT_CHANSTS_OFFSET(ver));
else
status = ioat_chansts_32(chan);

return status;
}

#else
#define ioat_chansts ioat_chansts_32
#endif

static inline void ioat_start(struct ioat_chan_common *chan)
{
u8 ver = chan->device->version;
Expand Down

0 comments on commit d92a8d7

Please sign in to comment.