From c846868cd815d12138da0d25ef9bc4ced051c735 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Thu, 29 Jun 2017 14:21:28 +0530 Subject: [PATCH] qcacmn: Add correct api call to get proper boot time Propagation from qcacld-2.0 to qcacmn Currently to get clock boottime, qdf_get_monotonic_boottime_ns api is getting used which does not include the suspend time. To include the system suspend time also in clock boottime, use qdf_get_bootbased_boottime_ns api which uses ktime_get_boot_ns kernel api. Change-Id: Ibcc628c315201fa3ced7e1ad96753772d91707b2 CRs-Fixed: 2069085 --- qdf/inc/qdf_time.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/qdf/inc/qdf_time.h b/qdf/inc/qdf_time.h index 148e0234a96d..97cc43d5dc13 100644 --- a/qdf/inc/qdf_time.h +++ b/qdf/inc/qdf_time.h @@ -81,6 +81,21 @@ static inline qdf_time_t qdf_get_system_uptime(void) return __qdf_get_system_uptime(); } +/** + * qdf_get_bootbased_boottime_ns() - Get the bootbased time in nanoseconds + * + * qdf_get_bootbased_boottime_ns() function returns the number of nanoseconds + * that have elapsed since the system was booted. It also includes the time when + * system was suspended. + * + * Return: + * The time since system booted in nanoseconds + */ +static inline s64 qdf_get_bootbased_boottime_ns(void) +{ + return ktime_get_boot_ns(); +} + /** * qdf_get_system_timestamp - Return current timestamp *