public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Can I/OAT DMA engineer access PCI MMIO space
@ 2011-04-29 10:13 康剑斌
  2011-05-02  6:04 ` Koul, Vinod
  0 siblings, 1 reply; 9+ messages in thread
From: 康剑斌 @ 2011-04-29 10:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: dan.j.williams

I try to use ioatdam to copy data from system memory to pci MMIO space:

=======================
void mmio_copy(void *dst, void *src, size_t len)
struct async_submit_ctl submit;
struct memcpy_context ctx;

atomic_set(&ctx.cnt, 1);
init_completion(&ctx.cmp);
init_async_submit(&submit, ASYNC_TX_ACK, NULL,
done_memcpy, &ctx, NULL);

while (len) {
size_t clen = (len > PAGE_SIZE) ? PAGE_SIZE : len;
struct page *p_dst, *p_src;

p_dst = virt_to_page(dst);
p_src = virt_to_page(src);

atomic_inc(&ctx.cnt);

ntb_async_memcpy(p_dst, p_src, 0, 0, clen, &submit);

dst += clen;
src += clen;
len -= clen;
}

if (atomic_dec_and_test(&ctx.cnt))
return;

async_tx_issue_pending_all();
wait_for_completion(&ctx.cmp);
=================

If dst points to a memory space, the operation would pass.
But if dst points to a pci MMIO space, it failed with kernel oops.
It seems the code:
BUG_ON(is_ioat_bug(chanerr));
in drivers/dma/ioat/dma_v3.c, line 365 cause the oops.
Is there anyway to access pci MMIO space using ioat?
The datasheet says that ioat supports MMIO access.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-05-05 15:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-29 10:13 Can I/OAT DMA engineer access PCI MMIO space 康剑斌
2011-05-02  6:04 ` Koul, Vinod
2011-05-03  2:21   ` 康剑斌
2011-05-03  4:12     ` Koul, Vinod
2011-05-03  6:31       ` 康剑斌
2011-05-03 15:58         ` Dan Williams
2011-05-05  8:45           ` 康剑斌
2011-05-05 15:11             ` Dan Williams
2011-05-03 16:05     ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox