From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH v2 1/1] v4l: subdev: Allow 32-bit compat IOCTLs
Date: Fri, 31 Jan 2014 19:52:57 +0200 [thread overview]
Message-ID: <52EBE2F9.5@linux.intel.com> (raw)
In-Reply-To: <52EBDED0.7020007@xs4all.nl>
Hi Hans,
Hans Verkuil wrote:
> On 01/31/2014 05:15 PM, Sakari Ailus wrote:
>> I thought this was already working but apparently not. Allow 32-bit compat
>> IOCTLs on 64-bit systems.
>>
>> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>> ---
>> drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
>> index 8f7a6a4..1fce944 100644
>> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
>> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
>> @@ -1087,6 +1087,18 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
>> case VIDIOC_QUERY_DV_TIMINGS:
>> case VIDIOC_DV_TIMINGS_CAP:
>> case VIDIOC_ENUM_FREQ_BANDS:
>> + /* Sub-device IOCTLs */
>> + case VIDIOC_SUBDEV_G_FMT:
>> + case VIDIOC_SUBDEV_S_FMT:
>> + case VIDIOC_SUBDEV_G_FRAME_INTERVAL:
>> + case VIDIOC_SUBDEV_S_FRAME_INTERVAL:
>> + case VIDIOC_SUBDEV_ENUM_MBUS_CODE:
>> + case VIDIOC_SUBDEV_ENUM_FRAME_SIZE:
>> + case VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
>> + case VIDIOC_SUBDEV_G_CROP:
>> + case VIDIOC_SUBDEV_S_CROP:
>> + case VIDIOC_SUBDEV_G_SELECTION:
>> + case VIDIOC_SUBDEV_S_SELECTION:
>> case VIDIOC_SUBDEV_G_EDID32:
>> case VIDIOC_SUBDEV_S_EDID32:
>> ret = do_video_ioctl(file, cmd, arg);
>>
>
> Can you test with contrib/test/ioctl-test? Compile with:
>
> gcc -o ioctl-test -m32 -I ../../include/ ioctl-test.c
>
> Make sure you use the latest v4l-utils version and run autoreconf -vfi
> and configure first.
>
> BTW, I noticed that VIDIOC_DBG_G_CHIP_INFO is missing as well.
>
> Hmm, this is just asking for problems.
>
> How about this patch:
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> index 8f7a6a4..cd9da4ce 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -1001,108 +1001,19 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
> long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
> {
> struct video_device *vdev = video_devdata(file);
> - long ret = -ENOIOCTLCMD;
> + long ret = -ENOTTY;
I don't think we should return -ENOTTY here. The conversion is performed
in compat_sys_ioctl() (in fs/compat_ioctl.c) which, if I understand
correctly, expressly expects -ENOIOCTLCMD instead.
Otherwise this looks good to me.
--
Regards,
Sakari Ailus
sakari.ailus@linux.intel.com
next prev parent reply other threads:[~2014-01-31 17:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 15:28 [PATCH 1/1] v4l: subdev: Allow 32-bit compat IOCTLs Sakari Ailus
2014-01-31 15:37 ` Hans Verkuil
2014-01-31 15:51 ` Sakari Ailus
2014-01-31 16:05 ` Hans Verkuil
2014-01-31 16:06 ` Sakari Ailus
2014-01-31 16:07 ` Hans Verkuil
2014-01-31 16:15 ` [PATCH v2 " Sakari Ailus
2014-01-31 17:35 ` Hans Verkuil
2014-01-31 17:52 ` Sakari Ailus [this message]
2014-02-04 20:10 ` Mauro Carvalho Chehab
2014-02-05 7:03 ` Hans Verkuil
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=52EBE2F9.5@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@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