diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-06-18 17:19:24 +0300 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2019-11-13 22:59:33 +0300 |
commit | b98c7518c5345ac5f930fd40ce9d8d2b8dc2ba06 (patch) | |
tree | aeb59c97efd284684d9b347f3a776d00a11e2363 /drivers/firewire/core.h | |
parent | 4d856f72c10ecb060868ed10ff1b1453943fc6c8 (diff) | |
download | linux-b98c7518c5345ac5f930fd40ce9d8d2b8dc2ba06.tar.xz |
firewire: ohci: stop using get_seconds() for BUS_TIME
The ohci driver uses the get_seconds() function to implement the 32-bit
CSR_BUS_TIME register. This was added in 2010 commit a48777e03ad5
("firewire: add CSR BUS_TIME support").
As get_seconds() returns a 32-bit value (on 32-bit architectures), it
seems like a good fit for that register, but it is also deprecated because
of the y2038/y2106 overflow problem, and should be replaced throughout
the kernel with either ktime_get_real_seconds() or ktime_get_seconds().
I'm using the latter here, which uses monotonic time. This has the
advantage of behaving better during concurrent settimeofday() updates
or leap second adjustments and won't overflow a 32-bit integer, but
the downside of using CLOCK_MONOTONIC instead of CLOCK_REALTIME is
that the observed values are not related to external clocks.
If we instead need UTC but can live with clock jumps or overflows,
then we should use ktime_get_real_seconds() instead, retaining the
existing behavior.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/lkml/20180711124923.1205200-1-arnd@arndb.de/
Reviewed-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core.h')
0 files changed, 0 insertions, 0 deletions