>> which only does one 64-bit division, and it's one that we can probably
>> optimize out in the future (we can check in ktime_ms_delta whether the
>> difference is more than 2^32 nanoseconds as the fast path).
It looks like ktime_divns already has that optimization for 32-bit divisor,
so your sol
>
> How about
>
> remaining_jiffies = msecs_to_jiffies(ktime_ms_delta(*timeout, now));
>
> which only does one 64-bit division, and it's one that we can probably
> optimize out in the future (we can check in ktime_ms_delta whether the
> difference is more than 2^32 nanoseconds as the fast p
the kernel.
Signed-off-by: Tina Ruchandani
--
Changes in v2:
Fix checkpatch warning
---
drivers/gpu/drm/msm/msm_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index c03b967..59c1948 100644
--- a/drivers/g
the kernel.
Signed-off-by: Tina Ruchandani
---
drivers/gpu/drm/msm/msm_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index c03b967..b095085 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm
'struct timespec' uses a 32-bit field for seconds, which
will overflow in year 2038 and beyond. This patch is part
of a larger attempt to remove instances of timeval, timespec
and time_t, all of which suffer from the y2038 issue, from the
kernel.
Signed-off-by: Tina Ruchandani
---
d
>
> Applied to 4.6/scsi-queue.
Hi Martin,
I am not seeing this patch in v4.6-rc3 in Linus's tree. Should I resend this?
Thanks,
Tina
lliseconds
since Unix epoch).
Signed-off-by: Tina Ruchandani
Reviewed-by: Arnd Bergmann
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 8c44b9c..326c
f specifier to avoid the
seconds value being truncated.
The patch was build-tested / debugged by removing the
"if VERBOSE > SHOW_ERROR_MESSAGES" guards.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmann
--
Changes in v3:
Fix commit message
Changes in v2:
Changed prin
e than 8 digits and
use a different specifier from %li.
The patch was build-tested / debugged by removing the
"if VERBOSE > SHOW_ERROR_MESSAGES" guards.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmann
--
Changes in v2:
- Changed printf specifier as suggested by Arnd Bergman
int more than 8 digits and using
a different specifier from %li.
The patch was build-tested / debugged by removing the
"if VERBOSE > SHOW_ERROR_MESSAGES" guards.
Signed-off-by: Tina Ruchandani
---
drivers/net/wireless/intersil/prism54/isl_38xx.c | 29 +++-
1 file change
econds portion of timeval. However, this patch does the
replacement as part of a larger effort to remove all instances of
'struct timeval' from the kernel (that would help identify cases
where the code is actually broken).
Signed-off-by: Tina Ruchandani
---
drivers/firewire/nosy.c | 8 +++
safe.
The patch also replaces do_gettimeofday() (wall-clock time) with
ktime_get() (monotonic time) since we only care about elapsed time here.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmnann
Suggested-by: David Miller
---
Changes in v7:
- Upodate variable names to remove mentions
>
> Therefore please adjust the variable name appropriately, thanks.
David,
Thanks for the feedback, I will send out a v3.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org
>
> Thanks for the conversion. Can you please check if other (scsi) drivers
> have the same y2038 issues? A quick "git grep do_gettimeofday
> drivers/scsi/ | wc -l" reveals 30 occurrences (of cause not all are
> problematic).
>
Hi Johannes,
Yes, there are quite a few occurrences of timeval within
effort to remove instances of 'struct timespec' and other data-structures
suffering from y2038 problem from the kernel.
Suggested-by: Arnd Bergmann
Signed-off-by: Tina Ruchandani
---
Changes in v2:
- Use 64-bit division API, fix 32-bit build
---
fs/afs/main.c | 6 ++
1 file changed, 2 i
ned-off-by: Tina Ruchandani
--
Changes in v3:
- Remove stex_gettime altogether, directly assign the timestamp.
Changes in v2:
- Change subject line to indicate that the patch is restricted to stex driver.
---
---
drivers/scsi/stex.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletion
code only uses the timestamps to compute a
small elapsed interval. This patch is part of a larger attempt to remove
instances of 32-bit timekeeping structures (timespec, timeval, time_t)
from the kernel so it is easier to identify where the real 2038 issues
are.
Signed-off-by: Tina Ruchandani
---
mestamp at 4096 seconds,
so the correctness of the code is not affected. This patch is part of a larger
attempt to remove instances of struct timeval and other 32-bit timekeeping
(time_t, struct timespec) from the kernel.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmann
---
Changes in
ec64' which is
y2038 safe. This patch is part of a larger attempt to remove instances
of struct timeval and other 32-bit timekeeping (time_t, struct timespec)
from the kernel.
Signed-off-by: Tina Ruchandani
---
drivers/usb/mon/mon_bin.c | 17 +
1 file changed, 9 insertions(+)
onds field is an overkill. This patch replaces
the use of struct timeval with time64_t to store a 64-bit seconds field.
Signed-off-by: Tina Ruchandani
---
net/atm/common.c | 2 +-
net/atm/mpc.c | 9 +
net/atm/mpoa_caches.c | 49
safe.
The patch also replaces do_gettimeofday() (wall-clock time) with
ktime_get() (monotonic time) since we only care about elapsed time here.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmnann
---
Changes in v6:
- Fix compilation errors caused by bad code editing
Changes in v5:
- Apply
safe.
The patch also replaces do_gettimeofday() (wall-clock time) with
ktime_get() (monotonic time) since we only care about elapsed time here.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmnann
---
drivers/isdn/mISDN/clock.c | 51 +-
include/lin
atch
uses ktime_get_real() preserving the use of wall-clock time in the
original code.
Signed-off-by: Tina Ruchandani
---
drivers/media/rc/streamzap.c | 19 +--
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamz
>>> + hz = 100/delta;
>
> This needs to be on of the do_div family.
>
> Dave.
Hi Dave,
I build-tested the patch for both 32-bit and 64-bit x86. If my
understanding is correct, since the divisor is 64-bit here, the
compiler will do "if (delta > 100) hz = 0; else hz =
100/(s32)delta"
variables (timeval, timespec, time_t)
which are not year 2038 safe, from the kernel.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmann
--
Changes in v3:
- Clean up commit message.
- Use ktime_us_delta which is more concise than the combination
of ktime_sub and ktime_to_us
Changes in v2
> --
> Changes in v2:
> - Use the more concise ktime_us_delta
Oops, please ignore this patch and please consider the v3 sent out
immediately after instead.
Tina
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More ma
diffing the tv[i] and tv[i-1] values. The original
printk statement seems to get the order wrong. This patch preserves
that order.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmann
--
Changes in v2:
- Use the more concise ktime_us_delta
- Preserve the waketime argument in
is part of a larger
effort to remove all instances of 'struct timeval', 'struct
timespec', time_t and other 32-bit timekeeping variables
from the kernel.
The patch also replaces the use of real time (do_gettimeofday)
with monotonic time (ktime_get).
Signed-off-by: Tina
diffing the tv[i] and tv[i-1] values. The original
printk statement seems to get the order wrong. This patch preserves
that order.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmann
--
Changes in v2:
- Use the more concise ktime_us_delta
- Preserve the waketime argument in
any discprepancies caused by updates to system time.
Signed-off-by: Tina Ruchandani
---
drivers/block/aoe/aoe.h| 3 +--
drivers/block/aoe/aoecmd.c | 36 +++-
2 files changed, 8 insertions(+), 31 deletions(-)
diff --git a/drivers/block/aoe/aoe.h b/driver
ned-off-by: Tina Ruchandani
--
Changes in v3:
- Remove stex_gettime altogether, directly assign the timestamp.
Changes in v2:
- Change subject line to indicate that the patch is restricted to stex driver.
---
---
drivers/scsi/stex.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletion
> but the timestamp will also overflow. So what is the point?
>
The 32-bit timestamp obtained using do_gettimeofday() will overflow in
year 2038. However, with 64-bit timestamps, we get practically
infinite time. mon_bin_hdr already has support for a 64-bit seconds
timestamp. This patch changes ho
mespec64' which is
y2038 safe.
Signed-off-by: Tina Ruchandani
---
drivers/usb/mon/mon_bin.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index 9a62e89..bfc2ebd 100644
--- a/drivers/usb/mon/mon_bin.c
+
he timestamp at 4096 seconds,
so the correctness of the code is not affected. This patch is part of a larger
attempt to remove instances of struct timeval and other 32-bit timekeeping
(time_t, struct timespec) from the kernel.
Signed-off-by: Tina Ruchandani
---
drivers/usb/mon/mon_text.c | 10 +
get_seconds() returns real wall-clock seconds. On 32-bit systems
this value will overflow in year 2038 and beyond. This patch changes
afs_vnode record to use ktime_get_real_seconds() instead, for the
fields cb_expires and cb_expires_at.
Signed-off-by: Tina Ruchandani
---
fs/afs/fsclient.c | 2
get_seconds() returns real wall-clock seconds. On 32-bit systems
this value will overflow in year 2038 and beyond. This patch changes
afs's vlocation record to use ktime_get_real_seconds() instead, for the
fields time_of_death and update_at.
Signed-off-by: Tina Ruchandani
---
fs/afs/callb
with ktime_get_real_seconds.
Fields that propagate to the inode (mtime_client, mtime_server,
creation) remain untouched, as the inode timestamps are only 32bit.
Tina Ruchandani (2):
afs: Migrate vlocation fields to 64-bit
afs: Prevent callback expiry timer overflow
fs/afs/callback.c | 7 ---
f
tring to print time as a single 64-bit nanoseconds
value ("%lld") instead of seconds and microseconds. This simplifies
the code since converting ktime_t to that format would need expensive
computation. However, the debug log string is less readable than the
previous format.
effort to remove instances of 'struct timespec' and other data-structures
suffering from y2038 problem from the kernel.
Suggested-by: Arnd Bergmann
Signed-off-by: Tina Ruchandani
---
fs/afs/main.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/afs/main.
noseconds.
Suggested-by: Arnd Bergmann
Suggested-by: Steven Rostedt
Signed-off-by: Tina Ruchandani
---
Changes in v4:
- Fix typo in commit message.
- Avoid typecast to 'long long' by defining RUN_TIME as '10ULL'
instead of '10'.
Changes in
struct timeval on 32-bit systems will have its tv_sec
value overflow in year 2038 and beyond.
Use a 64 bit value to print time of the coredump in seconds.
ktime_get_real_seconds is chosen here for efficiency reasons.
Suggested by: Arnd Bergmann
Signed-off-by: Tina Ruchandani
---
Changes in v2
econds) for start and end time.
Suggested-by: Arnd Bergmann
Signed-off-by: Tina Ruchandani
---
Changes in v2:
- Use ktime_t to be able to use ktime_ms_delta
which is more efficient than timespec64 based methods.
---
kernel/power/process.c | 12 +---
1 file changed, 5 inser
or seconds
Suggested-by: Arnd Bergmann
Signed-off-by: Tina Ruchandani
---
Changes in v3:
- Use a more efficient way to compute condition for exiting
loop.
- Fix variable naming - all caps is only for macros.
Changes in v2:
- Use ktime_t instead of timespec64 for e
27; issues caused by
using seconds and nanoseconds directly
- use monotonic time (ktime_get()) since we only care about elapsed
time.
Signed-off-by: Tina Ruchandani
Suggested-by: Arnd Bergmann
--
Changes in v4:
- Rebased patch off of 3.18-rc1
Changes in v3:
- Use monoto
),
which simplifies timekeeping, as it does not have to deal with cases
where stop_time is less than start_time.
Signed-off-by: Tina Ruchandani
Reviewed-by: Arnd Bergmann
---
sound/pci/es1968.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/sound/pci
45 matches
Mail list logo