Răsfoiți Sursa

qcacmn: Return proper value of qdf timer multiplier

Return proper value of qdf timer multiplier based on this
Kbuild option QDF_TIMER_MULTIPLIER_FRAC.

Change-Id: I10c08ba900aad49fb9134d2e4d337f04a19dec7b
CRs-Fixed: 2855512
Alan Chen 4 ani în urmă
părinte
comite
64782f823f
2 a modificat fișierele cu 11 adăugiri și 4 ștergeri
  1. 2 3
      qdf/linux/src/qdf_event.c
  2. 9 1
      qdf/linux/src/qdf_mc_timer.c

+ 2 - 3
qdf/linux/src/qdf_event.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -320,9 +320,8 @@ QDF_STATUS qdf_wait_for_event_completion(qdf_event_t *event, uint32_t timeout)
 		long ret;
 
 		/* update the timeout if it's on an emulation platform */
-		timeout *= qdf_timer_get_multiplier();
 		ret = wait_for_completion_timeout(&event->complete,
-						  msecs_to_jiffies(timeout));
+						  __qdf_scaled_msecs_to_jiffies(timeout));
 
 		if (ret <= 0) {
 			status = QDF_STATUS_E_TIMEOUT;

+ 9 - 1
qdf/linux/src/qdf_mc_timer.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -45,11 +45,19 @@ inline void qdf_timer_set_multiplier(uint32_t multiplier)
 }
 qdf_export_symbol(qdf_timer_set_multiplier);
 
+#ifdef QDF_TIMER_MULTIPLIER_FRAC
+inline uint32_t qdf_timer_get_multiplier(void)
+{
+	return QDF_TIMER_MULTIPLIER_FRAC;
+}
+qdf_export_symbol(qdf_timer_get_multiplier);
+#else
 inline uint32_t qdf_timer_get_multiplier(void)
 {
 	return g_qdf_timer_multiplier;
 }
 qdf_export_symbol(qdf_timer_get_multiplier);
+#endif
 
 /* Type declarations */