Linux-Next discussions
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: "open list:VFIO MEDIATED DEVICE DRIVERS" <kvm@vger.kernel.org>,
	"airlied@linux.ie" <airlied@linux.ie>,
	"daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH 2/2] sample/mdev/mbochs: add mbochs_kunmap_dmabuf
Date: Tue, 26 Jun 2018 07:33:53 +0000	[thread overview]
Message-ID: <87defe1e-b430-4af0-b258-19aae23317a6@email.android.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1891 bytes --]



Am 26.06.2018 09:20 schrieb Alex Williamson <alex.williamson@redhat.com>:
On Mon, 25 Jun 2018 08:44:52 +0200
Gerd Hoffmann <kraxel@redhat.com> 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 <kraxel@redhat.com>
> ---
>  samples/vfio-mdev/mbochs.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c
> index aa25cda21d..85ac603769 100644
> --- a/samples/vfio-mdev/mbochs.c
> +++ b/samples/vfio-mdev/mbochs.c
> @@ -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,
>  };
>

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,

That actually doesn't looks like it has something to do with the kmap_atomic removal. More like a general bug fix to existing code.

BTW: The kmap_atomic removal was based on an older kernel version and I've forgotten to check for new DMA-buf implementation during rebase. So sorry for the noise.

Christian.

Alex


[-- Attachment #1.2: Type: text/html, Size: 3885 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2018-06-26  7:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26  7:33 Koenig, Christian [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-25  6:44 [PATCH 1/2] sample/mdev/mbochs: remove mbochs_kmap_atomic_dmabuf Gerd Hoffmann
2018-06-25  6:44 ` [PATCH 2/2] sample/mdev/mbochs: add mbochs_kunmap_dmabuf Gerd Hoffmann
2018-06-26  7:20   ` Alex Williamson
2018-06-26  7:32     ` Gerd Hoffmann
2018-06-27  1:55       ` Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87defe1e-b430-4af0-b258-19aae23317a6@email.android.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@linux.ie \
    --cc=alex.williamson@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox