cvs commit: src/sys/dev/usb ehci.c ehci_pci.c ehcivar.h

Juergen Lock nox at jelal.kn-bremen.de
Mon Jan 30 14:36:19 PST 2006


On Mon, Jan 30, 2006 at 09:57:36PM +0000, Ian Dowse wrote:
> In message <20060130195258.GA7172 at saturn.kn-bremen.de>, Juergen Lock writes:
> > Well ehci_intrlist_timeout belongs to the ehci patch in the Subject
> >so its pretty new...  (I don't know the code enough to know if it
> >matters, but shouldnt the timer only be scheduled if the interrupt
> >did appear too early, i.e. the transfer indeed wasnt complete yet?
> >Not all transfers hung before i applied the patch, so it only
> >happens `sometimes'...)
> 
> Calling the driver's interrupt service routine should be safe at
> any time (assuming sufficient locking, which should be OK), since
> this can happen with shared interrupts, so if anything it's more
> likely to be an existing problem that just gets triggered more often
> by having the ISR called via the new timer.

Ah, OK.
> 
> Try applying the patch I posted yesterday and see if that helps.
> It includes a change to usb_transfer_complete() that might be
> relevant - the EHCI driver touches the transfer structure in its
> done() method, and the usb_transfer_complete() change makes it safe
> to do this when a callback function reuses the transfer structure.
> The umass driver shouldn't normally reuse its transfer structures
> during callbacks, but maybe it can during some error recovery
> condition.
> 
 OK, will do.

> Could you also do the following from gdb on the crash dump you have?
> It might possibly provide further hints as to what went wrong.
> 
> 	p *(struct ehci_xfer *)0xc1aaf300
> 	p *(struct ehci_softc *)0xc1a3f800

 Alright, here comes that:

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".
#0  doadump () at pcpu.h:159
159		__asm __volatile("movl %%fs:0,%0" : "=r" (td));
(kgdb) p *(struct ehci_xfer *)0xc1aaf300
No struct type named ehci_xfer.
(kgdb) p *(struct ehci_softc *)0xc1a3f800
$1 = {sc_bus = {bdev = 0xc1a9da00, methods = 0xc081d440, pipe_size = 80, 
    root_hub = 0xc1ac2c00, devices = {0x0, 0xc1ac2c00, 0xc2881680, 
      0x0 <repeats 125 times>}, needs_explore = 0 '\0', use_polling = 0 '\0', 
    usbctl = 0xc1a9cc40, stats = {uds_requests = {76, 0, 69, 1}}, 
    intr_context = 3, no_intrs = 99, usbrev = 4, dmatag = 0x0}, sc_flags = 3, 
  iot = 1, ioh = 3713073152, sc_size = 0, ih = 0xc1abd000, 
  io_res = 0xc1a7d380, irq_res = 0xc1abd040, sc_offs = 16, 
  sc_vendor = "VIA", '\0' <repeats 12 times>, sc_id_vendor = 0, sc_cmd = 0, 
  sc_ncomp = 3, sc_npcomp = 2, sc_comps = {0xc1a81640, 0xc1a90b80, 0xc1a90700, 
    0x0, 0x0, 0x0, 0x0, 0x0}, sc_fldma = {block = 0xc1a9ce40, offs = 0, 
    len = 4096}, sc_flist = 0xc1ab2000, sc_flsize = 1024, sc_islots = {{
      sqh = 0xc1ab1f60}, {sqh = 0xc1ab1f00}, {sqh = 0xc1ab1ea0}, {
      sqh = 0xc1ab1e40}, {sqh = 0xc1ab1de0}, {sqh = 0xc1ab1d80}, {
      sqh = 0xc1ab1d20}, {sqh = 0xc1ab1cc0}, {sqh = 0xc1ab1c60}, {
      sqh = 0xc1ab1c00}, {sqh = 0xc1ab1ba0}, {sqh = 0xc1ab1b40}, {
      sqh = 0xc1ab1ae0}, {sqh = 0xc1ab1a80}, {sqh = 0xc1ab1a20}, {
      sqh = 0xc1ab19c0}, {sqh = 0xc1ab1960}, {sqh = 0xc1ab1900}, {
      sqh = 0xc1ab18a0}, {sqh = 0xc1ab1840}, {sqh = 0xc1ab17e0}, {
      sqh = 0xc1ab1780}, {sqh = 0xc1ab1720}, {sqh = 0xc1ab16c0}, {
      sqh = 0xc1ab1660}, {sqh = 0xc1ab1600}, {sqh = 0xc1ab15a0}, {
      sqh = 0xc1ab1540}, {sqh = 0xc1ab14e0}, {sqh = 0xc1ab1480}, {
      sqh = 0xc1ab1420}, {sqh = 0xc1ab13c0}, {sqh = 0xc1ab1360}, {
      sqh = 0xc1ab1300}, {sqh = 0xc1ab12a0}, {sqh = 0xc1ab1240}, {
---Type <return> to continue, or q <return> to quit---
      sqh = 0xc1ab11e0}, {sqh = 0xc1ab1180}, {sqh = 0xc1ab1120}, {
      sqh = 0xc1ab10c0}, {sqh = 0xc1ab1060}, {sqh = 0xc1ab1000}, {
      sqh = 0xc1ab0f60}, {sqh = 0xc1ab0f00}, {sqh = 0xc1ab0ea0}, {
      sqh = 0xc1ab0e40}, {sqh = 0xc1ab0de0}, {sqh = 0xc1ab0d80}, {
      sqh = 0xc1ab0d20}, {sqh = 0xc1ab0cc0}, {sqh = 0xc1ab0c60}, {
      sqh = 0xc1ab0c00}, {sqh = 0xc1ab0ba0}, {sqh = 0xc1ab0b40}, {
      sqh = 0xc1ab0ae0}, {sqh = 0xc1ab0a80}, {sqh = 0xc1ab0a20}, {
      sqh = 0xc1ab09c0}, {sqh = 0xc1ab0960}, {sqh = 0xc1ab0900}, {
      sqh = 0xc1ab08a0}, {sqh = 0xc1ab0840}, {sqh = 0xc1ab07e0}, {
      sqh = 0xc1ab0780}, {sqh = 0xc1ab0720}, {sqh = 0xc1ab06c0}, {
      sqh = 0xc1ab0660}, {sqh = 0xc1ab0600}, {sqh = 0xc1ab05a0}, {
      sqh = 0xc1ab0540}, {sqh = 0xc1ab04e0}, {sqh = 0xc1ab0480}, {
      sqh = 0xc1ab0420}, {sqh = 0xc1ab03c0}, {sqh = 0xc1ab0360}, {
      sqh = 0xc1ab0300}, {sqh = 0xc1ab02a0}, {sqh = 0xc1ab0240}, {
      sqh = 0xc1ab01e0}, {sqh = 0xc1ab0180}, {sqh = 0xc1ab0120}, {
      sqh = 0xc1ab00c0}, {sqh = 0xc1ab0060}, {sqh = 0xc1ab0000}, {
      sqh = 0xc1ab3f60}, {sqh = 0xc1ab3f00}, {sqh = 0xc1ab3ea0}, {
      sqh = 0xc1ab3e40}, {sqh = 0xc1ab3de0}, {sqh = 0xc1ab3d80}, {
      sqh = 0xc1ab3d20}, {sqh = 0xc1ab3cc0}, {sqh = 0xc1ab3c60}, {
      sqh = 0xc1ab3c00}, {sqh = 0xc1ab3ba0}, {sqh = 0xc1ab3b40}, {
      sqh = 0xc1ab3ae0}, {sqh = 0xc1ab3a80}, {sqh = 0xc1ab3a20}, {
      sqh = 0xc1ab39c0}, {sqh = 0xc1ab3960}, {sqh = 0xc1ab3900}, {
      sqh = 0xc1ab38a0}, {sqh = 0xc1ab3840}, {sqh = 0xc1ab37e0}, {
---Type <return> to continue, or q <return> to quit---
      sqh = 0xc1ab3780}, {sqh = 0xc1ab3720}, {sqh = 0xc1ab36c0}, {
      sqh = 0xc1ab3660}, {sqh = 0xc1ab3600}, {sqh = 0xc1ab35a0}, {
      sqh = 0xc1ab3540}, {sqh = 0xc1ab34e0}, {sqh = 0xc1ab3480}, {
      sqh = 0xc1ab3420}, {sqh = 0xc1ab33c0}, {sqh = 0xc1ab3360}, {
      sqh = 0xc1ab3300}, {sqh = 0xc1ab32a0}, {sqh = 0xc1ab3240}, {
      sqh = 0xc1ab31e0}, {sqh = 0xc1ab3180}, {sqh = 0xc1ab3120}, {
      sqh = 0xc1ab30c0}, {sqh = 0xc1ab3060}, {sqh = 0xc1ab3000}, {
      sqh = 0xc1ab4f60}, {sqh = 0xc1ab4f00}, {sqh = 0xc1ab4ea0}, {
      sqh = 0xc1ab4e40}, {sqh = 0xc1ab4de0}, {sqh = 0xc1ab4d80}, {
      sqh = 0xc1ab4d20}, {sqh = 0xc1ab4cc0}, {sqh = 0xc1ab4c60}, {
      sqh = 0xc1ab4c00}, {sqh = 0xc1ab4ba0}, {sqh = 0xc1ab4b40}, {
      sqh = 0xc1ab4ae0}, {sqh = 0xc1ab4a80}, {sqh = 0xc1ab4a20}, {
      sqh = 0xc1ab49c0}, {sqh = 0xc1ab4960}, {sqh = 0xc1ab4900}, {
      sqh = 0xc1ab48a0}, {sqh = 0xc1ab4840}, {sqh = 0xc1ab47e0}, {
      sqh = 0xc1ab4780}, {sqh = 0xc1ab4720}, {sqh = 0xc1ab46c0}, {
      sqh = 0xc1ab4660}, {sqh = 0xc1ab4600}, {sqh = 0xc1ab45a0}, {
      sqh = 0xc1ab4540}, {sqh = 0xc1ab44e0}, {sqh = 0xc1ab4480}, {
      sqh = 0xc1ab4420}, {sqh = 0xc1ab43c0}, {sqh = 0xc1ab4360}, {
      sqh = 0xc1ab4300}, {sqh = 0xc1ab42a0}, {sqh = 0xc1ab4240}, {
      sqh = 0xc1ab41e0}, {sqh = 0xc1ab4180}, {sqh = 0xc1ab4120}, {
      sqh = 0xc1ab40c0}, {sqh = 0xc1ab4060}, {sqh = 0xc1ab4000}, {
      sqh = 0xc1ab5f60}, {sqh = 0xc1ab5f00}, {sqh = 0xc1ab5ea0}, {
      sqh = 0xc1ab5e40}, {sqh = 0xc1ab5de0}, {sqh = 0xc1ab5d80}, {
---Type <return> to continue, or q <return> to quit---
      sqh = 0xc1ab5d20}, {sqh = 0xc1ab5cc0}, {sqh = 0xc1ab5c60}, {
      sqh = 0xc1ab5c00}, {sqh = 0xc1ab5ba0}, {sqh = 0xc1ab5b40}, {
      sqh = 0xc1ab5ae0}, {sqh = 0xc1ab5a80}, {sqh = 0xc1ab5a20}, {
      sqh = 0xc1ab59c0}, {sqh = 0xc1ab5960}, {sqh = 0xc1ab5900}, {
      sqh = 0xc1ab58a0}, {sqh = 0xc1ab5840}, {sqh = 0xc1ab57e0}, {
      sqh = 0xc1ab5780}, {sqh = 0xc1ab5720}, {sqh = 0xc1ab56c0}, {
      sqh = 0xc1ab5660}, {sqh = 0xc1ab5600}, {sqh = 0xc1ab55a0}, {
      sqh = 0xc1ab5540}, {sqh = 0xc1ab54e0}, {sqh = 0xc1ab5480}, {
      sqh = 0xc1ab5420}, {sqh = 0xc1ab53c0}...}, sc_intrhead = {
    lh_first = 0xc1aaf300}, sc_freeqhs = 0xc1ab7cc0, sc_freeqtds = 0xc2841ea0, 
  sc_noport = 6, sc_addr = 1 '\001', sc_conf = 1 '\001', 
  sc_intrxfer = 0xc1aaf500, sc_isreset = 0 '\0', sc_eintrs = 55, 
  sc_async_head = 0xc1ab7e40, sc_free_xfers = {stqh_first = 0xc297fb00, 
    stqh_last = 0xc297fb4c}, sc_doorbell_lock = {lk_interlock = 0xc08a19e8, 
    lk_flags = 0, lk_sharecount = 0, lk_waitcount = 0, lk_exclusivecount = 0, 
    lk_prio = 84, lk_wmesg = 0xc07c81c5 "ehcidb", lk_timo = 0, 
    lk_lockholder = 0xffffffff, lk_newlock = 0x0}, sc_tmo_pcd = {c_links = {
      sle = {sle_next = 0xc08722f8}, tqe = {tqe_next = 0xc08722f8, 
        tqe_prev = 0xcbe6a2c8}}, c_time = 35290181, c_arg = 0xc1a3f800, 
    c_func = 0, c_flags = 2}, sc_tmo_intrlist = {c_links = {sle = {
        sle_next = 0xc08722f8}, tqe = {tqe_next = 0xc08722f8, 
        tqe_prev = 0xcbe4d558}}, c_time = 36143767, c_arg = 0xc1a3f800, 
    c_func = 0, c_flags = 2}, sc_child = 0x0, sc_dying = 0 '\0'}
(kgdb) p *(struct ehci_xfer *)0xc1aaf300
$2 = {xfer = {pipe = 0xc29a6b80, priv = 0xc1c22e00, buffer = 0xc1c22e3c, 
    length = 31, actlen = 31, flags = 0, timeout = 245000, 
    status = USBD_NORMAL_COMPLETION, callback = 0xc057e7f4 <umass_bbb_state>, 
    done = 1 '\001', request = {bmRequestType = 0 '\0', bRequest = 0 '\0', 
      wValue = "\000", wIndex = "\000", wLength = "\000"}, frlengths = 0x0, 
    nframes = 0, device = 0xc2881680, dmabuf = {block = 0xc1a9c400, 
      offs = 3712, len = 64}, rqflags = 0, next = {stqe_next = 0x0}, 
    hcpriv = 0x0, timeout_handle = {c_links = {sle = {sle_next = 0x0}, tqe = {
          tqe_next = 0x0, tqe_prev = 0xcbe6b760}}, c_time = 36388568, 
      c_arg = 0xc1aaf300, c_func = 0, c_flags = 0}}, abort_task = {next = {
      tqe_next = 0x0, tqe_prev = 0x0}, fun = 0xc056f814 <ehci_timeout_task>, 
    arg = 0xc1aaf300, onqueue = 0 '\0'}, inext = {le_next = 0x0, 
    le_prev = 0xc1a3fea8}, sqtdstart = 0xc2841f00, sqtdend = 0xc2841f00, 
  ehci_xfer_flags = 0}
(kgdb) q


More information about the freebsd-usb mailing list