Hi everyone,
This is a conversion of all subsystem-wide v4l2 code to avoid the
use of types based on time_t. The first five patches should all
be harmless and obvious, so they can get applied for 4.3 after
normal review.
The last two patches are marked RFC for now because their possible
impact on the user space ABI and to decide if this is the best
approach or whether we should instead introduce extra code in
the kernel to handle modified user space.
There are a few device drivers beyond this series that rely on
time_t/timeval/timespec internally, but they are all easy to fix
and can be taken care of later.
Arnd
Arnd Bergmann (7):
[media] dvb: use ktime_t for internal timeout
[media] dvb: remove unused systime() function
[media] dvb: don't use 'time_t' in event ioctl
[media] exynos4-is: use monotonic timestamps as advertized
[media] use v4l2_get_timestamp where possible
[RFC] [media]: v4l2: introduce v4l2_timeval
[RFC] [media] introduce v4l2_timespec type for timestamps
drivers/media/dvb-core/demux.h | 2 +-
drivers/media/dvb-core/dmxdev.c | 2 +-
drivers/media/dvb-core/dvb_demux.c | 17 ++++++-----------
drivers/media/dvb-core/dvb_demux.h | 4 ++--
drivers/media/dvb-core/dvb_net.c | 2 +-
drivers/media/dvb-frontends/dibx000_common.c | 10 ----------
drivers/media/dvb-frontends/dibx000_common.h | 2 --
drivers/media/pci/bt8xx/bttv-driver.c | 7 ++-----
drivers/media/pci/cx18/cx18-mailbox.c | 2 +-
drivers/media/pci/meye/meye.h | 2 +-
drivers/media/pci/zoran/zoran.h | 2 +-
drivers/media/platform/coda/coda.h | 2 +-
drivers/media/platform/exynos4-is/fimc-capture.c | 8 +-------
drivers/media/platform/exynos4-is/fimc-lite.c | 7 +------
drivers/media/platform/omap/omap_vout.c | 4 ++--
drivers/media/platform/omap3isp/ispstat.c | 5 ++---
drivers/media/platform/omap3isp/ispstat.h | 2 +-
drivers/media/platform/s3c-camif/camif-capture.c | 8 +-------
drivers/media/platform/vim2m.c | 2 +-
drivers/media/platform/vivid/vivid-ctrls.c | 2 +-
drivers/media/usb/cpia2/cpia2.h | 2 +-
drivers/media/usb/cpia2/cpia2_v4l.c | 2 +-
drivers/media/usb/gspca/gspca.c | 6 +++---
drivers/media/usb/usbvision/usbvision.h | 2 +-
drivers/media/v4l2-core/v4l2-common.c | 6 +++---
drivers/media/v4l2-core/v4l2-event.c | 20 +++++++++++++-------
drivers/staging/media/omap4iss/iss_video.c | 5 +----
include/media/v4l2-common.h | 2 +-
include/media/videobuf-core.h | 2 +-
include/trace/events/v4l2.h | 12 ++++++++++--
include/uapi/linux/dvb/video.h | 3 ++-
include/uapi/linux/omap3isp.h | 2 +-
include/uapi/linux/videodev2.h | 16 ++++++++++++++--
33 files changed, 79 insertions(+), 93 deletions(-)
--
2.1.0.rc2
'struct frame' uses two variables to store the sent timestamp - 'struct
timeval' and jiffies. jiffies is used to avoid discrepancies caused by
updates to system time. 'struct timeval' uses 32-bit representation for
seconds which will overflow in year 2038.
This patch does the following:
- Replace the use of 'struct timeval' and jiffies with struct timespec64,
which provides a 64-bit seconds timestamp and is year 2038 safe.
- timespec64 provides both long range (like jiffies) and high resolution
(like timeval). Using monotonic time (ktime_get_ts64) instead of wall-clock
time prevents any discrepancies caused by updates to system time.
The previous attempt at this patch and related discussion is here:
https://lists.linaro.org/pipermail/y2038/2015-May/000245.html
As noted previously, the existing code is 2038-safe, as it only uses a
delta instead of absolute timestamps. However, this patch is part of a
larger attempt to remove _all_ instances of 32-bit timekeeping from the
kernel (time_t, struct timeval and struct timespec) since we do not know
which of the many instances of their usage are buggy.
It is worth noting that there may be a slight performance penalty, due
to timespec64 using nanoseconds instead of microseconds. The tsince_hr
function contains a 32-bit multiply just like the existing code, but now
it also has a 32-bit divide.
Suggested-by: Arnd Bergmann <arnd(a)arndb.de>
Signed-off-by: Tina Ruchandani <ruchandani.tina(a)gmail.com>
--
Changes in v2:
- Change use of ktime_t to timespec64 to avoid expensive 64-bit
divide in ktime_us_delta
---
drivers/block/aoe/aoe.h | 3 +--
drivers/block/aoe/aoecmd.c | 38 +++++++++-----------------------------
2 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
index 9220f8e..d587806 100644
--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -112,8 +112,7 @@ enum frame_flags {
struct frame {
struct list_head head;
u32 tag;
- struct timeval sent; /* high-res time packet was sent */
- u32 sent_jiffs; /* low-res jiffies-based sent time */
+ struct timespec64 sent;
ulong waited;
ulong waited_total;
struct aoetgt *t; /* parent target I belong to */
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index d597e43..4df542f 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -398,8 +398,7 @@ aoecmd_ata_rw(struct aoedev *d)
skb = skb_clone(f->skb, GFP_ATOMIC);
if (skb) {
- do_gettimeofday(&f->sent);
- f->sent_jiffs = (u32) jiffies;
+ ktime_get_ts64(&f->sent);
__skb_queue_head_init(&queue);
__skb_queue_tail(&queue, skb);
aoenet_xmit(&queue);
@@ -489,8 +488,7 @@ resend(struct aoedev *d, struct frame *f)
skb = skb_clone(skb, GFP_ATOMIC);
if (skb == NULL)
return;
- do_gettimeofday(&f->sent);
- f->sent_jiffs = (u32) jiffies;
+ ktime_get_ts64(&f->sent);
__skb_queue_head_init(&queue);
__skb_queue_tail(&queue, skb);
aoenet_xmit(&queue);
@@ -499,32 +497,17 @@ resend(struct aoedev *d, struct frame *f)
static int
tsince_hr(struct frame *f)
{
- struct timeval now;
+ struct timespec64 now, delta;
int n;
- do_gettimeofday(&now);
- n = now.tv_usec - f->sent.tv_usec;
- n += (now.tv_sec - f->sent.tv_sec) * USEC_PER_SEC;
+ ktime_get_ts64(&now);
+ delta = timespec64_sub(now, f->sent);
+ n = ((int32_t) (delta.tv_sec)) * USEC_PER_SEC +
+ delta.tv_nsec / NSEC_PER_USEC;
if (n < 0)
n = -n;
- /* For relatively long periods, use jiffies to avoid
- * discrepancies caused by updates to the system time.
- *
- * On system with HZ of 1000, 32-bits is over 49 days
- * worth of jiffies, or over 71 minutes worth of usecs.
- *
- * Jiffies overflow is handled by subtraction of unsigned ints:
- * (gdb) print (unsigned) 2 - (unsigned) 0xfffffffe
- * $3 = 4
- * (gdb)
- */
- if (n > USEC_PER_SEC / 4) {
- n = ((u32) jiffies) - f->sent_jiffs;
- n *= USEC_PER_SEC / HZ;
- }
-
return n;
}
@@ -589,7 +572,6 @@ reassign_frame(struct frame *f)
nf->waited = 0;
nf->waited_total = f->waited_total;
nf->sent = f->sent;
- nf->sent_jiffs = f->sent_jiffs;
f->skb = skb;
return nf;
@@ -633,8 +615,7 @@ probe(struct aoetgt *t)
skb = skb_clone(f->skb, GFP_ATOMIC);
if (skb) {
- do_gettimeofday(&f->sent);
- f->sent_jiffs = (u32) jiffies;
+ ktime_get_ts64(&f->sent);
__skb_queue_head_init(&queue);
__skb_queue_tail(&queue, skb);
aoenet_xmit(&queue);
@@ -1474,8 +1455,7 @@ aoecmd_ata_id(struct aoedev *d)
skb = skb_clone(skb, GFP_ATOMIC);
if (skb) {
- do_gettimeofday(&f->sent);
- f->sent_jiffs = (u32) jiffies;
+ ktime_get_ts64(&f->sent);
}
return skb;
--
2.8.0.rc3.226.g39d4020
Dear Customer,
This is to confirm that one or more of your parcels has been shipped.
Delivery Label is attached to this email.
Yours faithfully,
Roy Schulz,
FedEx Operation Manager.
Hi,
Would you be interested in Acquiring Linux Users contacts list of
2016?
Information Fields - First and Last name, Phone number, Email Address,
Company Name, Job Title, Address, City, State, Zip, SIC code/Industry,
Revenue and Company Size. The leads can also be further customized as per
requirements.
We can provide contact list from any country/industry/title.
We also have the following Users:
* Netapp
* Oracle
* 3PAR
* Pure Storage
* Accenture and many more.
Please review and let me know if you are interested in any of the technology
users or different contact list for your campaigns and I will provide more
information for the same.
Appreciate your time and look forward to hear from you.
Thanks,
Natasha Claire
Demand Generation-Technology Database
| List acquisition | Technology Lists | Email/Data Appending | Search Engine
Optimization |
To Opt Out, please reply with Leave Out in the Subject Line.
The series is part of y2038 changes.
This changes a few syscalls that have common functions to use
struct timespec64 instead of struct timespec.
This does not include changes to system call uapi interfaces.
Those will be in a different series.
Thanks to Arnd Bergmann for comments on the patches.
Deepa Dinamani (3):
time: Add missing implementation for timespec64_add_safe()
fs: poll/select/recvmmsg: use timespec64 for timeout events
time: Remove timespec_add_safe()
fs/eventpoll.c | 12 ++++-----
fs/select.c | 67 ++++++++++++++++++++++++++++----------------------
include/linux/poll.h | 11 +++++----
include/linux/time64.h | 17 ++++++-------
kernel/time/time.c | 21 ++++++++++++++++
net/socket.c | 8 +++---
6 files changed, 82 insertions(+), 54 deletions(-)
--
1.9.1
Cc: John Stultz <john.stultz(a)linaro.org>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Alexander Viro <viro(a)zeniv.linux.org.uk>
Cc: "David S. Miller" <davem(a)davemloft.net>
Cc: netdev(a)vger.kernel.org
Notice to Appear,
You have to appear in the Court on the May 13.
You are kindly asked to prepare and bring the documents relating to the case to Court on the specified date.
Note: The case may be heard by the judge in your absence if you do not come.
The Court Notice is attached to this email.
Regards,
William Hudson,
District Clerk.