diff options
author | Samiullah Khawaja <skhawaja@google.com> | 2024-12-11 21:20:30 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-12-12 18:49:07 -0800 |
commit | b400f4b87430c105d92550cee5a72aea01fdf3d6 (patch) | |
tree | d00d81f3d59142758985f901fc2f4b5de52eb693 /net/core/page_pool.c | |
parent | 8156c310499a34c8f42b2e2b7360abb805683bbe (diff) |
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 <jgg@ziepe.ca>
Signed-off-by: Samiullah Khawaja <skhawaja@google.com>
Signed-off-by: Mina Almasry <almasrymina@google.com>
Link: https://patch.msgid.link/20241211212033.1684197-4-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/page_pool.c')
-rw-r--r-- | net/core/page_pool.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 7a17af286a9e..275a7fd209d7 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -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__, |