All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Liu <liumartin@google.com>
To: sumit.semwal@linaro.org, minchan@kernel.org, surenb@google.com,
	wvw@google.com
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, jenhaochen@google.com,
	liumartin@google.com, linux-media@vger.kernel.org
Subject: Re: [PATCH] dma-buf: support 32bit DMA_BUF_SET_NAME ioctl
Date: Mon, 24 Feb 2020 11:39:41 +0800	[thread overview]
Message-ID: <20200224033941.GB211610@google.com> (raw)
In-Reply-To: <20200114134101.159194-1-liumartin@google.com>

On Tue, Jan 14, 2020 at 09:41:01PM +0800, Martin Liu wrote:

CC more MLs for winder review.

> This commit adds SET_NAME ioctl coversion to
> support 32 bit ioctl.
> 
> Signed-off-by: Martin Liu <liumartin@google.com>
> ---
>  drivers/dma-buf/dma-buf.c | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index ce41cd9b758a..a73048b34843 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -25,6 +25,7 @@
>  #include <linux/mm.h>
>  #include <linux/mount.h>
>  #include <linux/pseudo_fs.h>
> +#include <linux/compat.h>
>  
>  #include <uapi/linux/dma-buf.h>
>  #include <uapi/linux/magic.h>
> @@ -409,13 +410,32 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file)
>  	dma_resv_unlock(dmabuf->resv);
>  }
>  
> +#ifdef CONFIG_COMPAT
> +static long dma_buf_ioctl_compat(struct file *file, unsigned int cmd,
> +				 unsigned long arg)
> +{
> +	switch (_IOC_NR(cmd)) {
> +	case _IOC_NR(DMA_BUF_SET_NAME):
> +		/* Fix up pointer size*/
> +		if (_IOC_SIZE(cmd) == sizeof(compat_uptr_t)) {
> +			cmd &= ~IOCSIZE_MASK;
> +			cmd |= sizeof(void *) << IOCSIZE_SHIFT;
> +		}
> +		break;
> +	}
> +	return dma_buf_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
> +}
> +#endif
> +
>  static const struct file_operations dma_buf_fops = {
>  	.release	= dma_buf_release,
>  	.mmap		= dma_buf_mmap_internal,
>  	.llseek		= dma_buf_llseek,
>  	.poll		= dma_buf_poll,
>  	.unlocked_ioctl	= dma_buf_ioctl,
> -	.compat_ioctl	= compat_ptr_ioctl,
> +#ifdef CONFIG_COMPAT
> +	.compat_ioctl	= dma_buf_ioctl_compat,
> +#endif
>  	.show_fdinfo	= dma_buf_show_fdinfo,
>  };
>  
> -- 
> 2.25.0.rc1.283.g88dfdc4193-goog
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Martin Liu <liumartin@google.com>
To: sumit.semwal@linaro.org, minchan@kernel.org, surenb@google.com,
	wvw@google.com
Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org,
	liumartin@google.com, jenhaochen@google.com
Subject: Re: [PATCH] dma-buf: support 32bit DMA_BUF_SET_NAME ioctl
Date: Mon, 24 Feb 2020 11:39:41 +0800	[thread overview]
Message-ID: <20200224033941.GB211610@google.com> (raw)
In-Reply-To: <20200114134101.159194-1-liumartin@google.com>

On Tue, Jan 14, 2020 at 09:41:01PM +0800, Martin Liu wrote:

CC more MLs for winder review.

> This commit adds SET_NAME ioctl coversion to
> support 32 bit ioctl.
> 
> Signed-off-by: Martin Liu <liumartin@google.com>
> ---
>  drivers/dma-buf/dma-buf.c | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index ce41cd9b758a..a73048b34843 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -25,6 +25,7 @@
>  #include <linux/mm.h>
>  #include <linux/mount.h>
>  #include <linux/pseudo_fs.h>
> +#include <linux/compat.h>
>  
>  #include <uapi/linux/dma-buf.h>
>  #include <uapi/linux/magic.h>
> @@ -409,13 +410,32 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file)
>  	dma_resv_unlock(dmabuf->resv);
>  }
>  
> +#ifdef CONFIG_COMPAT
> +static long dma_buf_ioctl_compat(struct file *file, unsigned int cmd,
> +				 unsigned long arg)
> +{
> +	switch (_IOC_NR(cmd)) {
> +	case _IOC_NR(DMA_BUF_SET_NAME):
> +		/* Fix up pointer size*/
> +		if (_IOC_SIZE(cmd) == sizeof(compat_uptr_t)) {
> +			cmd &= ~IOCSIZE_MASK;
> +			cmd |= sizeof(void *) << IOCSIZE_SHIFT;
> +		}
> +		break;
> +	}
> +	return dma_buf_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
> +}
> +#endif
> +
>  static const struct file_operations dma_buf_fops = {
>  	.release	= dma_buf_release,
>  	.mmap		= dma_buf_mmap_internal,
>  	.llseek		= dma_buf_llseek,
>  	.poll		= dma_buf_poll,
>  	.unlocked_ioctl	= dma_buf_ioctl,
> -	.compat_ioctl	= compat_ptr_ioctl,
> +#ifdef CONFIG_COMPAT
> +	.compat_ioctl	= dma_buf_ioctl_compat,
> +#endif
>  	.show_fdinfo	= dma_buf_show_fdinfo,
>  };
>  
> -- 
> 2.25.0.rc1.283.g88dfdc4193-goog
> 

  reply	other threads:[~2020-02-24  9:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 13:41 [PATCH] dma-buf: support 32bit DMA_BUF_SET_NAME ioctl Martin Liu
2020-02-24  3:39 ` Martin Liu [this message]
2020-02-24  3:39   ` Martin Liu
2020-04-07 13:26   ` Sumit Semwal
2020-04-07 13:26     ` Sumit Semwal
2020-04-07 14:05     ` Daniel Vetter
2020-04-07 14:05       ` Daniel Vetter

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=20200224033941.GB211610@google.com \
    --to=liumartin@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jenhaochen@google.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=surenb@google.com \
    --cc=wvw@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.