Hi, On 03/22/2016 11:17 AM, Lipengcheng wrote: > Hi, > Thanks for your reply. > When the suspend and resume process , the operation of press ctrl + c will produce an interruput and cause to allocate memory failed. It causes the usb3 module can not be used and core dump after resume process. > Software call flow: > |xhci_resume > ||xhci_init > |||xhci_mem_init > |||| dma_alloc_coherent > |||||dma_alloc_from_contiguous > In dma_alloc_from_contiguous return -4 (Interrupted system call). The core dump says "PC is at xhci_mem_cleanup+0x4e4/0x574 [xhci_hcd] ". But this call flow shows error happens in dma allocation. Which is correct? Or, anything I misunderstood? Best regards, Baolu > > Core dump information: > > Vi Resume OK > PM resume OK > usb usb1: root hub lost power or was reset > usb usb2: root hub lost power or was reset > ^Cusb usb3: root hub lost power or was reset > usb usb4: root hub lost power or was reset > usb usb5: root hub lost power or was reset > usb usb6: root hub lost power or was reset > hiusb-xhci hiusb-xhci.0: Couldn't initialize memory > Unable to handle kernel NULL pointer dereference at virtual address 00000000 > pgd = a7324000 > [00000000] *pgd=27265831, *pte=00000000, *ppte=00000000 > Internal error: Oops: 817 [#1] SMP ARM > Modules linked in: tntfs(PO) xhci_hcd ohci_hcd ehci_hcd hi_pmoc(O) hi_vi(O) hi_keyled(O) hi_aenc(O) hi_venc(O) hi_png(O) hi_jpge(O) hi_jpeg(O) hi_ir(O) hi_fb(O) hi_pwm(O) hi_mce(O) hi_avplay(O) hi_pvr(O) hi_sync(O) hi_vou(O) hi_aiao(O) hi_adsp(O) hi_hdmi(O) hi_cipher(O) hi_vdec(O) hi_vpss(O) hi_pq(O) hi_pdm(O) hi_svdec(O) hi_vfmw(O) hi_adec(O) hi_demux(O) hi_otp(O) hi_tde(O) mali(O) hi_i2c(O) hi_gpio_i2c(O) hi_gpio(O) hi_common(O) hi_mmz(O) hi_media(O) > CPU: 0 PID: 1113 Comm: sample_pmoc Tainted: P O 3.10.0_s40 #1 > task: a7ba9a40 ti: a72e2000 task.ti: a72e2000 > PC is at xhci_mem_cleanup+0x4e4/0x574 [xhci_hcd] > LR is at 0x0 > pc : [<7f840468>] lr : [<00000000>] psr: 80000013 > sp : a72e3ca8 ip : a79aef18 fp : a72e3cdc > r10: 00000000 r9 : 00000002 r8 : 00100100 > r7 : 00200200 r6 : 00000000 r5 : a79ae800 r4 : a691b000 > r3 : a79af000 r2 : a79ae800 r1 : a79aec00 r0 : a79af000 > Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user > Control: 10c53c7d Table: 2732406a DAC: 00000015 > > SP: 0xa72e3c28: > 3c28 a72e3c5c a72e3c38 8002158c 80355df4 00001000 a72e3d04 7f840468 80000013 > 3c48 ffffffff a72e3c94 a72e3cdc a72e3c60 80014c98 8000846c a79af000 a79aec00 > 3c68 a79ae800 a79af000 a691b000 a79ae800 00000000 00200200 00100100 00000002 > 3c88 00000000 a72e3cdc a79aef18 a72e3ca8 00000000 7f840468 80000013 ffffffff > 3ca8 a68236a4 a7330a00 a72e3cdc a691b000 7f84ce88 00000000 a72e3d04 a68236a4 > 3cc8 00000010 a7330a00 a72e3d34 a72e3ce0 7f841d54 7f83ff90 00000000 a691b000 > 3ce8 00000000 00000338 00200200 00100100 000000d0 00000002 a72e3d44 ffffffff > 3d08 7f8404d8 a691b000 a6823600 8086c0c0 00000001 a68236a4 00000010 a7330a00 > > IP: 0xa79aee98: > ee98 00000000 00000000 a79aeea0 a79aeea0 00000000 00000000 00000000 00000000 > eeb8 a79aeeb8 a79aeeb8 00000000 00000000 00000000 00000000 a79aeed0 a79aeed0 > eed8 00000000 00000000 00000000 00000000 a79aeee8 a79aeee8 00000000 00000000 > eef8 00000000 00000000 a79aef00 a79aef00 00000000 00000000 00000000 00000000 > ef18 a79aef18 a79aef18 00000000 00000000 00000000 00000000 00000000 00000000 > ef38 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > ef58 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > ef78 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > > FP: 0xa72e3c5c: > 3c5c 8000846c a79af000 a79aec00 a79ae800 a79af000 a691b000 a79ae800 00000000 > 3c7c 00200200 00100100 00000002 00000000 a72e3cdc a79aef18 a72e3ca8 00000000 > 3c9c 7f840468 80000013 ffffffff a68236a4 a7330a00 a72e3cdc a691b000 7f84ce88 > 3cbc 00000000 a72e3d04 a68236a4 00000010 a7330a00 a72e3d34 a72e3ce0 7f841d54 > 3cdc 7f83ff90 00000000 a691b000 00000000 00000338 00200200 00100100 000000d0 > 3cfc 00000002 a72e3d44 ffffffff 7f8404d8 a691b000 a6823600 8086c0c0 00000001 > 3d1c a68236a4 00000010 a7330a00 a72e3d44 a72e3d38 7f83da28 7f840e94 a72e3d7c > 3d3c a72e3d48 7f83df78 7f83d9e4 00002710 a72e3d58 803d977c a691b000 80352fe0 > > R0: 0xa79aef80: > ef80 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > efa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > efc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > efe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > f000 a79ae800 00000000 a72c7658 8005e52c 00000000 00000000 00000000 00000000 > f020 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > f040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > f060 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > > R1: 0xa79aeb80: > eb80 10000400 00008000 00000000 00000000 00000000 00000000 00000000 00000000 > eba0 00000000 0042500c 01100000 24001200 00000000 808040a0 00000000 00000000 > ebc0 00000000 011040c4 01104804 00000000 45602000 00000070 00000000 00000000 > ebe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > ec00 a79af000 a79aec00 00000000 00000000 00000000 a79aec14 a79aec14 00000000 > ec20 00000000 00000000 00000000 a79aec2c a79aec2c 00000000 00000000 00000000 > ec40 00000000 a79aec44 a79aec44 00000000 00000000 00000000 00000000 a79aec5c > ec60 a79aec5c 00000000 00000000 00000000 00000000 a79aec74 a79aec74 00000000 > > R2: 0xa79ae780: > e780 00000005 00000000 00000000 01000000 01110700 07108700 00000000 00000000 > e7a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > e7c0 00540004 0700c200 101c8404 00000004 00000000 00000000 00040004 5d524001 > e7e0 d0400002 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > e800 a79ae400 00000000 a72c7dd8 8005e52c 00000000 00000000 00000000 00000000 > e820 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > e840 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > e860 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > > R3: 0xa79aef80: > ef80 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > efa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > efc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > efe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > f000 a79ae800 00000000 a72c7658 8005e52c 00000000 00000000 00000000 00000000 > f020 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > f040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > f060 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > > R4: 0xa691af80: > af80 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > afa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > afc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > afe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > b000 a6823600 a7330a00 fe8a0000 fe8a0020 fe8a0440 fe8a0480 fe8a0460 02000140 > b020 0c0000f1 07ff000a 0220f06c 00010001 01000000 00000000 00000000 00000000 > b040 00001000 0000000c 00000000 00000000 00000000 00000000 00000004 a691b05c > b060 a691b05c 00000000 00000000 00000000 00000001 3fc4e000 00000000 00000000 > > R5: 0xa79ae780: > e780 00000005 00000000 00000000 01000000 01110700 07108700 00000000 00000000 > e7a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > e7c0 00540004 0700c200 101c8404 00000004 00000000 00000000 00040004 5d524001 > e7e0 d0400002 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > e800 a79ae400 00000000 a72c7dd8 8005e52c 00000000 00000000 00000000 00000000 > e820 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > e840 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > e860 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > Process sample_pmoc (pid: 1113, stack limit = 0xa72e2238) > Stack: (0xa72e3ca8 to 0xa72e4000) > 3ca0: a68236a4 a7330a00 a72e3cdc a691b000 7f84ce88 00000000 > 3cc0: a72e3d04 a68236a4 00000010 a7330a00 a72e3d34 a72e3ce0 7f841d54 7f83ff90 > 3ce0: 00000000 a691b000 00000000 00000338 00200200 00100100 000000d0 00000002 > 3d00: a72e3d44 ffffffff 7f8404d8 a691b000 a6823600 8086c0c0 00000001 a68236a4 > 3d20: 00000010 a7330a00 a72e3d44 a72e3d38 7f83da28 7f840e94 a72e3d7c a72e3d48 > 3d40: 7f83df78 7f83d9e4 00002710 a72e3d58 803d977c a691b000 80352fe0 a72e3dc4 > 3d60: 00000010 00000000 00000010 80895188 a72e3d94 a72e3d80 7f83e14c 7f83dd00 > 3d80: 7f83e118 7f84ce88 a72e3da4 a72e3d98 8035301c 7f83e124 a72e3dbc a72e3da8 > 3da0: 803584f8 80352fec 7f84ce88 7f84cebc a72e3e0c a72e3dc0 80358f38 803584dc > 3dc0: 80358a00 7f84ce88 a7ba9a40 808c94dc 808c94dc fffcf100 808c8b40 80358ad8 > 3de0: a72e3dc4 ffffffff 7f84ce88 7f84ce88 80895160 00000000 809059f0 80884a08 > 3e00: a72e3e4c a72e3e10 80359530 80358e30 2cad96a6 00000014 2cad96a6 00000014 > 3e20: 808c88d0 00000010 808cb690 00000000 a72e3e7c 8087b818 a72e2000 808ba8d0 > 3e40: a72e3e64 a72e3e50 8035a5a0 8035942c 00000000 00000002 a72e3ebc a72e3e68 > 3e60: 8006c42c 8035a590 a72e3e94 8087c684 80052514 00000000 80743a28 a72e3e9c > 3e80: 00000000 a72e3e9c a72e3ebc a72e3ea8 8006bfe8 00000002 00000000 80606560 > 3ea0: 00000007 8070b998 a78f0a40 806476a4 a72e3ed4 a72e3ec0 8006c818 8006c250 > 3ec0: a7993000 00000007 a72e3efc a72e3ed8 8006b458 8006c648 00000007 a79f2c80 > 3ee0: a79f2c98 a72e3f70 a78f0b40 802fbbcc a72e3f0c a72e3f00 802fbbec 8006b3c0 > 3f00: a72e3f3c a72e3f10 8016eba4 802fbbd8 a72e3f70 a797c840 00000007 76fad000 > 3f20: a72e3f70 00000000 00000000 00000007 a72e3f6c a72e3f40 80104954 8016eaa4 > 3f40: a72e3f4c 00000000 a797c840 00000000 a72e3f70 76fad000 00000000 00000007 > 3f60: a72e3fa4 a72e3f70 80104b0c 8010488c 00000000 00000000 00000022 00000007 > 3f80: 00092008 00000007 00000004 80015348 a72e2000 00000000 00000000 a72e3fa8 > 3fa0: 80015100 80104ac4 00000007 00092008 00000005 76fad000 00000007 00000000 > 3fc0: 00000007 00092008 00000007 00000004 76fad000 00000000 00092008 7e88dd2c > 3fe0: 00000000 7e88da40 76dff2bc 76e5dccc 60000010 00000005 04100000 11004001 > [<7f840468>] (xhci_mem_cleanup+0x4e4/0x574 [xhci_hcd]) from [<7f841d54>] (xhci_mem_init+0xecc/0x1110 [xhci_hcd]) > [<7f841d54>] (xhci_mem_init+0xecc/0x1110 [xhci_hcd]) from [<7f83da28>] (xhci_init+0x50/0x54 [xhci_hcd]) > [<7f83da28>] (xhci_init+0x50/0x54 [xhci_hcd]) from [<7f83df78>] (xhci_resume+0x284/0x424 [xhci_hcd]) > [<7f83df78>] (xhci_resume+0x284/0x424 [xhci_hcd]) from [<7f83e14c>] (hiusb_xhci_hcd_drv_resume+0x34/0x38 [xhci_hcd]) > [<7f83e14c>] (hiusb_xhci_hcd_drv_resume+0x34/0x38 [xhci_hcd]) from [<8035301c>] (platform_pm_resume+0x3c/0x5c) > [<8035301c>] (platform_pm_resume+0x3c/0x5c) from [<803584f8>] (dpm_run_callback+0x28/0x58) > [<803584f8>] (dpm_run_callback+0x28/0x58) from [<80358f38>] (device_resume+0x114/0x280) > [<80358f38>] (device_resume+0x114/0x280) from [<80359530>] (dpm_resume+0x110/0x224) > [<80359530>] (dpm_resume+0x110/0x224) from [<8035a5a0>] (dpm_resume_end+0x1c/0x28) > [<8035a5a0>] (dpm_resume_end+0x1c/0x28) from [<8006c42c>] (suspend_devices_and_enter+0x1e8/0x3f8) > [<8006c42c>] (suspend_devices_and_enter+0x1e8/0x3f8) from [<8006c818>] (pm_suspend+0x1dc/0x23c) > [<8006c818>] (pm_suspend+0x1dc/0x23c) from [<8006b458>] (state_store+0xa4/0x134) > [<8006b458>] (state_store+0xa4/0x134) from [<802fbbec>] (kobj_attr_store+0x20/0x24) > [<802fbbec>] (kobj_attr_store+0x20/0x24) from [<8016eba4>] (sysfs_write_file+0x10c/0x18c) > [<8016eba4>] (sysfs_write_file+0x10c/0x18c) from [<80104954>] (vfs_write+0xd4/0x1a0) > [<80104954>] (vfs_write+0xd4/0x1a0) from [<80104b0c>] (SyS_write+0x54/0x80) > [<80104b0c>] (SyS_write+0x54/0x80) from [<80015100>] (ret_fast_syscall+0x0/0x30) > Code: 0a00000e e1a02005 e593e004 e1a00003 (e58e2000) > ---[ end trace 3c4123f3f7d5e19e ]--- > > thanks, > Pengcheng Li > > -----邮件原件----- > 发件人: gregkh@xxxxxxxxxxxxxxxxxxx [mailto:gregkh@xxxxxxxxxxxxxxxxxxx] > 发送时间: 2016年3月22日 10:28 > 收件人: Lipengcheng > 抄送: mathias.nyman@xxxxxxxxx; stern@xxxxxxxxxxxxxxxxxxx; balbi@xxxxxx; chasemetzger15@xxxxxxxxx; baolu.lu@xxxxxxxxxxxxxxx; mjg59@xxxxxxxxxx; kborer@xxxxxxxxx; jun.li@xxxxxxxxxxxxx; Robert.Schlabbach@xxxxxxx; linux-usb@xxxxxxxxxxxxxxx > 主题: Re: 【xhci】suspend and resume core dump problem > > On Tue, Mar 22, 2016 at 01:31:40AM +0000, Lipengcheng wrote: >> Hi, >> we have a problem like that we can start kernel successfully without processing any other operations, but failed after pressing ctrl + c. After our analsys, it is because of that, ctrl + c will produce an interruput,it will be dealed with in xhci_resume->xhci_init->xhci_mem_init so that dma_alloc_coherent fail, finally it will be calm down in the FUNCITON LIST_DEL(&tt->tt_list). >> As the modification , set flag to GFP_ATOMIC, disabling interrupt requests will not be core dump, could you please tell me can I modify like this? >> >> Thanks very much >> >> Best Regards, >> >> Pengcheng Li >> >> >> Modify 1: >> xhci->dcbaa = dma_alloc_coherent(dev, sizeof(*xhci->dcbaa), &dma, >> - GFP_KERNEL); >> + GFP_ATOMIC); >> Modify 2: >> xhci->erst.entries = dma_alloc_coherent(dev, >> sizeof(struct xhci_erst_entry) * ERST_NUM_SEGS, &dma, >> - GFP_KERNEL); >> + GFP_ATOMIC); >> Modify 3: >> - retval = xhci_mem_init(xhci, GFP_KERNEL); >> + retval = xhci_mem_init(xhci, GFP_ATOMIC); >> xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Finished xhci_init"); > Why isn't the 'flags' variable being use here instead of hard-coding GFP_KERNEL? Hm, it looks like that variable doesn't really make much sense as it's only ever called with GFP_KERNEL... > > Anyway, this is during init, there should not be any locks happening, so you can sleep, so using GFP_KERNEL is correct, I don't understand why GFP_ATOMIC is needed here. > > thanks, > > greg k-h -- 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