Re: [PATCH 3/3] media: v4l2-ctl: Add support to VIDIOC_DQEVENT_TIME32 on non x86_64 arch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/09/2021 13:08, Hans Verkuil wrote:
> On 02/09/2021 10:49, Laurent Pinchart wrote:
>> (CC'ing Arnd)
>>
>> On Thu, Sep 02, 2021 at 10:39:46AM +0200, Hans Verkuil wrote:
>>> On 02/09/2021 10:24, Hans Verkuil wrote:
>>>> On 28/07/2021 12:06, Dafna Hirschfeld wrote:
>>>>> Currently, if the ioctl VIDIOC_DQEVENT_TIME32 is called on e.g. Arm-64
>>>>> the function 'v4l2_compat_translate_cmd' doesn't have a 'translation'
>>>>> for the cmd and so 'cmd' is returned as is. This cause
>>>>> a failure '-ENOTTY' in __video_do_ioctl.
>>>>
>>>> I don't really see how this would happen. As far as I can tell (and admittedly,
>>>> the code is hard to follow) on such a system there is no need for any 32-bit to
>>>> 64-bit conversion in v4l2-compat-ioctl32.c since struct v4l2_event_time32 is the
>>>> same for both architectures.
>>>>
>>>> And in v4l2-ioctl.c VIDIOC_DQEVENT_TIME32 is handled correctly as far as I can
>>>> tell. Where exactly does the return -ENOTTY happen?
>>>>
>>>> It definitely does not make sense to modify v4l2-compat-ioctl32.c if there is
>>>> nothing to convert between 32 and 64 bit. If there is a bug, then that should be
>>>> in v4l2-ioctl.c.
>>>>
>>>> Note that it is perfectly possible that there is a bug for arm64 and this ioctl,
>>>> since that's the one combination I've never tested since I don't have a test setup
>>>> for that.
>>>
>>> How did you test this anyway? With which libc/compiler? It would be nice if I could
>>> test this myself on e.g. a Raspberry Pi.
> 
> I added a test in v4l2-compliance and it appears that something is indeed wrong for arm64.
> I'll dig deeper into this. I don't get ENOTTY though, instead it returns 0 but the contents
> of the returned v4l2_event is garbled.
> 
> It works fine for x86_64, but not for arm64.

Actually, commit c344f07aa1b4 ("media: v4l2-core: ignore native time32 ioctls on 64-bit")
fixes this issue.

I was testing with an older kernel version on my RPi that didn't have this commit, and
then it failed. With the latest kernel it's fine.

I'm marking this series as Obsolete.

Regards,

	Hans



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux