RobertCNelson / bb-kernel

MIT License
130 stars 102 forks source link

Kernel panic when using USB isochronous DMA for v2l device #24

Closed romansavrulin closed 8 years ago

romansavrulin commented 8 years ago

I've trying to make kernel work with cppi41_dma controller.

I've succesfully built the kernel with appropriate options and dts files, USB root hubs and v4l device is correctly detected. But when I try to start capture, I getting the following kernel panic message and device halts.

dmesg says that initialisation of usb root hubs is successfull, all dma channels is acquired correctly and cppi controller seems to be OK.

reproduced on bbb and custom am3352 board, based on this module https://www.olimex.com/Products/SOM/AM3352/AM3352-SOM/

[  155.198417] Unable to handle kernel NULL pointer dereference at virtual address 0000000c     
[  155.206559] pgd = dd6f8000                                                                   
[  155.209274] [0000000c] *pgd=9d74b831, *pte=00000000, *ppte=00000000                          
[  155.215588] Internal error: Oops: 17 [#1] THUMB2                                             
[  155.220223] Modules linked in: uio_pdrv_genirq                                               
[  155.224700] CPU: 0 PID: 427 Comm: capture_arm_3.1 Not tainted 4.4.3-bone5 #11                
[  155.231862] Hardware name: Generic AM33XX (Flattened Device Tree)                            
[  155.237979] task: db8fac40 ti: db856000 task.ti: db856000                                    
[  155.243413] PC is at cppi41_dma_channel_program+0x12/0x20c                                   
[  155.248920] LR is at musb_host_rx+0x821/0x910                                                
[  155.253293] pc : [<c0311346>]    lr : [<c030c50d>]    psr: 400f01b3                          
[  155.253293] sp : db857da0  ip : c00092f7  fp : c0875eac                                      
[  155.264817] r10: dd43ce64  r9 : c07bc868  r8 : 0000e04c                                      
[  155.270059] r7 : e08fec10  r6 : c0875ea4  r5 : 00000000  r4 : dd43c010                       
[  155.276610] r3 : 9d860a80  r2 : 00000000  r1 : 00000380  r0 : 00000000                       
[  155.283165] Flags: nZcv  IRQs off  FIQs on  Mode SVC_32  ISA Thumb  Segment none             
[  155.290589] Control: 50c5387d  Table: 9d6f8019  DAC: 00000051                                
[  155.296355] Process capture_arm_3.1 (pid: 427, stack limit = 0xdb856210)                     
[  155.303082] Stack: (0xdb857da0 to 0xdb858000)                                                
[  155.307458] 7da0: dd4a4a8c c033f68b dd4a4a5c dd4a4b54 dd4a4a8c c0337995 00000004 dd4a4a8c    
[  155.315672] 7dc0: dd4a4a8c 00000001 c072e04c c0338631 00000000 dd4a4bc0 dd4a4a8c c033f937             
[  155.323886] 7de0: 00000001 dd43c010 dd79bb80 c0875ea4 e08fec10 c0311335 c07bc868 dd43ce64             
[  155.332098] 7e00: c0875eac c030c50d 00000a80 dd780840 c07991e0 00000001 00000048 00000120             
[  155.340311] 7e20: 9b9d8a3f dd648014 e08fec10 00000000 0000000d dd648000 00000a80 dd421000             
[  155.348525] 7e40: dd43c304 00000b60 9d860a80 00000000 c072e04c dd421374 c072e04c dd43ce64             
[  155.356738] 7e60: c072e04c dd43c010 e08fec10 600f0193 dd43c010 c0310e25 00000001 00000000             
[  155.364951] 7e80: 00012003 00000000 00000000 00000000 00000000 00000000 00000000 7dfc2c65             
[  155.373165] 7ea0: 00000000 dd421374 00000000 dd43ce64 c072e04c 00000000 c07bd300 600f0193             
[  155.381378] 7ec0: dd43c010 c0310ee7 00096000 00000000 00000002 00000002 00000a80 7dfc2c65             
[  155.389591] 7ee0: c07839cc 00000000 dd3c4810 00000080 c06240f8 c06240d0 00000004 000000a0             
[  155.397805] 7f00: c046e658 c027a121 dd5b5580 beed6ab0 00000003 dd3c1080 dd3c9b40 00000000             
[  155.406019] 7f20: 000000b1 dd02b000 00000000 00000000 c07af620 c0053499 db857f84 7dfc2c65             
[  155.414232] 7f40: 00000002 c07af604 dd3c1080 c07af317 00000051 dd3c1080 dd3c1090 00000000             
[  155.422445] 7f60: 00000000 dd02b000 0002a124 b6fe4000 00000000 c0053579 dd3c1080 c00552e7             
[  155.430659] 7f80: c0055289 c078c424 000000b1 c0052e79 000000b4 c0053013 b6d892be 200f0030             
[  155.438871] 7fa0: ffffffff 50c5387d 50c5387d c042d601 ffffffff 0002a124 beed6acc 00000000             
[  155.447085] 7fc0: b6e419f0 b6e41000 00000001 beed6568 b6fd94c0 0002a124 b6fe4000 00000000             
[  155.455299] 7fe0: 0003e06c beed6560 b6df4029 b6d892be 200f0030 ffffffff ffffffff ffffffff             
[  155.463524] [<c0311346>] (cppi41_dma_channel_program) from [<c030c50d>] (musb_host_rx+0x821/0x910)    
[  155.472524] [<c030c50d>] (musb_host_rx) from [<c0310e25>] (cppi41_trans_done+0x105/0x148)             
[  155.480739] [<c0310e25>] (cppi41_trans_done) from [<c0310ee7>] (cppi41_dma_callback+0x7f/0x1cc)       
[  155.489488] [<c0310ee7>] (cppi41_dma_callback) from [<c027a121>] (cppi41_irq+0xe5/0x128)              
[  155.497626] [<c027a121>] (cppi41_irq) from [<c0053499>] (handle_irq_event_percpu+0x6d/0x12c)          
[  155.506106] [<c0053499>] (handle_irq_event_percpu) from [<c0053579>] (handle_irq_event+0x21/0x2c)     
[  155.515020] [<c0053579>] (handle_irq_event) from [<c00552e7>] (handle_level_irq+0x5f/0xac)            
[  155.523323] [<c00552e7>] (handle_level_irq) from [<c0052e79>] (generic_handle_irq+0x1d/0x28)          
[  155.531800] [<c0052e79>] (generic_handle_irq) from [<c0053013>] (__handle_domain_irq+0x3b/0x80)       
[  155.540544] [<c0053013>] (__handle_domain_irq) from [<c042d601>] (__irq_usr+0x61/0x80)                
[  155.548499] Code: eb04 f24e 084c 4605 (68c0) f2cc                                                     
[  155.553310] ---[ end trace 106e3a8317d47f46 ]---                                                      
[  155.557944] Kernel panic - not syncing: Fatal exception in interrupt                                  
[  155.564325] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
RobertCNelson commented 8 years ago

Closing use:

CONFIG_MUSB_PIO_ONLY

Don't waste your time debugging this, CPPI41 is too broken to care about..

Otherwise ping ti.com directly, CPPI41 is too broken for me to care about anymore, sorry...

Regards,

romansavrulin commented 8 years ago

@RobertCNelson Thank you, I got it. I finally went into using this option.

Can you point me any contacts from TI to ask about this issue?

RobertCNelson commented 8 years ago

https://e2e.ti.com/support/arm/sitara_arm/f/791

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/usb/musb/musb_cppi41.c?id=refs/tags/v4.5-rc6

maybe Bin Liu...

Regards,