lkml.org 
[lkml]   [2014]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ACPI/Battery: Retry to get Battery information if failed during probing
On Thu, 12 Jun 2014, Lan Tianyu wrote:

> The retry time is set by randomly and not accurate because don't know
> when EC will work normally. Set the retry time to 5 just in order to
> make sure battery driver probing sucessfully every time,
>

Ok, I was hoping to avoid the excessive wait if it will never actually
succeed but I assume there's some evidence that it can succeed after 40ms,
60ms, etc. Please consider the following instead:

for (i = 0; i < 5; i++) {
/* Comment on why we need a delay in between retries */
if (i)
msleep(20);
result = acpi_battery_update(battery, false);
if (!result)
break;
}


\
 
 \ /
  Last update: 2014-06-12 23:41    [W:0.067 / U:2.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site