Hi Axel, I had a problem like that with a VIA usb add-on card.
The patch below fixed it: you need to suspend the currently plugged
in device before resetting the port for the new device. This patch
is about two years old so may not apply. It never got into the kernel
because I soon afterwards bought a motherboard with usb built-in, and
couldn't be bothered pushing a patch I no longer needed...
Ciao,
Duncan.
> I have a problem with an eGalax touch screen controller connected on a
> VIA UHCI controller together with my own hardware. Sometimes when I
> disconnect my own device, the eGalax controller gets disconnected as
> well and immediately re-enumerates. This leads to a new assignment of a
> event number which then screws my X server, as I set it up to listen
> to /dev/event0.
>
> Attached is a snipet of my syslog.
>
> Any comments? I'd even be happy with a workaround like telling my X
> server to "listen" to every /dev/event* device for now.
>
> Oh, I was just about to forget: vanilla kernel 2.6.8.1 (plus two
> modules).
>
> Thanks,
> Axel
Work around a problem with some VIA USB controllers: prevent
plugging of new devices killing devices already plugged. This
patch by itself fixes the problem (uhci.c only for the moment -
if you think it is OK I will make a patch for usb-uhci and 2.5).
The following patches fix some related minor problems.
Patch is against 2.4.19.
--- linux/drivers/usb/uhci.c.orig 2002-10-25 22:54:25.000000000
+0200
+++ linux/drivers/usb/uhci.c 2002-10-26 00:20:11.000000000 +0200
@@ -2184,6 +2184,9 @@
SET_RH_PORTSTAT(USBPORTSC_SUSP);
OK(0);
case RH_PORT_RESET:
+ if (uhci->rh.needs_suspend)
+ suspend_hc (uhci);
+
SET_RH_PORTSTAT(USBPORTSC_PR);
mdelay(50); /* USB v1.1 7.1.7.3 */
uhci->rh.c_p_r[wIndex - 1] = 1;
@@ -2192,6 +2195,10 @@
SET_RH_PORTSTAT(USBPORTSC_PE);
mdelay(10);
SET_RH_PORTSTAT(0xa);
+
+ if (uhci->rh.needs_suspend)
+ wakeup_hc (uhci);
+
OK(0);
case RH_PORT_POWER:
OK(0); /* port power ** */
@@ -2817,6 +2824,11 @@
uhci->rh.numports = port;
+ uhci->rh.needs_suspend = 0;
+
+ if ((dev->vendor == 0x1106) && (dev->device == 0x3038))
+ uhci->rh.needs_suspend = 1;
+
uhci->bus->root_hub = uhci->rh.dev = usb_alloc_dev(NULL,
uhci->bus);
if (!uhci->rh.dev) {
err("unable to allocate root hub");
--- linux/drivers/usb/uhci.h.orig 2002-10-25 22:54:20.000000000
+0200
+++ linux/drivers/usb/uhci.h 2002-10-25 22:55:57.000000000 +0200
@@ -274,6 +274,7 @@
int send;
int interval;
int numports;
+ int needs_suspend;
int c_p_r[8];
struct timer_list rh_int_timer;
};
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel