I have been extensively testing the Speedtouch USB modem under FreeBSD (currently 4.4,
will be testing 4.6 soon) with the latest (161.5R) alcaudsl.sys from Alcatel and the
1.1 drivers from this site.
I have noticed the following problems:
1) The USB controller halts with:
usb0: host controller process error
usb0: host controller halted
This appears to be an underlying problem with the FreeBSD USB subsystem and is not
just limited to using the speedtouch drivers. Stressing the USB appears to make this
problem increase in frequency.
I'm still investigating why this is happening and what can be done about it. For the
moment, the following patch re-enables the USB subsystem. Providing you're using usbd
to run modem_run, the following fix will result in only about 30 seconds downtime for
the ADSL:
*** /usr/src/sys/dev/usb/uhci.c Tue Oct 31 23:23:29 2000
--- uhci.c Wed Jul 3 13:53:16 2002
***************
*** 962,970 ****
--- 962,990 ----
USBDEVNAME(sc->sc_bus.bdev));
}
if (status & UHCI_STS_HCH) {
+ int s;
+
/* no acknowledge needed */
printf("%s: host controller halted\n",
USBDEVNAME(sc->sc_bus.bdev));
+
+ /* Try to restart */
+ printf("DCRH: Restarting USB controller\n");
+ s = splusb();
+ sc->sc_bus.use_polling++; /* Switch to polling in case curproc=NULL */
+
+ UWRITE2(sc, UHCI_STS, 0xFFFF); /* ack pending interrupts */
+ uhci_run(sc, 0); /* stop the controller */
+ UWRITE2(sc, UHCI_INTR, 0); /* disable interrupts */
+ uhci_busreset(sc);
+ UWRITE2(sc, UHCI_INTR, UHCI_INTR_TOCRCIE | UHCI_INTR_RIE |
+ UHCI_INTR_IOCE | UHCI_INTR_SPIE); /* enable interrupts */
+ UHCICMD(sc, UHCI_CMD_MAXP); /* Assume 64 byte packets at frame end */
+ uhci_run(sc, 1); /* and here we go... */
+ sc->sc_bus.use_polling--;
+ splx(s);
+ ack = 0;
+ printf("DCRH: USB controller restarted\n");
}
if (ack) /* acknowledge the ints */
2) pppoa2 freezes under heavy load.
I use the excellent userland ppp which uses pppoa2. Under heavy load, the pppoa2
process which reads from the USB hangs in pusb_endpoint_read in pusb-bsd.c. This will
normally be observed as an LQR timeout in the upper PPP layer (assuming you enable
LQR). I'm not sure why this is happening. The only way I've found to unwedge it is to
send the pppoa2 process a signal. To this end, the following patch uses a watchdog
timer to ensure the process doesn't get wedged:
*** speedtouch-1.1-orig/src/pppoa2.c Sat Jun 1 00:34:25 2002
--- speedtouch-1.1/src/pppoa2.c Wed Jul 3 13:58:14 2002
***************
*** 366,372 ****
if(fdusb == NULL)
{
! report(0, REPORT_ERROR|REPORT_DATE, "Where is this crappy
modem ?!\n");
return(-1);
}
--- 366,372 ----
if(fdusb == NULL)
{
! report(0, REPORT_ERROR|REPORT_DATE, "Where is this modem
?!\n");
return(-1);
}
***************
*** 770,775 ****
--- 770,781 ----
}
#endif
+ volatile int timeouts = 0;
+ void watchdog(int s)
+ {
+ timeouts++;
+ }
+
/*
* Function : handle_endpoint_87
* Return Values : none
***************
*** 801,823 ****
--- 807,847 ----
/* Prepares pos */
pos = 0;
+ signal(SIGALRM, watchdog);
+
/* Reads from usb and writes to ppp(d) tty */
for(;;) {
+ struct itimerval tv_timeout = {
+ { 0, 500000 }, /* 1/2 second */
+ { 0, 500000 },
+ };
+ struct itimerval tv_zero = {
+ { 0, 0 },
+ { 0, 0 },
+ };
int n;
int pti;
unsigned char lbuf[64*53];
unsigned char *unused_cells;
+ setitimer(ITIMER_REAL, &tv_timeout, NULL); /* Watchdog timer */
+
/* Reads 64*53 bytes from usb */
do {
n = pusb_endpoint_read(epdata, lbuf, sizeof(lbuf), 0);
} while (n < 0 && (errno == EINTR ||errno == ETIMEDOUT));
+ setitimer(ITIMER_REAL, &tv_zero, NULL); /* Watchdog timer */
+
if(n < 0) {
report(0, REPORT_ERROR|REPORT_DATE|REPORT_PERROR,
"Error reading usb urb\n");
break;
}
+ if (timeouts > 0) {
+ report(2, REPORT_ERROR|REPORT_DATE|REPORT_PERROR,
+"Timeouts = %d\n", timeouts);
+ timeouts = 0;
+ }
/* Debug information */
report(2, REPORT_DEBUG|REPORT_DATE|REPORT_DUMP, "ATM cells
read from USB (%d bytes long)\n", lbuf, n, n);
(You can ignore the first part to this patch - I just don't like rude words being
written to the logs!)
3) Heavy usages causes large amounts of bad data to be read from the USB. In the logs
this looks like:
Jul 3 13:58:35 exoserver pppoa2[6631]: Cell had wrong VPI(4068)/VCI(31234) (OAM?)
PTI=0x06
Jul 3 13:58:41 exoserver pppoa2[6631]: Cell had wrong VPI(3240)/VCI(48850) (OAM?)
PTI=0x04
Jul 3 13:58:48 exoserver pppoa2[6631]: Cell had wrong VPI(981)/VCI(44053) (OAM?)
PTI=0x05
Jul 3 13:58:49 exoserver pppoa2[6631]: Cell had wrong VPI(1447)/VCI(31788) (OAM?)
PTI=0x00
Jul 3 13:59:05 exoserver pppoa2[6631]: Cell had wrong VPI(2948)/VCI(3831) (OAM?)
PTI=0x03
Jul 3 13:59:05 exoserver pppoa2[6631]: CRC error in an AAL5 frame
Jul 3 13:59:26 exoserver pppoa2[6631]: Cell had wrong VPI(1251)/VCI(55468) (OAM?)
PTI=0x06
Jul 3 13:59:31 exoserver pppoa2[6631]: Cell had wrong VPI(671)/VCI(4876) (OAM?)
PTI=0x07
Not sure why this is happening - it doesn't seem to affect throughput that much but is
quite noisy. It seems to result from a read from pusb_endpoint_read which returns a
non-integer number of ATM cells. This looks to me like a synchronisation/locking issue
between the read syscall in pppoa2 and the USB subsystem.
4) Random kernel panics
This is the most disturbing bug of the lot. It looks like there's some memory
corruption happening inside the USB subsystem that occasionally causes random kernel
panics - the panic will typically occur as a fatal trap inside kernel malloc. Good
luck to anyone attempting to track that one down....
Best wishes,
David
--
Dr David Hedley, R&D Director,
intY Ltd, Bristol, UK
http://www.inty.net/
intY has scanned this email for all known viruses (www.inty.com)
Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe