Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753633AbaFLVRH (ORCPT ); Thu, 12 Jun 2014 17:17:07 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:45811 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbaFLVRF (ORCPT ); Thu, 12 Jun 2014 17:17:05 -0400 Date: Thu, 12 Jun 2014 14:17:02 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Lan Tianyu cc: rjw@rjwysocki.net, lenb@kernel.org, naszar@ya.ru, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] ACPI/Battery: Retry to get Battery information if failed during probing In-Reply-To: <53996152.2000407@intel.com> Message-ID: References: <1402552946-14704-1-git-send-email-tianyu.lan@intel.com> <53995488.20308@intel.com> <53996152.2000407@intel.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/