mhi: core: Using usleep_range instead of msleep for sleep

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>
This commit is contained in:
Sujeev Dias 2017-06-01 15:29:24 -07:00
parent b5a2b57e74
commit 22cd52fbe8
2 changed files with 3 additions and 3 deletions

View 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

View 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 */