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

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®