* using ioremap() memory in dma_map_sg()
@ 2018-11-19 16:02 Olga Kitaina
2018-11-22 11:28 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Olga Kitaina @ 2018-11-19 16:02 UTC (permalink / raw)
To: linux-kernel
Hi.
As part of our driver, we want to have some device memory to be
available to other devices via the DMA-BUF subsystem. The device memory
is managed by genpool, and mapped from the sram driver via ioremap_wc().
We initially used sg_set_buf() with the virtual address returned from
gen_pool_dma_alloc(), but it seems like the wrong thing to do, since the
virt_addr_valid() check fails. Attempting to use vmalloc_to_page()
results in a failure down the line, such as:
Unable to handle kernel paging request at virtual address ba405000
Backtrace:
(dma_cache_maint_page) from (__dma_page_dev_to_cpu+0x88/0x108)
(__dma_page_dev_to_cpu) from (arm_dma_map_page+0x5c/0x60)
(arm_dma_unmap_page) from (arm_dma_map_sg+0x64/0x8c)
(arm_dma_unmap_sg) from(foo_dmabuf_map+0x60/0x8c [foo])
Is there an appropriate way to put an ioremapped buffer into an SG table?
Thanks,
Olga.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: using ioremap() memory in dma_map_sg()
2018-11-19 16:02 using ioremap() memory in dma_map_sg() Olga Kitaina
@ 2018-11-22 11:28 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2018-11-22 11:28 UTC (permalink / raw)
To: okitain, Sumit Semwal, Christoph Hellwig; +Cc: Linux Kernel Mailing List
On Mon, Nov 19, 2018 at 6:31 PM Olga Kitaina <okitain@elvees.com> wrote:
>
> Hi.
> As part of our driver, we want to have some device memory to be
> available to other devices via the DMA-BUF subsystem. The device memory
> is managed by genpool, and mapped from the sram driver via ioremap_wc().
> We initially used sg_set_buf() with the virtual address returned from
> gen_pool_dma_alloc(), but it seems like the wrong thing to do, since the
> virt_addr_valid() check fails. Attempting to use vmalloc_to_page()
> results in a failure down the line, such as:
>
> Unable to handle kernel paging request at virtual address ba405000
> Backtrace:
> (dma_cache_maint_page) from (__dma_page_dev_to_cpu+0x88/0x108)
> (__dma_page_dev_to_cpu) from (arm_dma_map_page+0x5c/0x60)
> (arm_dma_unmap_page) from (arm_dma_map_sg+0x64/0x8c)
> (arm_dma_unmap_sg) from(foo_dmabuf_map+0x60/0x8c [foo])
>
> Is there an appropriate way to put an ioremapped buffer into an SG table?
Olga, I'm not sure you really want DMA-BUF subsystem for your task.
Anyway, I Cc'ed to couple of maintainers, hope they can help you.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-22 11:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 16:02 using ioremap() memory in dma_map_sg() Olga Kitaina
2018-11-22 11:28 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®