lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 Jun 2014 02:35:00 +0000
From:	"Zheng, Lv" <lv.zheng@...el.com>
To:	"Lan, Tianyu" <tianyu.lan@...el.com>,
	David Rientjes <rientjes@...gle.com>
CC:	"rjw@...ysocki.net" <rjw@...ysocki.net>,
	"lenb@...nel.org" <lenb@...nel.org>, "naszar@...ru" <naszar@...ru>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] ACPI/Battery: Retry to get Battery information if
 failed during probing

Hi,

> From: linux-acpi-owner@...r.kernel.org [mailto:linux-acpi-owner@...r.kernel.org] On Behalf Of Lan Tianyu
> Sent: Monday, June 16, 2014 10:12 AM
> To: David Rientjes
> Cc: rjw@...ysocki.net; lenb@...nel.org; naszar@...ru; linux-acpi@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH] ACPI/Battery: Retry to get Battery information if failed during probing
> 
> On 2014年06月14日 05:46, David Rientjes wrote:
> > On Fri, 13 Jun 2014, Lan Tianyu wrote:
> >
> >> How about this?
> >>
> >> -       result = acpi_battery_update(battery, false);
> >> -       if (result)
> >> +
> >> +       /*
> >> +        * Some machines'(E,G Lenovo Z480) ECs are not stable

Just a reminder.

This statement may not be true.
The issue may be caused by the EC driver itself.
So we need to investigate.

> >> +        * during boot up and this causes battery driver fails to be
> >> +        * probed due to failure of getting battery information
> >> +        * from EC sometimes. After several retries, the operation
> >> +        * may work. So add retry code here and 20ms sleep between
> >> +        * every retries.
> >> +        */
> >> +       while (acpi_battery_update(battery, false) && retry--)

If EC hardware is stable, why we need to do retry here?

Thanks and best regards
-Lv

> >> +               msleep(20);
> >> +       if (!retry) {
> >> +               result = -ENODEV;
> >>                 goto fail;
> >> +       }
> >> +
> >
> > I think you want --retry and not retry--.
> 
> My original purpose is to retry 5 times after the first try fails.
> If use "--retry" here, it just retries 4 times.
> 
> >  Otherwise it's possible for the
> > final call to acpi_battery_update() to succeed and now it's returning
> > -ENODEV.
> >
> 
> Yes, it maybe and I will change code like the following.
> 
> while ((result = acpi_battery_update(battery, false)) && retry--)
>        msleep(20);
> if (result)
>        goto fail;
> 
> 
> --
> Best regards
> Tianyu Lan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ