On Tue, Mar 28, 2000 at 12:28:50PM -0500, Jeff Garzik wrote:
> The latest Alpha kernel builds USB ok but fails to link...

Incidentally, once one gets past this (by not configuring uhci),
I get two separate oopses, both buffer overruns, and USB generally
doesn't work. 

Attached is a patch that cures the oops, but that's all.  If things
had been working properly, this surely wouldn't be needed.  Of course,
the overruns should probably be prevented by some means...


r~


PCI info:
00:14.0 USB Controller: Acer Laboratories Inc. [ALi] M5237 USB (rev 03)
        Flags: bus master, medium devsel, latency 32, IRQ 11
        Memory at 0000000009003000 (32-bit, non-prefetchable) [size=4K]

Boot logs:
usb.c: registered new driver usbdevfs 
usb.c: registered new driver hub 
usb-ohci.c: USB OHCI at membase 0xfffffd0009003000, IRQ 11 
usb-ohci.c: USB HC TakeOver failed! 
usb-ohci.c: USB HC reset timed out! 
usb.c: new USB bus registered, assigned bus number 1 
usb.c: USB new device connect, assigned device number 1 
usb.c: new device strings: Mfr=0, Product=2, SerialNumber=1 
usb.c: USB device number 1 default language ID 0x0 
Product: USB OHCI Root Hub 
SerialNumber: 9003000 
hub.c: USB hub found 
hub.c: 255 ports detected 

for (i = 1; i < boredom; i = (i+1 < 256 ? i+1 : 1)):
Mar 29 00:14:34 pooh kernel: hub.c: port 1 over-current change 
Mar 29 00:14:34 pooh kernel: hub.c: port 2 over-current change 
Mar 29 00:14:34 pooh kernel: hub.c: port 3 over-current change 
Mar 29 00:14:34 pooh kernel: hub.c: port 4 over-current change 
Mar 29 00:14:34 pooh kernel: hub.c: port 5 over-current change 
Mar 29 00:14:34 pooh kernel: hub.c: port 6 over-current change 
Mar 29 00:14:34 pooh kernel: hub.c: port 7 over-current change 
Mar 29 00:14:35 pooh kernel: hub.c: port 8 over-current change 


--- ./include/linux/usb.h.orig  Wed Mar 29 00:10:18 2000
+++ ./include/linux/usb.h       Wed Mar 29 00:10:19 2000
@@ -533,7 +533,7 @@ struct usb_bus {
         struct list_head inodes;
 };
 
-#define USB_MAXCHILDREN (8)    /* This is arbitrary */
+#define USB_MAXCHILDREN (256)  /* This is arbitrary */
 
 struct usb_device {
        int devnum;                     /* Device number on USB bus */
--- ./drivers/usb/usb-ohci.c.orig       Tue Mar 28 23:44:15 2000
+++ ./drivers/usb/usb-ohci.c    Tue Mar 28 23:46:07 2000
@@ -1198,17 +1198,20 @@ static int rh_send_irq (ohci_t * ohci, v
        int i;
        int ret;
        int len;
+       int tmp;
 
-       __u8 data[8];
+       __u8 data[257 / 8];
+
+       memset(data, 0, sizeof(data));
 
        num_ports = readl (&ohci->regs->roothub.a) & 0xff; 
-       *(__u8 *) data = (readl (&ohci->regs->roothub.status) & 0x00030000) > 0? 1: 0;
-       ret = *(__u8 *) data;
+       data[0] = (readl (&ohci->regs->roothub.status) & 0x00030000) > 0;
+       ret = data[0];
 
-       for ( i = 0; i < num_ports; i++) {
-               *(__u8 *) (data + (i + 1) / 8) |= 
-                       ((readl (&ohci->regs->roothub.portstatus[i]) & 0x001f0000) > 
0? 1: 0) << ((i + 1) % 8);
-               ret += *(__u8 *) (data + (i + 1) / 8);
+       for (i = 0; i < num_ports; i++) {
+               tmp = readl (&ohci->regs->roothub.portstatus[i]) & 0x001f0000;
+               data[(i + 1) / 8] |= (tmp > 0) << ((i + 1) % 8);
+               ret += data[(i + 1) / 8];
        }
        len = i/8 + 1;
   

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to