diff options
Diffstat (limited to 'arch/x86/kernel/olpc.c')
-rw-r--r-- | 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 0e0cdde519be..a2bd899b2b83 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, | |||
114 | unsigned long flags; | 114 | unsigned long flags; |
115 | int ret = -EIO; | 115 | int ret = -EIO; |
116 | int i; | 116 | int i; |
117 | int restarts = 0; | ||
117 | 118 | ||
118 | spin_lock_irqsave(&ec_lock, flags); | 119 | spin_lock_irqsave(&ec_lock, flags); |
119 | 120 | ||
@@ -169,7 +170,9 @@ restart: | |||
169 | if (wait_on_obf(0x6c, 1)) { | 170 | if (wait_on_obf(0x6c, 1)) { |
170 | printk(KERN_ERR "olpc-ec: timeout waiting for" | 171 | printk(KERN_ERR "olpc-ec: timeout waiting for" |
171 | " EC to provide data!\n"); | 172 | " EC to provide data!\n"); |
172 | goto restart; | 173 | if (restarts++ < 10) |
174 | goto restart; | ||
175 | goto err; | ||
173 | } | 176 | } |
174 | outbuf[i] = inb(0x68); | 177 | outbuf[i] = inb(0x68); |
175 | pr_devel("olpc-ec: received 0x%x\n", outbuf[i]); | 178 | pr_devel("olpc-ec: received 0x%x\n", outbuf[i]); |