mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] OLPC: Don't retry EC commands forever
@ 2010-10-01 17:17 Daniel Drake
  2010-10-05  7:53 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Drake @ 2010-10-01 17:17 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86; +Cc: dilinger, linux-kernel

From: Paul Fox <pgf@laptop.org>

Avoids a potential infinite loop

Signed-off-by: Daniel Drake <dsd@laptop.org>
---
 arch/x86/kernel/olpc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c
index 37c49934..7472613 100644
--- a/arch/x86/kernel/olpc.c
+++ b/arch/x86/kernel/olpc.c
@@ -114,6 +114,7 @@ int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
 	unsigned long flags;
 	int ret = -EIO;
 	int i;
+	int restarts = 0;
 
 	spin_lock_irqsave(&ec_lock, flags);
 
@@ -169,7 +170,9 @@ restart:
 			if (wait_on_obf(0x6c, 1)) {
 				printk(KERN_ERR "olpc-ec:  timeout waiting for"
 						" EC to provide data!\n");
-				goto restart;
+				if (restarts++ < 10)
+					goto restart;
+				goto err;
 			}
 			outbuf[i] = inb(0x68);
 			pr_devel("olpc-ec:  received 0x%x\n", outbuf[i]);
-- 
1.7.2.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] OLPC: Don't retry EC commands forever
  2010-10-01 17:17 [PATCH] OLPC: Don't retry EC commands forever Daniel Drake
@ 2010-10-05  7:53 ` Ingo Molnar
  2010-10-05 14:36   ` Daniel Drake
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2010-10-05  7:53 UTC (permalink / raw)
  To: Daniel Drake; +Cc: tglx, mingo, hpa, x86, dilinger, linux-kernel


* Daniel Drake <dsd@laptop.org> wrote:

> From: Paul Fox <pgf@laptop.org>
> 
> Avoids a potential infinite loop

Was this infinite loop observed in practice? I.e. should this get into 
.36 and into -stable?

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] OLPC: Don't retry EC commands forever
  2010-10-05  7:53 ` Ingo Molnar
@ 2010-10-05 14:36   ` Daniel Drake
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Drake @ 2010-10-05 14:36 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: tglx, mingo, hpa, x86, dilinger, linux-kernel, Paul Fox

On 5 October 2010 08:53, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Daniel Drake <dsd@laptop.org> wrote:
>
>> From: Paul Fox <pgf@laptop.org>
>>
>> Avoids a potential infinite loop
>
> Was this infinite loop observed in practice? I.e. should this get into
> .36 and into -stable?

It was observed once, but only during an EC hacking/debugging session
- not in regular operation.
So it should be fine for the next merge window with no need to backport it.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-05 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-01 17:17 [PATCH] OLPC: Don't retry EC commands forever Daniel Drake
2010-10-05  7:53 ` Ingo Molnar
2010-10-05 14:36   ` Daniel Drake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®