msleep(1~20) may not do what the caller intends, and will often sleep longer.
(~20 ms actual sleep for any value given in the 1~20ms range)
This is not the desired behaviour for many cases like device resume time,
device suspend time, device enable time, retry logic, etc.
Thus, change msleep to usleep_range for precise wakeups.
Signed-off-by: Aniroop Mathur <redacted>
---
drivers/input/mouse/synaptics_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -29,7 +29,7 @@*aftersoftreset,weshouldwaitfor1ms*beforethedevicebecomesoperational*/-#define SOFT_RESET_DELAY_MS 3+#define SOFT_RESET_DELAY_US 3000/* and after hard reset, we should wait for max 500ms */#define HARD_RESET_DELAY_MS 500
@@ -311,7 +311,7 @@ static int synaptics_i2c_reset_config(struct i2c_client *client)if(ret){dev_err(&client->dev,"Unable to reset device\n");}else{-msleep(SOFT_RESET_DELAY_MS);+usleep_range(SOFT_RESET_DELAY_MS,SOFT_RESET_DELAY_MS+100);ret=synaptics_i2c_config(client);if(ret)dev_err(&client->dev,"Unable to config device\n");
drivers/input/mouse/synaptics_i2c.c:314:16: error: 'SOFT_RESET_DELAY_MS' undeclared (first use in this function)
usleep_range(SOFT_RESET_DELAY_MS, SOFT_RESET_DELAY_MS + 100);
^~~~~~~~~~~~~~~~~~~
drivers/input/mouse/synaptics_i2c.c:314:16: note: each undeclared identifier is reported only once for each function it appears in
vim +/SOFT_RESET_DELAY_MS +314 drivers/input/mouse/synaptics_i2c.c
308
309 /* Reset the Touchpad */
310 ret = synaptics_i2c_reg_set(client, DEV_COMMAND_REG, RESET_COMMAND);
311 if (ret) {
312 dev_err(&client->dev, "Unable to reset device\n");
313 } else {
> 314 usleep_range(SOFT_RESET_DELAY_MS, SOFT_RESET_DELAY_MS + 100);
315 ret = synaptics_i2c_config(client);
316 if (ret)
317 dev_err(&client->dev, "Unable to config device\n");
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation