Hi All, I am working on linux kernel 3.4. we have added suspend / resume functionality for USB XHCI stack. But during xhci_resume() i get crash prints as below and USB 3.0 port becomes dead after that. 55.611666] __dma_free_remap: trying to free invalid coherent area: f0012000 [ 55.618694] [<80015f54>] (unwind_backtrace+0x0/0x128) from [<804f5554>] (dump_stack+0x20/0x24) [ 55.627287] [<804f5554>] (dump_stack+0x20/0x24) from [<8001a4e4>] (arm_dma_free+0x98/0xe8) [ 55.635541] [<8001a4e4>] (arm_dma_free+0x98/0xe8) from [<800e2ee8>] (pool_free_page+0x5c/0x90) [ 55.644126] [<800e2ee8>] (pool_free_page+0x5c/0x90) from [<800e2f94>] (dma_pool_destroy+0x78/0xa0) [ 55.653155] [<800e2f94>] (dma_pool_destroy+0x78/0xa0) from [<80321c98>] (xhci_mem_cleanup+0xd0/0x3b0) [ 55.662268] [<80321c98>] (xhci_mem_cleanup+0xd0/0x3b0) from [<8031c410>] (xhci_resume+0x24c/0x304) [ 55.671208] [<8031c410>] (xhci_resume+0x24c/0x304) from [<8032831c>] (xhci_plat_resume+0x44/0x58) [ 55.680067] [<8032831c>] (xhci_plat_resume+0x44/0x58) from [<802b6258>] (platform_pm_resume+0x50/0x64) [ 55.689350] [<802b6258>] (platform_pm_resume+0x50/0x64) from [<802bb0bc>] (dpm_run_callback+0x54/0x8c) [ 55.698642] [<802bb0bc>] (dpm_run_callback+0x54/0x8c) from [<802bbc84>] (device_resume+0x150/0x1ac) [ 55.707663] [<802bbc84>] (device_resume+0x150/0x1ac) from [<802bc63c>] (dpm_resume+0x108/0x240) [ 55.716343] [<802bc63c>] (dpm_resume+0x108/0x240) from [<802bc954>] (dpm_resume_end+0x1c/0x28) [ 55.724942] [<802bc954>] (dpm_resume_end+0x1c/0x28) from [<800614a0>] (suspend_devices_and_enter+0x284/0x330) [ 55.734832] [<800614a0>] (suspend_devices_and_enter+0x284/0x330) from [<800616a0>] (pm_suspend+0x154/0x228) [ 55.744560] [<800616a0>] (pm_suspend+0x154/0x228) from [<8006064c>] (state_store+0xa0/0xc8) [ 55.752967] [<8006064c>] (state_store+0xa0/0xc8) from [<802117ec>] (kobj_attr_store+0x1c/0x28) [ 55.761480] [<802117ec>] (kobj_attr_store+0x1c/0x28) from [<80141b9c>] (sysfs_write_file+0x118/0x14c) [ 55.770685] [<80141b9c>] (sysfs_write_file+0x118/0x14c) from [<800eb010>] (vfs_write+0xc4/0x140) [ 55.779446] [<800eb010>] (vfs_write+0xc4/0x140) from [<800eb28c>] (sys_write+0x4c/0x78) [ 55.787432] [<800eb28c>] (sys_write+0x4c/0x78) from [<8000e7c0>] (ret_fast_syscall+0x0/0x30) Have i missed anything...please help. please find the patch attached for Suspend/Resume. Just for experimental purpose, I tried calling xhci_mem_cleanup() just at the end of xhci_mem_init() but stangely there also i get error.. 4.897143] [<803218b8>] (xhci_mem_cleanup+0x250/0x2f4) from [<803223d4>] (xhci_mem_init+0xa78/0xad8) [ 4.906342] [<803223d4>] (xhci_mem_init+0xa78/0xad8) from [<8031b770>] (xhci_init+0x58/0x64) [ 4.914761] [<8031b770>] (xhci_init+0x58/0x64) from [<8031f514>] (xhci_gen_setup+0x244/0x26c) [ 4.923267] [<8031f514>] (xhci_gen_setup+0x244/0x26c) from [<80327d90>] (xhci_plat_setup+0x1c/0x24) [ 4.932295] [<80327d90>] (xhci_plat_setup+0x1c/0x24) from [<802f9ed8>] (usb_add_hcd+0x1c8/0x64c) [ 4.941061] [<802f9ed8>] (usb_add_hcd+0x1c8/0x64c) from [<80327cb4>] (xhci_plat_probe+0x12c/0x1ec) [ 4.950002] [<80327cb4>] (xhci_plat_probe+0x12c/0x1ec) from [<802b614c>] (platform_drv_probe+0x24/0x28) [ 4.959377] [<802b614c>] (platform_drv_probe+0x24/0x28) from [<802b4b14>] (driver_probe_device+0x158/0x370) [ 4.969097] [<802b4b14>] (driver_probe_device+0x158/0x370) from [<802b4d9c>] (__driver_attach+0x70/0x94) [ 4.978559] [<802b4d9c>] (__driver_attach+0x70/0x94) from [<802b2ea4>] (bus_for_each_dev+0x60/0x9c) [ 4.987586] [<802b2ea4>] (bus_for_each_dev+0x60/0x9c) from [<802b44bc>] (driver_attach+0x28/0x30) [ 4.996440] [<802b44bc>] (driver_attach+0x28/0x30) from [<802b3fdc>] (bus_add_driver+0xe4/0x268) [ 5.005207] [<802b3fdc>] (bus_add_driver+0xe4/0x268) from [<802b533c>] (driver_register+0xac/0x138) [ 5.014234] [<802b533c>] (driver_register+0xac/0x138) from [<802b6468>] (platform_driver_register+0x54/0x68) [ 5.024042] [<802b6468>] (platform_driver_register+0x54/0x68) from [<80327db4>] (xhci_register_plat+0x1c/0x24) [ 5.034024] [<80327db4>] (xhci_register_plat+0x1c/0x24) from [<8072e0a4>] (xhci_hcd_init+0x10/0x30) [ 5.043052] [<8072e0a4>] (xhci_hcd_init+0x10/0x30) from [<8000869c>] (do_one_initcall+0xa0/0x170) [ 5.051904] [<8000869c>] (do_one_initcall+0xa0/0x170) from [<80711a48>] (kernel_init+0xf8/0x1b4) [ 5.060672] [<80711a48>] (kernel_init+0xf8/0x1b4) from [<8000fa48>] (kernel_thread_exit+0x0/0x8) How i wonder where is the problem in xhci_mem_cleanup()... Regards Vikas Sajjan
Attachment:
USB_S2R.patch
Description: Binary data