From: Eugene Syromiatnikov <esyr@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
y2038@lists.linaro.org,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
linux-api@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
ldv@altlinux.org, glebfm@altlinux.org
Subject: Re: [3/7,media] dvb: don't use 'time_t' in event ioctl
Date: Mon, 28 Aug 2017 17:32:43 +0200 [thread overview]
Message-ID: <20170828153243.GA27121@asgard.redhat.com> (raw)
In-Reply-To: <1442332148-488079-4-git-send-email-arnd@arndb.de>
On Tue, Sep 15, 2015 at 05:49:04PM +0200, Arnd Bergmann wrote:
> 'struct video_event' is used for the VIDEO_GET_EVENT ioctl, implemented
> by drivers/media/pci/ivtv/ivtv-ioctl.c and
> drivers/media/pci/ttpci/av7110_av.c. The structure contains a 'time_t',
> which will be redefined in the future to be 64-bit wide, causing an
> incompatible ABI change for this ioctl.
>
> As it turns out, neither of the drivers currently sets the timestamp
> field, and it is presumably useless anyway because of the limited
> resolutions (no sub-second times). This means we can simply change
> the structure definition to use a 'long' instead of 'time_t' and
> remain compatible with all existing user space binaries when time_t
> gets changed.
>
> If anybody ever starts using this field, they have to make sure not
> to use 1970 based seconds in there, as those overflow in 2038.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> include/uapi/linux/dvb/video.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/dvb/video.h b/include/uapi/linux/dvb/video.h
> index d3d14a59d2d5..6c7f9298d7c2 100644
> --- a/include/uapi/linux/dvb/video.h
> +++ b/include/uapi/linux/dvb/video.h
> @@ -135,7 +135,8 @@ struct video_event {
> #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
> #define VIDEO_EVENT_DECODER_STOPPED 3
> #define VIDEO_EVENT_VSYNC 4
> - __kernel_time_t timestamp;
> + /* unused, make sure to use atomic time for y2038 if it ever gets used */
> + long timestamp;
This change breaks x32 ABI (and possibly MIPS n32 ABI), as __kernel_time_t
there is 64 bit already:
https://sourceforge.net/p/strace/mailman/message/36015326/
Note the change in structure size from 0x20 to 0x14 for VIDEO_GET_EVENT
command in linux/x32/ioctls_inc0.h.
> union {
> video_size_t size;
> unsigned int frame_rate; /* in frames per 1000sec */
next prev parent reply other threads:[~2017-08-28 15:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 15:49 [PATCH 0/7] [media] y2038 conversion for subsystem Arnd Bergmann
2015-09-15 15:49 ` [PATCH 1/7] [media] dvb: use ktime_t for internal timeout Arnd Bergmann
2015-09-15 17:55 ` Andreas Oberritter
[not found] ` <55F85B97.8000700-p6skyjIMMCQb1SvskN2V4Q@public.gmane.org>
2015-09-15 20:30 ` [Y2038] " Arnd Bergmann
2015-09-15 15:49 ` [PATCH 2/7] [media] dvb: remove unused systime() function Arnd Bergmann
2015-09-15 15:49 ` [PATCH 3/7] [media] dvb: don't use 'time_t' in event ioctl Arnd Bergmann
2017-08-28 15:32 ` Eugene Syromiatnikov [this message]
2017-08-30 20:25 ` [3/7,media] " Arnd Bergmann
2017-08-31 13:10 ` Eugene Syromiatnikov
2015-09-15 15:49 ` [PATCH 4/7] [media] exynos4-is: use monotonic timestamps as advertized Arnd Bergmann
[not found] ` <1442332148-488079-5-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2015-09-16 8:55 ` Sylwester Nawrocki
2015-09-15 15:49 ` [PATCH 5/7] [media] use v4l2_get_timestamp where possible Arnd Bergmann
[not found] ` <1442332148-488079-6-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2015-09-16 8:57 ` Sylwester Nawrocki
2015-09-15 15:49 ` [PATCH 6/7] [RFC] [media]: v4l2: introduce v4l2_timeval Arnd Bergmann
[not found] ` <1442332148-488079-7-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2015-09-15 16:27 ` Hans Verkuil
2015-09-15 20:26 ` Arnd Bergmann
2015-09-16 6:51 ` Hans Verkuil
[not found] ` <55F91162.8030002-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2015-09-16 7:56 ` Arnd Bergmann
2015-09-16 8:12 ` Hans Verkuil
[not found] ` <55F92450.8010802-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2015-09-16 8:40 ` Arnd Bergmann
2015-09-15 15:49 ` [PATCH 7/7] [RFC] [media] introduce v4l2_timespec type for timestamps Arnd Bergmann
2015-09-15 16:32 ` Hans Verkuil
2015-09-15 20:27 ` Arnd Bergmann
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=20170828153243.GA27121@asgard.redhat.com \
--to=esyr@redhat.com \
--cc=arnd@arndb.de \
--cc=glebfm@altlinux.org \
--cc=ldv@altlinux.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=y2038@lists.linaro.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;
as well as URLs for NNTP newsgroup(s).