summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-core/dvb_frontend.c
diff options
context:
space:
mode:
authorAbhilash Jindal <klock.android@gmail.com>2016-01-31 03:47:31 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-01 13:35:29 -0200
commit6b3f99989eb73e5250bba9dfeaa852939acfbf70 (patch)
tree40c75abc134fa5d7660a8096859e24547b2b5727 /drivers/media/dvb-core/dvb_frontend.c
parent3801bc7d1b8dd70d47a92e58d6fb5653c10b7c95 (diff)
downloadlinux-6b3f99989eb73e5250bba9dfeaa852939acfbf70.tar.bz2
[media] dvb-frontend: Use boottime
Wall time obtained from ktime_get_real is susceptible to sudden jumps due to user setting the time or due to NTP. Boot time is constantly increasing time better suited for comparing two timestamps. [mchehab@osg.samsung.com: fix trivial merge conflicts] Signed-off-by: Abhilash Jindal <klock.android@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-core/dvb_frontend.c')
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 40080645341e..03cc508b8c42 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -899,10 +899,10 @@ void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec)
s32 delta;
*waketime = ktime_add_us(*waketime, add_usec);
- delta = ktime_us_delta(ktime_get_real(), *waketime);
+ delta = ktime_us_delta(ktime_get_boottime(), *waketime);
if (delta > 2500) {
msleep((delta - 1500) / 1000);
- delta = ktime_us_delta(ktime_get_real(), *waketime);
+ delta = ktime_us_delta(ktime_get_boottime(), *waketime);
}
if (delta > 0)
udelay(delta);
@@ -2451,7 +2451,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
u8 last = 1;
if (dvb_frontend_debug)
printk("%s switch command: 0x%04lx\n", __func__, swcmd);
- nexttime = ktime_get_real();
+ nexttime = ktime_get_boottime();
if (dvb_frontend_debug)
tv[0] = nexttime;
/* before sending a command, initialize by sending
@@ -2462,7 +2462,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
for (i = 0; i < 9; i++) {
if (dvb_frontend_debug)
- tv[i+1] = ktime_get_real();
+ tv[i+1] = ktime_get_boottime();
if ((swcmd & 0x01) != last) {
/* set voltage to (last ? 13V : 18V) */
fe->ops.set_voltage(fe, (last) ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18);