mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 06:46:35 +01:00
page_pool: Set dma_sync to false for devmem memory provider
Move the `dma_map` and `dma_sync` checks to `page_pool_init` to make them generic. Set dma_sync to false for devmem memory provider because the dma_sync APIs should not be used for dma_buf backed devmem memory provider. Cc: Jason Gunthorpe <[email protected]> Signed-off-by: Samiullah Khawaja <[email protected]> Signed-off-by: Mina Almasry <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
1 parent
8156c31049
commit
b400f4b874
2 files changed
+7
-5
No files matched your search
+4
-5
@@ -331,11 +331,10 @@ int mp_dmabuf_devmem_init(struct page_pool *pool)
|
||||
if (!binding)
|
||||
return -EINVAL;
|
||||
|
||||
if (!pool->dma_map)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (pool->dma_sync)
|
||||
return -EOPNOTSUPP;
|
||||
/* dma-buf dma addresses do not need and should not be used with
|
||||
* dma_sync_for_cpu/device. Force disable dma_sync.
|
||||
*/
|
||||
pool->dma_sync = false;
|
||||
|
||||
if (pool->p.order != 0)
|
||||
return -E2BIG;
|
||||
|
||||
@@ -287,6 +287,9 @@ static int page_pool_init(struct page_pool *pool,
|
||||
}
|
||||
|
||||
if (pool->mp_priv) {
|
||||
if (!pool->dma_map || !pool->dma_sync)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
err = mp_dmabuf_devmem_init(pool);
|
||||
if (err) {
|
||||
pr_warn("%s() mem-provider init failed %d\n", __func__,
|
||||
|
||||
Reference in new issue
Block a user