Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jul 2005 14:36:43 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Stefan Walter <sw@gegenunendlich.de>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: usb/82660: EHCI: I/O stuck in state 'physrd'/panic
Message-ID:  <200507091436.44489.hselasky@c2i.net>
In-Reply-To: <20050706173604.GA812@kyuzo.dunkelkammer.void>
References:  <20050626091628.775DD3A1D@kyuzo.dunkelkammer.void> <200507041918.47258.hselasky@c2i.net> <20050706173604.GA812@kyuzo.dunkelkammer.void>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 06 July 2005 19:36, Stefan Walter wrote:
> Hans Petter Selasky, 04.07.05, 19:18h CEST:
> > > http://www.gegenunendlich.de/stuff/ehci/umass-messages-complete-transfe
> > >r.bz2
> >
> > To me it seems that there is something wrong with your flash disk. Though
> > it can be that the "CBW" structure is not initialized correctly, but I am
> > not the right person to tell about that. At least your flash disk takes
> > the "CBW" command, but times out on the following BULK-in transfer.
>
> I don't think it's the USB stick, as the device works fine with ehci at my
> notebook (Intel chipset). Furthermore, I could now reproduce the problem
> with an external USB HD enclosure, too.

Ok, lets have a look at the EHCI driver and see what is going on. I'm not sure 
how to do this with the official USB driver, but if you could have installed 
my USB driver again, and replace the function "ehci_timeout()" in the file 
"/sys/dev/usb2/_ehci.c" with the following:

static void
ehci_timeout(struct usbd_xfer *xfer)
{
        ehci_softc_t *sc = xfer->usb_sc;
        struct mtx *priv_mtx;

        DPRINTF(("xfer=%p\n", xfer));

        mtx_lock(&sc->sc_bus.mtx);

        if(!xfer->finish_list)
        {
                u_int8_t status = 0;
                int old_debug = ehcidebug;

                ehcidebug = 15;

                if(xfer->pipe->methods == &ehci_device_bulk_methods)
                {
                   printf("%s: checking transfer %p: \n", __FUNCTION__, xfer);

                   status = ehci_check_transfer(xfer);
                }
                else
                {
                   /* this should not happen */
                   printf("%s: not bulk (cannot check transfer %p)\n",
                          __FUNCTION__, xfer);
                }

                if(status == 0) {

                    /* transfer is transferred */
                    ehci_device_done(xfer, USBD_TIMEOUT);
                }
                else {
                    printf("%s: timed out transfer was finished!\n",
                           __FUNCTION__);
                }

                ehcidebug = old_debug;

                /* call callback */
                xfer->finish_list = &xfer;
                priv_mtx = xfer->priv_mtx;

                /* change lock */
                mtx_unlock(&sc->sc_bus.mtx);
                mtx_lock(priv_mtx);

                if(xfer)
                {
                        /* call callback */
                        __usbd_callback(xfer);
                }
                /* else already called back */

                mtx_unlock(priv_mtx);
        }
        else
        {
                mtx_unlock(&sc->sc_bus.mtx);
        }
        return;
}

And then compile a new kernel and/or modules.

Your device was USB 2.0, right, else you have to do something similar 
to /sys/dev/usb2/_uhci.c if the device is USB 1.X.

Just leave all debugging flags off, and then try to reproduce the error [one 
or more times] and post the dmsg that appears.

--HPS



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