qcacmn: check wrap around in BEFORE_UNLOCK

1 Add protection for wrap around of jiffies.
2 fix assign issue from uint32_t to uint64_t.

Change-Id: Idbd3604d0cb985d08aa82e3b1d7f32fa6be8c3ef
CRs-Fixed: 2864737
This commit is contained in:
Jingxiang Ge
2021-01-28 10:07:15 +08:00
کامیت شده توسط snandini
والد 35135ea9a1
کامیت 3200bacc98
2فایلهای تغییر یافته به همراه19 افزوده شده و 4 حذف شده

مشاهده پرونده

@@ -553,7 +553,15 @@ static inline uint64_t qdf_get_log_timestamp_lightweight(void)
{
uint64_t timestamp_us;
timestamp_us = __qdf_system_ticks_to_msecs(qdf_system_ticks()) * 1000;
/* explicitly change to uint64_t, otherwise it will assign
* uint32_t to timestamp_us, which lose high 32bits.
* on 64bit platform, it will only use low 32bits jiffies in
* jiffies_to_msecs.
* eg: HZ=250, it will overflow every (0xffff ffff<<2==0x3fff ffff)
* ticks. it is 1193 hours.
*/
timestamp_us =
(uint64_t)__qdf_system_ticks_to_msecs(qdf_system_ticks()) * 1000;
return timestamp_us;
}
#endif /* end of MSM_PLATFORM */