sample/mdev/mbochs: remove mbochs_kmap_atomic_dmabuf
Subsystems (3)
PATCH 1/2 sample/mdev/mbochs: remove mbochs_kmap_atomic_dmabuf
Atomic mapping interface for dmabufs will be removed.
--- samples/vfio-mdev/mbochs.c | 10 ---------- 1 file changed, 10 deletions(-)
samples/vfio-mdev/mbochs.c +0 -10
@@ -803,15 +803,6 @@ static void mbochs_release_dmabuf(struct dma_buf *buf)mutex_unlock (&mdev_state->ops_lock); } -static void *mbochs_kmap_atomic_dmabuf (struct dma_buf *buf, -unsigned long page_num) -{ -struct mbochs_dmabuf *dmabuf = buf->priv; -struct page *page = dmabuf->pages[page_num]; - -return kmap_atomic (page); -} -static void *mbochs_kmap_dmabuf (struct dma_buf *buf,unsigned long page_num) {struct mbochs_dmabuf *dmabuf = buf->priv;
@@ -824,7 +815,6 @@ static struct dma_buf_ops mbochs_dmabuf_ops = { .map_dma_buf = mbochs_map_dmabuf, .unmap_dma_buf = mbochs_unmap_dmabuf, .release = mbochs_release_dmabuf, - .map_atomic = mbochs_kmap_atomic_dmabuf, .map = mbochs_kmap_dmabuf, .mmap = mbochs_mmap_dmabuf, };
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 sample/mdev/mbochs: add mbochs_kunmap_dmabuf
There is no default implementation for dma_buf_ops->unmap. So add a function unmapping the page, otherwise we'll leak them.
--- samples/vfio-mdev/mbochs.c | 7 +++++++ 1 file changed, 7 insertions(+)
samples/vfio-mdev/mbochs.c +7 -0
@@ -811,11 +811,18 @@ static void *mbochs_kmap_dmabuf(struct dma_buf *buf, unsigned long page_num)return kmap (page); } +static void mbochs_kunmap_dmabuf (struct dma_buf *buf,unsigned long page_num, +void *vaddr) +{ +kunmap (vaddr); +} +static struct dma_buf_ops mbochs_dmabuf_ops = { .map_dma_buf = mbochs_map_dmabuf, .unmap_dma_buf = mbochs_unmap_dmabuf, .release = mbochs_release_dmabuf, .map = mbochs_kmap_dmabuf, + .unmap = mbochs_kunmap_dmabuf, .mmap = mbochs_mmap_dmabuf, };
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 25.06.2018 08:45 schrieb Gerd Hoffmann <[email protected]>:
Atomic mapping interface for dmabufs will be removed.
--- samples/vfio-mdev/mbochs.c | 10 ---------- 1 file changed, 10 deletions(-)
samples/vfio-mdev/mbochs.c +0 -10
@@ -803,15 +803,6 @@ static void mbochs_release_dmabuf(struct dma_buf *buf)mutex_unlock (&mdev_state->ops_lock); } -static void *mbochs_kmap_atomic_dmabuf (struct dma_buf *buf, -unsigned long page_num) -{ -struct mbochs_dmabuf *dmabuf = buf->priv; -struct page *page = dmabuf->pages[page_num]; - -return kmap_atomic (page); -} -static void *mbochs_kmap_dmabuf (struct dma_buf *buf,unsigned long page_num) {struct mbochs_dmabuf *dmabuf = buf->priv;
@@ -824,7 +815,6 @@ static struct dma_buf_ops mbochs_dmabuf_ops = { .map_dma_buf = mbochs_map_dmabuf, .unmap_dma_buf = mbochs_unmap_dmabuf, .release = mbochs_release_dmabuf, - .map_atomic = mbochs_kmap_atomic_dmabuf, .map = mbochs_kmap_dmabuf, .mmap = mbochs_mmap_dmabuf, };
--
2.9.3
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · On Mon, 25 Jun 2018 08:44:51 +0200 Gerd Hoffmann <[email protected]> wrote:
Atomic mapping interface for dmabufs will be removed.
Signed-off-by Gerd Hoffmann <[email protected]>
Though really the above commit needs to be updated to include this fix to preserve bisection since the mbochs sample driver is already upstream, suggests we only compile tested removing kmap_atomic without looking for other users. drm folks, please update. Thanks,
Alex
Quoted 25 lines
--- samples/vfio-mdev/mbochs.c | 10 ---------- 1 file changed, 10 deletions(-)samples/vfio-mdev/mbochs.c +0
-9@@ -803,15 +803,6 @@ static void mbochs_release_dmabuf(struct dma_buf *buf)mutex_unlock (&mdev_state->ops_lock); } -static void *mbochs_kmap_atomic_dmabuf (struct dma_buf *buf, -unsigned long page_num) -{ -struct mbochs_dmabuf *dmabuf = buf->priv; -struct page *page = dmabuf->pages[page_num]; - -return kmap_atomic (page); -} -static void *mbochs_kmap_dmabuf (struct dma_buf *buf,unsigned long page_num) {struct mbochs_dmabuf *dmabuf = buf->priv;
samples/vfio-mdev/mbochs.c static struct dma_buf_ops mbochs_dmabuf_ops = { · line 820
Quoted 7 lines
samples/vfio-mdev/mbochs.c +0
-1@@ -824,7 +815,6 @@ static struct dma_buf_ops mbochs_dmabuf_ops = { .map_dma_buf = mbochs_map_dmabuf, .unmap_dma_buf = mbochs_unmap_dmabuf, .release = mbochs_release_dmabuf, - .map_atomic = mbochs_kmap_atomic_dmabuf, .map = mbochs_kmap_dmabuf, .mmap = mbochs_mmap_dmabuf, };
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] sample/mdev/mbochs: add mbochs_kunmap_dmabuf
In reply to Gerd HoffmannQuoted 21 lines · On Mon, 25 Jun 2018 08:44:52 +0200 Gerd Hoffmann <[email protected]> wrote:
There is no default implementation for
dma_buf_ops->unmap. So add a function unmapping the page, otherwise we'll leak them.Signed-off-by Gerd Hoffmann <[email protected]>--- samples/vfio-mdev/mbochs.c | 7 +++++++ 1 file changed, 7 insertions(+)samples/vfio-mdev/mbochs.c +5
-0@@ -811,11 +811,18 @@ static void *mbochs_kmap_dmabuf(struct dma_buf *buf, unsigned long page_num)return kmap (page); } +static void mbochs_kunmap_dmabuf (struct dma_buf *buf,unsigned long page_num, +void *vaddr) +{ +kunmap (vaddr); +}
samples/vfio-mdev/mbochs.c static void *mbochs_kmap_dmabuf(struct dma_buf *buf, unsigned long page_num) · line 828
Quoted 10 lines
samples/vfio-mdev/mbochs.c +2
-0+static struct dma_buf_ops mbochs_dmabuf_ops = { .map_dma_buf = mbochs_map_dmabuf, .unmap_dma_buf = mbochs_unmap_dmabuf, .release = mbochs_release_dmabuf, .map = mbochs_kmap_dmabuf, + .unmap = mbochs_kunmap_dmabuf, .mmap = mbochs_mmap_dmabuf, };
Is this a fix for v4.18? AFAICT, the kmap_atomic removal is only in next, not yet upstream and hopefully includes this sample driver before hitting mainline. Should we therefore have a v4.18-rc based patch for this to include before v4.18 to resolve this? Thanks,
Alex
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] sample/mdev/mbochs: add mbochs_kunmap_dmabuf
Quoted 7 lines
samples/vfio-mdev/mbochs.c static void *mbochs_kmap_dmabuf(struct dma_buf *buf, unsigned long page_num) · line 827
Quoted 5 lines
samples/vfio-mdev/mbochs.c +1
-0.map = mbochs_kmap_dmabuf, + .unmap = mbochs_kunmap_dmabuf, .mmap = mbochs_mmap_dmabuf, };Is this a fix for v4.18?
Yes.
Quoted 4 lines
AFAICT, the
kmap_atomicremoval is only in
next, not yet upstream and hopefully includes this sample driver before hitting mainline. Should we therefore have a v4.18-rc based patch for this to include before v4.18 to resolve this?
The kmap_atomic interface will be removed in 4.19 because nobody uses it, so dropping the mbochs implementation already in 4.18 should not cause any issues.
So just queue both for 4.18 would be the easiest way do deal with the dependency I think.
cheers,
Gerd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] sample/mdev/mbochs: add mbochs_kunmap_dmabuf
Quoted 15 lines · On Tue, 26 Jun 2018 09:32:33 +0200 Gerd Hoffmann <[email protected]> wrote:
Quoted 7 lines
samples/vfio-mdev/mbochs.c static void *mbochs_kmap_dmabuf(struct dma_buf *buf, unsigned long page_num) · line 827
Quoted 5 lines
samples/vfio-mdev/mbochs.c +1
-0.map = mbochs_kmap_dmabuf, + .unmap = mbochs_kunmap_dmabuf, .mmap = mbochs_mmap_dmabuf, };Is this a fix for v4.18?
Yes.
Quoted 4 lines
AFAICT, the
kmap_atomicremoval is only in
next, not yet upstream and hopefully includes this sample driver before hitting mainline. Should we therefore have a v4.18-rc based patch for this to include before v4.18 to resolve this?
Quoted 6 lines
The
kmap_atomicinterface will be removed in 4.19 because nobody uses it, so dropping the mbochs implementation already in 4.18 should not cause any issues.So just queue both for 4.18 would be the easiest way do deal with the dependency I think.
Ok, so I'll drop the fixes tag and apply both to my for-linus branch for v4.18 and then Christian won't need to include it for the v4.19 patch. Thanks,
Alex
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel