USB: arc otg device controller driver, spinlock problem with linux real time kernel

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB: arc otg device controller driver, spinlock problem with linux real time kernel

1,783 Views
rdittrich
Contributor I
Hello,

I have the following problem. I'm currently working on a Bluetechnix development board with an i.MX31 controller on it and using MontaVista Mobilinux 5.0.0 (2.6.21 rt). I wanted to the test usb mass storage gadet
 by doing the following:
First, I modprobed the corresponding drivers:
 modprobe isp1504_arc
 modprobe g_file_storage file=myfile.
Note: The error does only occur when the kernel runs in real time mode - I turned on 'Complete Preemption'.
After connecting a Mini-B-to-A cable between my board and my PC the driver crashes (I've attached the error output into a file). Then I stepped through the kernel sources, especially through arcotg_udc.c, which comes from Freescale, as it seems that the error occurs there. I noticed that a critical section is sometime locked twice, using spin_lock_irqsave(...), e.g.: when an interrupt is raised then arcotg_udc_poll(...) function is called which first locks a section with spin_lock_irqsave(&udc->lock) and within this section it might implicitly call in a sub-function arcotg_rp_queue(...) which also locks a critical section using the same mutex as above in spin_lock_irqsave(&udc->lock).  I do not really understand this, as I'm not an expert in this area. So could you please explain it to me.

Best regards,

Rudolf Dittrich
0 Kudos
Reply
1 Reply

606 Views
fabio_estevam
NXP Employee
NXP Employee
Rudolf,
 
I am not familiar with MontaVista's BSP, but on Freescale's BSP in order to get OTG functionality we need to load the drivers in the following order:
 
modprobe isp1504_arc

modprobe ehci-hcd

modprobe g_file_storage file=/dev/ram/0

Can you try load ehci-hcd module?

Regards,

Fabio Estevam

 

0 Kudos
Reply