AnsweredAssumed Answered

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

Question asked by Rudolf Dittrich on Oct 7, 2008
Latest reply on Oct 29, 2008 by Fabio Estevam
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

Outcomes