Hi, Thanks Baolu very much! The kernel is 3.10.Before the problem is inevitable emergence. But we fix patch number:b630d4b9d05ba2e66878ca4614946d0f950d4111 and your suggest. Then we resume and suspend the seventh and it is ok only if the usb3 can not work. So the changes are effective. In the wrong state which the usb3 can not work, we continue to suspend and resume. It will be core dump. Should it be a normal phenomenon? Thanks, Pengcheng Li Core dump information: ^Cusb usb3: root hub lost power or was reset usb usb4: root hub lost power or was reset ^C^Cusb usb5: root hub lost power or was reset usb usb6: root hub lost power or was reset ###############xhci_mem_cleanup,1828,i=0x2 ###############xhci_mem_cleanup,1857,xhci->rh_bw=0xa6088800 ###############xhci_mem_cleanup,1910,xhci->rh_bw=0x0 ###############xhci_mem_init,2570 hiusb-xhci hiusb-xhci.0: Couldn't initialize memory ###############xhci_mem_cleanup,1828,i=0x0 ###############xhci_mem_cleanup,1857,xhci->rh_bw=0x0 ###############xhci_mem_cleanup,1910,xhci->rh_bw=0x0 dpm_run_callback(): platform_pm_resume+0x0/0x5c returns -12 PM: Device hiusb-xhci.0 failed to resume: error -12 ^Chub 5-0:1.0: hub_port_status failed (err = -32) hub 6-0:1.0: hub_port_status failed (err = -32) PM: resume of devices complete after 1545.853 msecs Restarting tasks ... usb 1-2: USB disconnect, device number 2 done. PM: suspend exit 1970-01-01 00:00:20.012763502 UTC # # # ./sample_pmoc 1 0 1000 0 0 2 0 <-again suspend and resume SAMPLE_PS: Cann'PM: suspend entry 1970-01-01 00:00:25.009414169 UTC t open '/dev/wifPM: Syncing filesystems ... i/sample.pid' done. Freezing user space processes ... (elapsed 0.001 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. hub 5-0:1.0: hub_port_status failed (err = -32) hub 6-0:1.0: hub_port_status failed (err = -32) ########xhci_suspend,898 ########xhci_suspend,904 ########xhci_suspend,915 ########xhci_clear_command_ring,843,xhci=0xa7282000 Unable to handle kernel NULL pointer dereference at virtual address 00000018 pgd = a73bc000 [00000018] *pgd=272a5831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] SMP ARM Modules linked in: xhci_hcd tntfs(PO) 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) [last unloaded: xhci_hcd] CPU: 0 PID: 1128 Comm: sample_pmoc Tainted: P O 3.10.0_s40 #21 task: a79c70c0 ti: a681c000 task.ti: a681c000 PC is at xhci_suspend+0x168/0x410 [xhci_hcd] LR is at console_unlock+0x46c/0x4c8 pc : [<7f8ff624>] lr : [<8002e590>] psr: 20000093 sp : a681dd48 ip : a681dc58 fp : a681dd74 r10: 00000024 r9 : 80895180 r8 : 00000002 r7 : a681ddb8 r6 : 00000000 r5 : a7b30800 r4 : a7282000 r3 : 808821b0 r2 : 0000034e r1 : 7f90c134 r0 : 7f90cfb0 Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c53c7d Table: 273bc06a DAC: 00000015 LR: 0x8002e510: e510 e5950958 e3a0c000 e585c000 e150000c 151b9040 1589c958 f57ff05f e1d52ab4 e530 e2826001 e1c56ab4 f57ff04f e320f004 e59f00a0 eb00a700 e59f008c eb174e9c e550 e3a03e96 e18560d3 e1c581d8 e51b1044 e59f0074 eb174ed6 e1570009 01560008 e570 0a000002 ebfffc60 e3500000 1affff0c e51be04c e35e0000 0a000000 ebfffc40 e590 e24bd028 e89daff0 e51b0044 e121f000 eaffff03 e3a04000 e3a02b01 e0533001 e5b0 0affffb9 eaffffac e3004538 e59f201c e18500d4 ebfff8f9 e5953528 e595152c e5d0 e1a04000 e2602b01 eafffff3 808c3bec 808c409c 808c3c90 808821dc e1a0c00d e5f0 e92dd830 e24cb004 e52de004 e8bd4000 e1a04000 ebfffc4d e3030b48 e348008c SP: 0xa681dcc8: dcc8 00000034 60000093 8086ed50 a79c4780 00000000 00000000 7f8ff624 20000093 dce8 ffffffff a681dd34 a681dd74 a681dd00 80014c98 8000846c 7f90cfb0 7f90c134 dd08 0000034e 808821b0 a7282000 a7b30800 00000000 a681ddb8 00000002 80895180 dd28 00000024 a681dd74 a681dc58 a681dd48 8002e590 7f8ff624 20000093 ffffffff dd48 00003e80 8003d8b4 a7b30800 80352fbc 7f90f3e4 a681ddb8 00000002 80895180 dd68 a681dd8c a681dd78 7f8ff8f0 7f8ff4c8 809059f0 80352fbc a681dd9c a681dd90 dd88 80352ff8 7f8ff8d8 a681ddb4 a681dda0 80358538 80352fc8 809059f0 7f90f3b0 dda8 a681de04 a681ddb8 80358c98 8035851c 7f90f3b0 a79c70c0 808c953c 808c953c IP: 0xa681dbd8: dbd8 80026d4c 00000000 000004c1 a7925c10 a681dc1c a681dbf8 8034732c 80026d0c dbf8 80894428 808c3b48 80347220 a681c000 00000035 8087b4d0 a681dc54 a681dc20 dc18 8002e0dc 8034722c 00000000 80058194 a681dc54 00000017 80880aa0 00000018 dc38 a681dd00 00000002 80895180 00000024 a681dcfc a681dc58 800084a8 80022b9c dc58 00000400 00000000 00000001 808821a4 20000093 808c3b48 000001c3 80058144 dc78 000001c4 00000000 80058144 808c3b48 808821a4 00000001 00000002 00000034 dc98 00000034 00000004 a681dd14 a681dcb0 8002eb08 8002e130 00000000 00000000 dcb8 00000000 00000000 808c44d0 00000034 00000034 60000093 8086ed50 a79c4780 FP: 0xa681dcf4: dcf4 a681dd00 80014c98 8000846c 7f90cfb0 7f90c134 0000034e 808821b0 a7282000 dd14 a7b30800 00000000 a681ddb8 00000002 80895180 00000024 a681dd74 a681dc58 dd34 a681dd48 8002e590 7f8ff624 20000093 ffffffff 00003e80 8003d8b4 a7b30800 dd54 80352fbc 7f90f3e4 a681ddb8 00000002 80895180 a681dd8c a681dd78 7f8ff8f0 dd74 7f8ff4c8 809059f0 80352fbc a681dd9c a681dd90 80352ff8 7f8ff8d8 a681ddb4 dd94 a681dda0 80358538 80352fc8 809059f0 7f90f3b0 a681de04 a681ddb8 80358c98 ddb4 8035851c 7f90f3b0 a79c70c0 808c953c 808c953c fffbfd00 808c8b40 80358b18 ddd4 a681ddb8 ffffffff 00895160 7f90f3b0 7f90f3b0 809059f0 80895160 80884a08 R3: 0x80882130: 2130 00000003 00000004 00000005 00000006 00000007 00000008 00000009 0000000a 2150 0000000b 0000000c 0000000d 0000000e 0000000f 00000010 00000011 00000012 2170 00000013 00000014 00000015 00000016 00000017 00000018 00000019 0000001a 2190 0000001b 0000001c 0000001d 0000001e 0000001f 00000001 00004000 00000000 21b0 808821b0 808821b0 808c48d0 808821bc 808821bc 00010001 00001388 0000000a 21d0 00000001 00000000 fffbb431 07730773 00000001 808821e4 808821e4 00000000 21f0 0000000f 00000004 00000001 00000007 ffffffff ffffffff 00000000 8088208c 2210 80882308 808b7010 807049f8 00000000 80889acc 80882320 808820a4 00000014 R4: 0xa7281f80: 1f80 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 1fa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 1fc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 1fe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 2000 a7b30800 a79dd200 fe8a0000 fe8a0020 fe8a0440 fe8a0480 fe8a0460 02000140 2020 0c0000f1 07ff000a 0220f06c 00220021 01000000 00000000 00000000 00000000 2040 00000000 00000000 00000000 00000000 00000000 00000000 00000004 a728205c 2060 a728205c 00000001 00000000 00000000 00000001 3fc4e000 00000000 00000000 R5: 0xa7b30780: 0780 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 07a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 07c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 07e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0800 7f90f3b0 00000005 a6b94f80 04000001 ffffffff 00000002 00000002 00000000 0820 00000000 00000000 a6088000 00000000 a79db030 a79dd230 00000000 00000000 0840 00000000 00000000 00000002 7f90d08c 00000020 69636878 6463682d 6273753a 0860 00000035 00000000 00000000 00000000 00000000 00000000 a7812000 803c8f58 R7: 0xa681dd38: dd38 8002e590 7f8ff624 20000093 ffffffff 00003e80 8003d8b4 a7b30800 80352fbc dd58 7f90f3e4 a681ddb8 00000002 80895180 a681dd8c a681dd78 7f8ff8f0 7f8ff4c8 dd78 809059f0 80352fbc a681dd9c a681dd90 80352ff8 7f8ff8d8 a681ddb4 a681dda0 dd98 80358538 80352fc8 809059f0 7f90f3b0 a681de04 a681ddb8 80358c98 8035851c ddb8 7f90f3b0 a79c70c0 808c953c 808c953c fffbfd00 808c8b40 80358b18 a681ddb8 ddd8 ffffffff 00895160 7f90f3b0 7f90f3b0 809059f0 80895160 80884a08 80895160 ddf8 a681de4c a681de08 80359244 80358b64 d43da914 00000005 8034d7f4 00000002 de18 d43da914 00000005 80358878 00000002 808cb690 00000001 00000007 8087b818 R9: 0x80895100: 5100 000001a4 803562e8 80356bb4 8073b8e8 000001a4 80356358 80356d04 00000000 5120 00000000 80895124 80895124 00000000 00000001 00000000 80895138 80895138 5140 00000000 00000000 00000001 00000000 80895150 80895150 00000000 00000000 5160 80895160 80895160 00000001 00000000 80895170 80895170 00000000 00000000 5180 80894c8c 7f90f414 a60880cc a79fc264 80895190 80895190 80895198 80895198 51a0 a7134e34 a7924704 00000000 808951ac 808951ac 00000001 00000000 808951bc 51c0 808951bc 00000000 00000000 0000003c 80880060 808a7dc4 8035f164 00000000 51e0 00000000 8073b5c8 00000000 80895274 00000000 00000000 a7827b00 8035f230 Process sample_pmoc (pid: 1128, stack limit = 0xa681c238) Stack: (0xa681dd48 to 0xa681e000) dd40: 00003e80 8003d8b4 a7b30800 80352fbc 7f90f3e4 a681ddb8 dd60: 00000002 80895180 a681dd8c a681dd78 7f8ff8f0 7f8ff4c8 809059f0 80352fbc dd80: a681dd9c a681dd90 80352ff8 7f8ff8d8 a681ddb4 a681dda0 80358538 80352fc8 dda0: 809059f0 7f90f3b0 a681de04 a681ddb8 80358c98 8035851c 7f90f3b0 a79c70c0 ddc0: 808c953c 808c953c fffbfd00 808c8b40 80358b18 a681ddb8 ffffffff 00895160 dde0: 7f90f3b0 7f90f3b0 809059f0 80895160 80884a08 80895160 a681de4c a681de08 de00: 80359244 80358b64 d43da914 00000005 8034d7f4 00000002 d43da914 00000005 de20: 80358878 00000002 808cb690 00000001 00000007 8087b818 a78f0a40 808ba8d0 de40: a681de64 a681de50 8035945c 803591e0 00000000 00000002 a681debc a681de68 de60: 8006c304 803593fc a681de94 a681de78 805fec40 8002e818 80743a4c a681de9c de80: 00000000 a681de9c a681debc a681dea8 8006c028 00000002 00000000 80606560 dea0: 00000007 8070b9bc a78f0a40 806476a4 a681ded4 a681dec0 8006c858 8006c290 dec0: a72b0000 00000007 a681defc a681ded8 8006b498 8006c688 00000007 a6298a00 dee0: a6298a18 a681df70 a78f0b40 802fbc0c a681df0c a681df00 802fbc2c 8006b400 df00: a681df3c a681df10 8016ebe4 802fbc18 a681df70 a724d0c0 00000007 76f49000 df20: a681df70 00000000 00000000 00000007 a681df6c a681df40 80104994 8016eae4 df40: a681df4c 00000000 a724d0c0 00000000 a681df70 76f49000 00000000 00000007 df60: a681dfa4 a681df70 80104b4c 801048cc 00000000 00000000 00000022 00000007 df80: 00f07008 00000007 00000004 80015348 a681c000 00000000 00000000 a681dfa8 dfa0: 80015100 80104b04 00000007 00f07008 00000005 76f49000 00000007 00000000 dfc0: 00000007 00f07008 00000007 00000004 76f49000 00000000 00f07008 7ef4bd2c dfe0: 00000000 7ef4ba40 76d9b2bc 76df9ccc 60000010 00000005 f5dfdfad df3d1857 [<7f8ff624>] (xhci_suspend+0x168/0x410 [xhci_hcd]) from [<7f8ff8f0>] (hiusb_xhci_hcd_drv_suspend+0x24/0x38 [xhci_hcd]) [<7f8ff8f0>] (hiusb_xhci_hcd_drv_suspend+0x24/0x38 [xhci_hcd]) from [<80352ff8>] (platform_pm_suspend+0x3c/0x64) [<80352ff8>] (platform_pm_suspend+0x3c/0x64) from [<80358538>] (dpm_run_callback+0x28/0x58) [<80358538>] (dpm_run_callback+0x28/0x58) from [<80358c98>] (__device_suspend+0x140/0x30c) [<80358c98>] (__device_suspend+0x140/0x30c) from [<80359244>] (dpm_suspend+0x70/0x21c) [<80359244>] (dpm_suspend+0x70/0x21c) from [<8035945c>] (dpm_suspend_start+0x6c/0x70) [<8035945c>] (dpm_suspend_start+0x6c/0x70) from [<8006c304>] (suspend_devices_and_enter+0x80/0x3f8) [<8006c304>] (suspend_devices_and_enter+0x80/0x3f8) from [<8006c858>] (pm_suspend+0x1dc/0x23c) [<8006c858>] (pm_suspend+0x1dc/0x23c) from [<8006b498>] (state_store+0xa4/0x134) [<8006b498>] (state_store+0xa4/0x134) from [<802fbc2c>] (kobj_attr_store+0x20/0x24) [<802fbc2c>] (kobj_attr_store+0x20/0x24) from [<8016ebe4>] (sysfs_write_file+0x10c/0x18c) [<8016ebe4>] (sysfs_write_file+0x10c/0x18c) from [<80104994>] (vfs_write+0xd4/0x1a0) [<80104994>] (vfs_write+0xd4/0x1a0) from [<80104b4c>] (SyS_write+0x54/0x80) [<80104b4c>] (SyS_write+0x54/0x80) from [<80015100>] (ret_fast_syscall+0x0/0x30) Code: e30c0fb0 e59f12a8 e3470f90 e300234e (e5965018) ---[ end trace 719c467f2461e924 ]--- > -----Original Message----- > From: Lu Baolu [mailto:baolu.lu@xxxxxxxxxxxxxxx] > Sent: Thursday, March 24, 2016 10:37 AM > To: Lipengcheng; Mathias Nyman; gregkh@xxxxxxxxxxxxxxxxxxx > Cc: stern@xxxxxxxxxxxxxxxxxxx; balbi@xxxxxx; chasemetzger15@xxxxxxxxx; mjg59@xxxxxxxxxx; kborer@xxxxxxxxx; jun.li@xxxxxxxxxxxxx; > Robert.Schlabbach@xxxxxxx; linux-usb@xxxxxxxxxxxxxxx > Subject: Re: 答复: 答复: 答复: 答复: 【xhci】suspend and resume core dump problem > > Hi, > > On 03/23/2016 11:38 AM, Lipengcheng wrote: > >> It looks like a wild pointer exists after xhci_mem_cleanup() is called. > >> >Let me try to reproduce it and seek for a fix. > > > > Hi, > > Thanks very much. > > The kernel is 3.10 and is inevitable emergence. The kernel 3.18 is accidental, but I don't know the reason. > > > > Operation steps: > > > > usb usb1: root hub lost power or was reset usb usb2: root hub lost > > power or was reset usb usb3: root hub lost power or was reset usb > > usb4: root hub lost power or was reset usb 1-2: reset high-speed USB > > device number 2 using hiusb-ehci > > ^Cusb usb5: root hub lost power or was reset <-press ctrl +c and the problem will happen > > usb usb6: root hub lost power or was reset > > Can you please test below change? It doesn't fix your dma_alloc_coherent() failure issue. It is supposed to fix the core dump issue when > dma_alloc_coherent() fails in xhci_mem_init(). > > diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 80c1de2..53fe4ad 100644 > --- a/drivers/usb/host/xhci-mem.c > +++ b/drivers/usb/host/xhci-mem.c > @@ -1860,6 +1860,11 @@ no_bw: > kfree(xhci->port_array); > kfree(xhci->rh_bw); > kfree(xhci->ext_caps); > + xhci->usb2_ports = NULL; > + xhci->usb3_ports = NULL; > + xhci->port_array = NULL; > + xhci->rh_bw = NULL; > + xhci->ext_caps = NULL; > > xhci->page_size = 0; > xhci->page_shift = 0; > > Best regards, > Baolu > > > Thanks, > > Pengcheng Li ��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥