diff options
author | Monty <xiphmont@xiph.org> | 2006-05-09 15:37:22 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-05-12 14:58:09 -0400 |
commit | 16c23f7d88cbcce491f9370b2846fad66e8ef319 (patch) | |
tree | 7e69ad84548acabb0bebcfd594c1986292947d83 /drivers/usb/misc/emi62.c | |
parent | 332bbf613868a5d5938ad9fb7436b2beae72d53d (diff) |
[PATCH] USB: Emagic USB firmware loading fixes
It's become apparent as machines get faster that the emagic kernel firmware
loaders (based on the ezusb loader) have a reset race. a 400MHz TiBook
never tripped it, but a 2GHz Pentium M seems to hit it about 30% of the
time. The bug is seen as a hung USB box and the kernel error:
drivers/usb/misc/emi62.c: emi62_load_firmware - error loading firmware:
error = -110
The patch below inserts a delay after deasserting reset to allow the box to
settle before a new command is issued. This affects only device startup.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc/emi62.c')
-rw-r--r-- | drivers/usb/misc/emi62.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c index 52fea2e08db8..fe351371f274 100644 --- a/drivers/usb/misc/emi62.c +++ b/drivers/usb/misc/emi62.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/usb.h> | 17 | #include <linux/usb.h> |
18 | #include <linux/delay.h> | ||
18 | 19 | ||
19 | #define MAX_INTEL_HEX_RECORD_LENGTH 16 | 20 | #define MAX_INTEL_HEX_RECORD_LENGTH 16 |
20 | typedef struct _INTEL_HEX_RECORD | 21 | typedef struct _INTEL_HEX_RECORD |
@@ -123,6 +124,7 @@ static int emi62_load_firmware (struct usb_device *dev) | |||
123 | 124 | ||
124 | /* De-assert reset (let the CPU run) */ | 125 | /* De-assert reset (let the CPU run) */ |
125 | err = emi62_set_reset(dev,0); | 126 | err = emi62_set_reset(dev,0); |
127 | msleep(250); /* let device settle */ | ||
126 | 128 | ||
127 | /* 2. We upload the FPGA firmware into the EMI | 129 | /* 2. We upload the FPGA firmware into the EMI |
128 | * Note: collect up to 1023 (yes!) bytes and send them with | 130 | * Note: collect up to 1023 (yes!) bytes and send them with |
@@ -166,6 +168,7 @@ static int emi62_load_firmware (struct usb_device *dev) | |||
166 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); | 168 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); |
167 | goto wraperr; | 169 | goto wraperr; |
168 | } | 170 | } |
171 | msleep(250); /* let device settle */ | ||
169 | 172 | ||
170 | /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ | 173 | /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ |
171 | 174 | ||
@@ -228,6 +231,7 @@ static int emi62_load_firmware (struct usb_device *dev) | |||
228 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); | 231 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); |
229 | goto wraperr; | 232 | goto wraperr; |
230 | } | 233 | } |
234 | msleep(250); /* let device settle */ | ||
231 | 235 | ||
232 | kfree(buf); | 236 | kfree(buf); |
233 | 237 | ||