Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(5);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);

total: 0 errors, 4 warnings, 1407 lines checked

Cc: patches@opensource.wolfsonmicro.com
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

Lee Jones b79a980f 3103d44e

+4 -4
+4 -4
drivers/mfd/arizona-core.c
··· 238 238 if ((val & mask) == target) 239 239 return 0; 240 240 241 - msleep(1); 241 + usleep_range(1000, 5000); 242 242 } 243 243 244 244 dev_err(arizona->dev, "Polling reg %u timed out: %x\n", reg, val); ··· 279 279 case WM5110: 280 280 case WM8280: 281 281 /* Meet requirements for minimum reset duration */ 282 - msleep(5); 282 + usleep_range(5000, 10000); 283 283 break; 284 284 default: 285 285 break; 286 286 } 287 287 288 288 gpio_set_value_cansleep(arizona->pdata.reset, 1); 289 - msleep(1); 289 + usleep_range(1000, 5000); 290 290 } 291 291 } 292 292 ··· 1132 1132 goto err_reset; 1133 1133 } 1134 1134 1135 - msleep(1); 1135 + usleep_range(1000, 5000); 1136 1136 } 1137 1137 1138 1138 /* Ensure device startup is complete */