OSDN Git Service

mhi: core: Using usleep_range instead of msleep for sleep
authorSujeev Dias <sdias@codeaurora.org>
Thu, 1 Jun 2017 22:29:24 +0000 (15:29 -0700)
committerSujeev Dias <sdias@codeaurora.org>
Sun, 4 Jun 2017 01:08:44 +0000 (18:08 -0700)
msleep is not accurate for small delays.  Use usleep_range
for accuracy.

CRs-Fixed: 1117121
Change-Id: I9a076f843875bd83a21c96d4e4ea0510e82ce352
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
drivers/platform/msm/mhi/mhi_macros.h
drivers/platform/msm/mhi/mhi_states.c

index fc0e6f4..04ecf13 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -45,7 +45,7 @@
 #define MHI_PCIE_DEVICE_ID_ZIRC 0x0301
 #define MHI_PCIE_DEVICE_ID_9x55 0x0302
 
-#define MHI_M2_DEBOUNCE_TMR_MS 10
+#define MHI_M2_DEBOUNCE_TMR_US 10000
 
 #define MHI_EV_DB_INTERVAL 1
 
index e383558..2906393 100644 (file)
@@ -430,7 +430,7 @@ void process_m1_transition(struct work_struct *work)
        mhi_set_m_state(mhi_dev_ctxt, MHI_STATE_M2);
        write_unlock_irq(&mhi_dev_ctxt->pm_xfer_lock);
 
-       msleep(MHI_M2_DEBOUNCE_TMR_MS);
+       usleep_range(MHI_M2_DEBOUNCE_TMR_US, MHI_M2_DEBOUNCE_TMR_US + 50);
        write_lock_irq(&mhi_dev_ctxt->pm_xfer_lock);
 
        /* During DEBOUNCE Time We could be receiving M0 Event */