New UMASS driver available for testing

Hans Petter Selasky hselasky at c2i.net
Sun Oct 1 00:43:48 PDT 2006


On Saturday 30 September 2006 17:29, Ulrich Spoerlein wrote:
> Hans Petter Selasky wrote:
> > Hi,
> >
> > I have finished the conversion of the UMASS driver to my new USB API. If
> > you have got a UMASS device laying around, and want to help the USB
> > project, please give the new driver a test.
>
> Well, it's been a time, but I finally got around to benchmarking you new
> driver. First of all, a diff of the dmesg from the old against your
> driver:
>
>

>
> As you can see, performance increased by roughly 10%, but system time
> increased about 300% :(
>
> I hope this info was useful to you and am looking forward to seeing your
> reworked USB system hit the tree soon!

The extra time used is due to an inline wait loop in the code, to make things 
simple.

You can try the following experimental patch:

Edit: /sys/dev/usb2/_ehci.c

Lookup the following piece of code:

        if(((xfer->pipe->methods == &ehci_device_ctrl_methods) ||
            (xfer->pipe->methods == &ehci_device_bulk_methods)) &&
           (sc->sc_doorbell_disable == 0))
        {
                u_int32_t to = 100*1000;

                /* wait for doorbell ~32us */
                EOWRITE4(sc, EHCI_USBCMD, 
                         EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD);

                while(EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_IAAD)
                {
                    if(!to--)
                    {
                        printf("%s: doorbell timeout "
                               "(disabling)\n", __FUNCTION__);
                        sc->sc_doorbell_disable = 1;
                        break;
                    }
                    DELAY(1);
                }
                need_delay = 0;
        }

Change it to:

        if(((xfer->pipe->methods == &ehci_device_ctrl_methods) ||
            (xfer->pipe->methods == &ehci_device_bulk_methods)) &&
           (sc->sc_doorbell_disable == 0))
        {
                u_int32_t to = 100*1000;

       if (error != 0) { /* simply add an "if"-statement */

                /* wait for doorbell ~32us */
                EOWRITE4(sc, EHCI_USBCMD, 
                         EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD);

                while(EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_IAAD)
                {
                    if(!to--)
                    {
                        printf("%s: doorbell timeout "
                               "(disabling)\n", __FUNCTION__);
                        sc->sc_doorbell_disable = 1;
                        break;
                    }
                    DELAY(1);
                }
                need_delay = 0;
            }
        }

Then recompile the kernel and try again.

Thanks for testing.

--HPS


More information about the freebsd-usb mailing list