I've found trying to boot Linus' HEAD today on HiKey, I'm hitting the following WARNINGS/panics, which I bisected down to being introduced with 5f54c54b0ba8 ("Add DDMA chain pointers to dwc2_hsotg_ep structure"). It seems the issue is calling dma_alloc_coherent() in dwc2_hsotg_ep_enable() isn't safe, as we may get there from irq context with irqs off. Any thoughts on a fix? thanks -john [ 9.422185] dwc2 f72c0000.usb: new address 27 [ 9.445030] configfs-gadget gadget: high-speed config #1: b [ 9.450692] ------------[ cut here ]------------ [ 9.455343] WARNING: CPU: 0 PID: 0 at kernel/smp.c:405 smp_call_function_many+0xe0/0x2d8 [ 9.463436] [ 9.464930] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.9.0-06762-g50c812c-dirty #1739 [ 9.474076] Hardware name: HiKey Development Board (DT) [ 9.479307] task: ffffff8008d17080 task.stack: ffffff8008d00000 [ 9.485232] PC is at smp_call_function_many+0xe0/0x2d8 [ 9.490372] LR is at smp_call_function_many+0x30/0x2d8 [ 9.495511] pc : [<ffffff80081281d0>] lr : [<ffffff8008128120>] pstate: 600001c5 [ 9.502907] sp : ffffffc077f29610 [ 9.506220] x29: ffffffc077f29610 x28: 0000000000000004 [ 9.511547] x27: ffffff8008d08000 x26: ffffff8008d8c880 [ 9.516868] x25: ffffff80081659f8 x24: 0000000000000001 [ 9.522191] x23: 0000000000000001 x22: ffffff8008d8c880 [ 9.527511] x21: ffffff80081659f8 x20: 0000000000000000 [ 9.532833] x19: ffffff8008db19c8 x18: 0000000000000010 [ 9.538155] x17: 0000000000000000 x16: 0000000000000000 [ 9.543474] x15: ffffff8088d9e367 x14: 0000000000000006 [ 9.548797] x13: 00000000ce248c14 x12: 0000000008ca90e4 [ 9.554118] x11: 0000000000000001 x10: ffffffbf01e43820 [ 9.559440] x9 : 0000000000000800 x8 : ffffffbf01e01820 [ 9.564763] x7 : ffffff8008d8cb58 x6 : 0000000000000000 [ 9.570083] x5 : ffffffffffffff00 x4 : 0000000000000040 [ 9.575406] x3 : 0000000000000001 x2 : 0000000000010104 [ 9.580727] x1 : 0000000000000001 x0 : ffffff8008d2b3e2 [ 9.586049] [ 9.587537] ---[ end trace aa3428adcdcb3db1 ]--- [ 9.592152] Call trace: [ 9.594599] Exception stack(0xffffffc077f29440 to 0xffffffc077f29570) [ 9.601041] 9440: ffffff8008db19c8 0000008000000000 ffffffc077f29610 ffffff80081281d0 [ 9.608873] 9460: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 9.616705] 9480: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 9.624536] 94a0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 9.632367] 94c0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 9.640197] 94e0: ffffff8008d2b3e2 0000000000000001 0000000000010104 0000000000000001 [ 9.648028] 9500: 0000000000000040 ffffffffffffff00 0000000000000000 ffffff8008d8cb58 [ 9.655860] 9520: ffffffbf01e01820 0000000000000800 ffffffbf01e43820 0000000000000001 [ 9.663692] 9540: 0000000008ca90e4 00000000ce248c14 0000000000000006 ffffff8088d9e367 [ 9.671523] 9560: 0000000000000000 0000000000000000 [ 9.676406] [<ffffff80081281d0>] smp_call_function_many+0xe0/0x2d8 [ 9.682589] [<ffffff8008128538>] on_each_cpu_mask+0x48/0xd8 [ 9.688166] [<ffffff8008166714>] drain_all_pages+0xf4/0x110 [ 9.693741] [<ffffff80081cc6d4>] start_isolate_page_range+0x7c/0x1f8 [ 9.700095] [<ffffff8008169978>] alloc_contig_range+0xc0/0x340 [ 9.705927] [<ffffff80081cccd8>] cma_alloc+0xf8/0x1f8 [ 9.710982] [<ffffff8008597f04>] dma_alloc_from_contiguous+0x3c/0x48 [ 9.717340] [<ffffff8008092b2c>] __dma_alloc+0xb4/0x280 [ 9.722567] [<ffffff80086871f8>] dwc2_hsotg_ep_enable+0xe0/0x498 [ 9.728575] [<ffffff80086ae200>] usb_ep_enable+0x30/0x48 [ 9.733887] [<ffffff80086b6b68>] ffs_func_set_alt+0x150/0x2a0 [ 9.739635] [<ffffff80086a950c>] composite_setup+0xc54/0x17b8 [ 9.745381] [<ffffff8008688284>] dwc2_hsotg_complete_setup+0xbc/0x418 [ 9.751821] [<ffffff80086ae9a0>] usb_gadget_giveback_request+0x10/0x18 [ 9.758347] [<ffffff8008686f34>] dwc2_hsotg_complete_request+0x74/0x120 [ 9.764961] [<ffffff8008687fa0>] dwc2_hsotg_handle_outdone+0xf0/0x1c8 [ 9.771401] [<ffffff8008689094>] dwc2_hsotg_epint+0x51c/0x6b0 [ 9.777145] [<ffffff80086898a8>] dwc2_hsotg_irq+0x360/0x740 [ 9.782718] [<ffffff8008101c44>] __handle_irq_event_percpu+0x9c/0x128 [ 9.789157] [<ffffff8008101cec>] handle_irq_event_percpu+0x1c/0x58 [ 9.795336] [<ffffff8008101d70>] handle_irq_event+0x48/0x78 [ 9.800910] [<ffffff8008105974>] handle_fasteoi_irq+0xd4/0x1d8 [ 9.806744] [<ffffff8008101210>] generic_handle_irq+0x28/0x40 [ 9.812490] [<ffffff80081012ac>] __handle_domain_irq+0x84/0xf8 [ 9.818324] [<ffffff80080814bc>] gic_handle_irq+0x54/0xa8 ... [ 10.057181] BUG: scheduling while atomic: swapper/0/0/0x00010104 [ 10.063213] Preemption disabled at:[ 10.065319] healthd: wakealarm_init: timerfd_create failed [ 10.068603] healthd: No battery devices found [ 10.076392] [<ffffff8008a1497c>] schedule_preempt_disabled+0x1c/0x28 [ 10.082771] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.9.0-06762-g50c812c-dirty #1739 [ 10.091903] Hardware name: HiKey Development Board (DT) [ 10.097124] Call trace: [ 10.099574] [<ffffff8008087c28>] dump_backtrace+0x0/0x1a0 [ 10.104970] [<ffffff8008087ddc>] show_stack+0x14/0x20 [ 10.110021] [<ffffff80084392f0>] dump_stack+0x90/0xb0 [ 10.115071] [<ffffff80080d8ed4>] __schedule_bug+0x6c/0xb8 [ 10.120466] [<ffffff8008a14730>] __schedule+0x4f8/0x5b0 [ 10.125688] [<ffffff8008a148f8>] schedule+0x38/0xa0 [ 10.130563] [<ffffff8008a18284>] schedule_timeout+0x1b4/0x248 [ 10.136306] [<ffffff8008a155bc>] wait_for_common+0xac/0x150 [ 10.141874] [<ffffff8008a15784>] wait_for_completion+0x14/0x20 [ 10.147706] [<ffffff80080ce018>] flush_work+0xc8/0x178 [ 10.152843] [<ffffff800816f35c>] lru_add_drain_all+0x13c/0x190 [ 10.158677] [<ffffff80081b9344>] migrate_prep+0xc/0x18 [ 10.163814] [<ffffff80081699a4>] alloc_contig_range+0xec/0x340 [ 10.169647] [<ffffff80081cccd8>] cma_alloc+0xf8/0x1f8 [ 10.174698] [<ffffff8008597f04>] dma_alloc_from_contiguous+0x3c/0x48 [ 10.181052] [<ffffff8008092b2c>] __dma_alloc+0xb4/0x280 [ 10.186277] [<ffffff80086871f8>] dwc2_hsotg_ep_enable+0xe0/0x498 [ 10.192284] [<ffffff80086ae200>] usb_ep_enable+0x30/0x48 [ 10.197594] [<ffffff80086b6b68>] ffs_func_set_alt+0x150/0x2a0 [ 10.203340] [<ffffff80086a950c>] composite_setup+0xc54/0x17b8 [ 10.209082] [<ffffff8008688284>] dwc2_hsotg_complete_setup+0xbc/0x418 [ 10.215522] [<ffffff80086ae9a0>] usb_gadget_giveback_request+0x10/0x18 [ 10.222047] [<ffffff8008686f34>] dwc2_hsotg_complete_request+0x74/0x120 [ 10.228659] [<ffffff8008687fa0>] dwc2_hsotg_handle_outdone+0xf0/0x1c8 [ 10.235096] [<ffffff8008689094>] dwc2_hsotg_epint+0x51c/0x6b0 [ 10.240839] [<ffffff80086898a8>] dwc2_hsotg_irq+0x360/0x740 [ 10.246411] [<ffffff8008101c44>] __handle_irq_event_percpu+0x9c/0x128 [ 10.252848] [<ffffff8008101cec>] handle_irq_event_percpu+0x1c/0x58 [ 10.259026] [<ffffff8008101d70>] handle_irq_event+0x48/0x78 [ 10.264596] [<ffffff8008105974>] handle_fasteoi_irq+0xd4/0x1d8 [ 10.270426] [<ffffff8008101210>] generic_handle_irq+0x28/0x40 [ 10.276169] [<ffffff80081012ac>] __handle_domain_irq+0x84/0xf8 [ 10.281999] [<ffffff80080814bc>] gic_handle_irq+0x54/0xa8 ... [ 10.988515] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 10.996614] pgd = ffffff8008df3000 [ 11.000013] [00000000] *pgd=0000000077ffe003[ 11.004105] , *pud=0000000077ffe003 , *pmd=0000000000000000[ 11.009592] [ 11.011082] Internal error: Oops: 86000005 [#1] PREEMPT SMP [ 11.016655] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W 4.9.0-06762-g50c812c-dirty #1739 [ 11.025959] Hardware name: HiKey Development Board (DT) [ 11.031190] Workqueue: lru-add-drain wq_barrier_func [ 11.036155] task: ffffffc0387e2580 task.stack: ffffffc005f50000 [ 11.042069] PC is at 0x0 [ 11.044600] LR is at activate_task+0x5c/0xa0 [ 11.048865] pc : [<0000000000000000>] lr : [<ffffff80080da5ec>] pstate: 200001c5 [ 11.056256] sp : ffffffc005f53c40 [ 11.059565] x29: ffffffc005f53c40 x28: ffffffc077f302a8 [ 11.064881] x27: 0000000000000000 x26: ffffff8008ce3000 [ 11.070197] x25: ffffff8008d088d0 x24: ffffffc077f30800 [ 11.075512] x23: 0000000000000001 x22: 0000000000000001 [ 11.080828] x21: 0000000000000000 x20: ffffffc077f30800 [ 11.086143] x19: ffffffc077f30800 x18: 0000000000000010 [ 11.091458] x17: 0000000000000000 x16: 000000000000014c [ 11.096774] x15: ffffff8088d9e367 x14: 0000000000000006 [ 11.102090] x13: ffffff8008d9e375 x12: 0000000000000028 [ 11.107405] x11: 0000000000000028 x10: 00000000ffffffff [ 11.112721] x9 : ffffffc077f32b00 x8 : ffffff8008d8c880 [ 11.118036] x7 : ffffffc071a7f871 x6 : 000000000000126e [ 11.123351] x5 : 0000000000000015 x4 : 0000000000051d68 [ 11.128667] x3 : 0000000000000000 x2 : 0000000000000001 [ 11.133983] x1 : ffffff8008d17080 x0 : ffffffc077f30800 [ 11.139298] [ 11.140783] Process kworker/0:0 (pid: 4, stack limit = 0xffffffc005f50020) ... [ 11.388211] Call trace: [ 11.475359] [< (null)>] (null) [ 11.480059] [<ffffff80080da89c>] ttwu_do_activate+0x4c/0x88 [ 11.485629] [<ffffff80080db604>] try_to_wake_up+0x194/0x2f8 [ 11.491199] [<ffffff80080dd6e8>] default_wake_function+0x10/0x18 [ 11.497204] [<ffffff80080f2eb4>] __wake_up_common+0x5c/0xa0 [ 11.502775] [<ffffff80080f31e4>] __wake_up_locked+0x14/0x20 [ 11.508343] [<ffffff80080f3a60>] complete+0x40/0x60 [ 11.513218] [<ffffff80080cb328>] wq_barrier_func+0x10/0x18 [ 11.518701] [<ffffff80080ccdc8>] process_one_work+0x118/0x370 [ 11.524443] [<ffffff80080cd274>] worker_thread+0x254/0x498 [ 11.529925] [<ffffff80080d2f50>] kthread+0x100/0x130 [ 11.534888] [<ffffff8008082e80>] ret_from_fork+0x10/0x50 [ 11.540197] Code: bad PC value -- 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