Skip to content

Commit d3cd63f

Browse files
davejiangVinod Koul
authored andcommitted
dmaengine: IOATDMA: Cleanup pre v3.0 chansts register reads
Remove pre-3.0 channel status reads. 3.0 and later chansts register is 64bit and can be read 64bit. This was clarified with the hardware architects and since the driver now only support 3.0+ we don't need the legacy support Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
1 parent 8005c49 commit d3cd63f

2 files changed

Lines changed: 4 additions & 46 deletions

File tree

‎drivers/dma/ioat/dma.h‎

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -235,43 +235,11 @@ ioat_chan_by_index(struct ioatdma_device *ioat_dma, int index)
235235
return ioat_dma->idx[index];
236236
}
237237

238-
static inline u64 ioat_chansts_32(struct ioatdma_chan *ioat_chan)
239-
{
240-
u8 ver = ioat_chan->ioat_dma->version;
241-
u64 status;
242-
u32 status_lo;
243-
244-
/* We need to read the low address first as this causes the
245-
* chipset to latch the upper bits for the subsequent read
246-
*/
247-
status_lo = readl(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET_LOW(ver));
248-
status = readl(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET_HIGH(ver));
249-
status <<= 32;
250-
status |= status_lo;
251-
252-
return status;
253-
}
254-
255-
#if BITS_PER_LONG == 64
256-
257238
static inline u64 ioat_chansts(struct ioatdma_chan *ioat_chan)
258239
{
259-
u8 ver = ioat_chan->ioat_dma->version;
260-
u64 status;
261-
262-
/* With IOAT v3.3 the status register is 64bit. */
263-
if (ver >= IOAT_VER_3_3)
264-
status = readq(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET(ver));
265-
else
266-
status = ioat_chansts_32(ioat_chan);
267-
268-
return status;
240+
return readq(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET);
269241
}
270242

271-
#else
272-
#define ioat_chansts ioat_chansts_32
273-
#endif
274-
275243
static inline u64 ioat_chansts_to_addr(u64 status)
276244
{
277245
return status & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR;

‎drivers/dma/ioat/registers.h‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,9 @@
9999
#define IOAT_DMA_COMP_V1 0x0001 /* Compatibility with DMA version 1 */
100100
#define IOAT_DMA_COMP_V2 0x0002 /* Compatibility with DMA version 2 */
101101

102-
103-
#define IOAT1_CHANSTS_OFFSET 0x04 /* 64-bit Channel Status Register */
104-
#define IOAT2_CHANSTS_OFFSET 0x08 /* 64-bit Channel Status Register */
105-
#define IOAT_CHANSTS_OFFSET(ver) ((ver) < IOAT_VER_2_0 \
106-
? IOAT1_CHANSTS_OFFSET : IOAT2_CHANSTS_OFFSET)
107-
#define IOAT1_CHANSTS_OFFSET_LOW 0x04
108-
#define IOAT2_CHANSTS_OFFSET_LOW 0x08
109-
#define IOAT_CHANSTS_OFFSET_LOW(ver) ((ver) < IOAT_VER_2_0 \
110-
? IOAT1_CHANSTS_OFFSET_LOW : IOAT2_CHANSTS_OFFSET_LOW)
111-
#define IOAT1_CHANSTS_OFFSET_HIGH 0x08
112-
#define IOAT2_CHANSTS_OFFSET_HIGH 0x0C
113-
#define IOAT_CHANSTS_OFFSET_HIGH(ver) ((ver) < IOAT_VER_2_0 \
114-
? IOAT1_CHANSTS_OFFSET_HIGH : IOAT2_CHANSTS_OFFSET_HIGH)
102+
/* IOAT1 define left for i7300_idle driver to not fail compiling */
103+
#define IOAT1_CHANSTS_OFFSET 0x04
104+
#define IOAT_CHANSTS_OFFSET 0x08 /* 64-bit Channel Status Register */
115105
#define IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR (~0x3fULL)
116106
#define IOAT_CHANSTS_SOFT_ERR 0x10ULL
117107
#define IOAT_CHANSTS_UNAFFILIATED_ERR 0x8ULL

0 commit comments

Comments
 (0)