Skip to content

Commit 835cfaf

Browse files
eddiejamesEddie James
authored andcommitted
soc: aspeed: xdma: Reduce AST2600 max transfer size (torvalds#254)
There have observations of incomplete DMA transfers under certain transfer size and host address alignment conditions. Specically, if the transfer size is within one "page" size of the max transfer size, and (host address - host address lower page boundary) >= (max transfer size - transfer size). Page refers to the XDMA PCIe downstream request size. Therefore, reduce the max transfer size to below the range where this issue seems to occur. Signed-off-by: Eddie James <[email protected]> Co-authored-by: Eddie James <[email protected]>
1 parent f8cbd1b commit 835cfaf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/soc/aspeed/aspeed-xdma.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@
164164
#define XDMA_AST2600_INPRG_US_CMD20 0x70
165165
#define XDMA_AST2600_INPRG_US_CMD21 0x74
166166

167+
#define XDMA_AST2600_MAX_LEN (XDMA_CMD_AST2600_CMD_LINE_SIZE - 255)
168+
167169
struct aspeed_xdma_cmd {
168170
u64 host_addr;
169171
u64 pitch;
@@ -378,7 +380,7 @@ static unsigned int aspeed_xdma_ast2600_set_cmd(struct aspeed_xdma *ctx,
378380
"host[%016llx]\n", op->direction ? "upstream" : "downstream",
379381
bmc_addr, op->len, op->host_addr);
380382

381-
if (op->len > XDMA_CMD_AST2600_CMD_LINE_SIZE) {
383+
if (op->len > XDMA_AST2600_MAX_LEN) {
382384
unsigned int rem;
383385
unsigned int total;
384386

0 commit comments

Comments
 (0)