Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Aug 2005 20:40:47 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
Cc:        Julian Elischer <julian@elischer.org>, freebsd-usb@freebsd.org
Subject:   Re: weird usb problem
Message-ID:  <200508092040.50084.hselasky@c2i.net>
In-Reply-To: <bb4a86c70508091026565ddcd1@mail.gmail.com>
References:  <bb4a86c7050808140175d0134a@mail.gmail.com> <200508090156.09985.hselasky@c2i.net> <bb4a86c70508091026565ddcd1@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 09 August 2005 19:26, Maksim Yevmenkin wrote:
> Guys,
>
> >
> > From a quick glimpse, you need to add something like
> >
> > "ehci_pcd(sc, sc->sc_intrxfer);" after "ehci_pcd_able(sc, 1);".
> >
> > In the middle you have to add something like this:
> >
> >         /* acknowledge any PCD interrupt */
> >         EOWRITE4(sc, EHCI_USBSTS, EHCI_STS_PCD);
> >
> > Just look at the code in my USB driver, and if it fixes the problem, just
> > backport it.
>
> well, i tried a naive thing like this
>
> beetle% diff -u10 ehci.c.orig ehci.c
> --- ehci.c.orig Sat May 28 21:42:27 2005
> +++ ehci.c      Tue Aug  9 09:53:13 2005
> @@ -632,20 +632,21 @@
>                 sc->sc_eintrs &= ~EHCI_STS_PCD;
>         EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
>  }
>
>  void
>  ehci_pcd_enable(void *v_sc)
>  {
>         ehci_softc_t *sc = v_sc;
>
>         ehci_pcd_able(sc, 1);

You need to clear the PCD interrupt bit here, because it is possibly still 
set, and enabling bits in the interrupt mask does not generate another 
interrupt!

         /* acknowledge any PCD interrupt */
         EOWRITE4(sc, EHCI_USBSTS, EHCI_STS_PCD);

> +       ehci_pcd(sc, sc->sc_intrxfer);
>  }
>

>
> other usb slots are connected to the uhub5 ports 2 to 4 and the usb
> 2.0 device is _not_ working when plugged into these slots.
>
> usb 1.0 devices work in every usb slot.
>

If you have got your source tree in another directory, which makes installing 
to "/usr/src" difficult, you can set the variable "S" in the Makefile to that 
director and it will install there. 


Do like this:

sysctl hw.usb.ehci.debug=15

Then plug your device.

sysctl hw.usb.ehci.debug=0

If you see a pcd change message your device is detected. But just watch and 
you will see that it stops interrupting.


The problem is the same with OHCI.


--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508092040.50084.hselasky>