Help with oops during xHCI resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been testing Andiry's xHCI power management patches (plus John's
USB3 hub patches, for various reasons[1]).

I ran into an oops when I resumed from suspend with a mounted USB 3.0
hard drive playing a movie file.  I think it's because
xhci_add_endpoint() is trying to allocate things with the wrong memory
flags, but I'm not sure.

Here's the oops, and messages before it:

    [ 2165.959299] xhci_hcd 0000:05:00.0: Allocating ring at ffff880037e0cf00
    [ 2165.959303] xhci_hcd 0000:05:00.0: Allocating priv segment structure at ffff880131f51d20
    [ 2165.959319] general protection fault: 0000 [#1] SMP
    [ 2165.959359] last sysfs file: /sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/usb9/9-2/9-2:1.0/host5/target5:0:0/5:0:0:0/block/sdb/sdb1/stat
    [ 2165.959421] CPU 1
    [ 2165.959434] Modules linked in: xhci_hcd usb_storage usbhid uhci_hcd ehci_hcd usbcore arc4 snd_hda_codec_conexant thinkpad_acpi snd_hda_intel snd_seq_dummy snd_hda_codec i
    [ 2165.959829]
    [ 2165.959842] Pid: 7260, comm: usb-storage Not tainted 2.6.36-rc5+ #635 74663HU/74663HU
    [ 2165.959881] RIP: 0010:[<ffffffff810db361>]  [<ffffffff810db361>] dma_pool_alloc+0x61/0x2c0
    [ 2165.959930] RSP: 0018:ffff880131fb3a30  EFLAGS: 00010002
    [ 2165.959959] RAX: c0000101002c0209 RBX: c0000101002c0209 RCX: 000000000001ffff
    [ 2165.959995] RDX: 0000000030060004 RSI: 0000000000000010 RDI: ffff880037fca690
    [ 2165.960031] RBP: ffff880131fb3ab0 R08: 000000000033fccb R09: 000000000000000a
    [ 2165.960067] R10: 0000000000000006 R11: 0000000000000000 R12: ffff880037fca680
    [ 2165.960103] R13: ffff880037fca690 R14: 0000000000000286 R15: ffff880131fe5480
    [ 2165.960140] FS:  0000000000000000(0000) GS:ffff880001e80000(0000) knlGS:0000000000000000
    [ 2165.960182] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [ 2165.960211] CR2: 00007f3b2083c000 CR3: 0000000001a91000 CR4: 00000000000406a0
    [ 2165.960247] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 2165.960283] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 2165.960319] Process usb-storage (pid: 7260, threadinfo ffff880131fb2000, task ffff880131fe5480)
    [ 2165.960362] Stack:
    [ 2165.960375]  ffff880131fb3a40 ffff880037fca6e0 ffff880131fb3ac8 00000010812c92a0
    [ 2165.960421] <0> ffffffff00000020 ffff880131fb3ac0 ffff880131fb3a80 ffff880037e0cf00
    [ 2165.960472] <0> ffffffffa01ebb00 ffff880131fb3a50 ffff880131fb3af0 ffff880131f51d20
    [ 2165.960526] Call Trace:
    [ 2165.960545]  [<ffffffffa01e04b6>] xhci_segment_alloc+0x76/0x100 [xhci_hcd]
    [ 2165.960585]  [<ffffffffa01e06eb>] xhci_ring_alloc+0xab/0x1c0 [xhci_hcd]
    [ 2165.960621]  [<ffffffffa01e088c>] xhci_endpoint_init+0x8c/0x4d0 [xhci_hcd]
    [ 2165.960659]  [<ffffffffa01da947>] xhci_add_endpoint+0x127/0x2b0 [xhci_hcd]
    [ 2165.960703]  [<ffffffffa0309667>] usb_hcd_alloc_bandwidth+0x137/0x330 [usbcore]
    [ 2165.960745]  [<ffffffffa0305dfe>] usb_reset_and_verify_device+0x36e/0x590 [usbcore]
    [ 2165.960788]  [<ffffffff814d982e>] ? wait_for_completion_interruptible_timeout+0xe/0x10
    [ 2165.960833]  [<ffffffffa03060d2>] usb_reset_device+0xb2/0x190 [usbcore]
    [ 2165.960870]  [<ffffffffa01adf69>] usb_stor_port_reset+0x69/0x70 [usb_storage]
    [ 2165.960908]  [<ffffffffa01ae3b6>] usb_stor_invoke_transport+0x76/0x400 [usb_storage]
    [ 2165.960949]  [<ffffffff814d9738>] ? wait_for_common+0xd8/0x180
    [ 2165.960982]  [<ffffffff810417f0>] ? default_wake_function+0x0/0x10
    [ 2165.961017]  [<ffffffffa01ade19>] usb_stor_transparent_scsi_command+0x9/0x10 [usb_storage]
    [ 2165.961062]  [<ffffffffa01b01ee>] usb_stor_control_thread+0x15e/0x240 [usb_storage]
    [ 2165.961103]  [<ffffffffa01b0090>] ? usb_stor_control_thread+0x0/0x240 [usb_storage]
    [ 2165.961144]  [<ffffffffa01b0090>] ? usb_stor_control_thread+0x0/0x240 [usb_storage]
    [ 2165.961184]  [<ffffffff81061286>] kthread+0x96/0xa0
    [ 2165.961212]  [<ffffffff8100bc04>] kernel_thread_helper+0x4/0x10
    [ 2165.961244]  [<ffffffff810611f0>] ? kthread+0x0/0xa0
    [ 2165.961273]  [<ffffffff8100bc00>] ? kernel_thread_helper+0x0/0x10
    [ 2165.961304] Code: c6 49 8d 44 24 60 48 89 45 88 49 8b 1c 24 eb 1b 66 2e 0f 1f 84 00 00 00 00 00 8b 53 24 49 3b 54 24 28 0f 82 1a 01 00 00 48 89 c3 <48> 8b 03 4c 39 e3 0f 
    [ 2165.961577] RIP  [<ffffffff810db361>] dma_pool_alloc+0x61/0x2c0
    [ 2165.961612]  RSP <ffff880131fb3a30>
    [ 2166.472390] ---[ end trace 78a4031e83732b59 ]---

The xHCI driver is calling xhci_endpoint_init() with a memory flag of
GFP_NOIO.  The kmalloc in xhci_ring_alloc() with that flag succeeds, and
a kzalloc() in xhci_segment_alloc() succeeds, but the dma_pool_alloc()
in xhci_segment_alloc() is what causes the oops, AFAIK.

Oliver had suggested I use GFP_NOIO instead of GFP_KERNEL in this code
because this might be called during in a storage error handling thread
(which it looks like it is from the oops message).  Do I need to use
GFP_ATOMIC instead?  Or is this indicative of another problem?

Sarah Sharp

[1] I'm seeing a disconnect with all the USB 3.0 hard drives I have
available whenever I try to hibernate the system.  The device refuses to
enumerate, and the port gets disabled.  If I unplug the device and
replug it in again, the device comes up as high speed.  So I thought I
might need part of John's hub patch to prevent the USB core from
disabling the port (since USB 3.0 hubs can't have their ports disabled).
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux