RE: [PATCH v2 1/4] usb: renesas_usbhs: fix spinlock suspected in a gadget complete function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Geert-san again,

> Hi Geert-san,
> 
> Thank you for the reply again!
> 
> > Hi Shimoda-san,
> >
> > On Mon, Feb 16, 2015 at 2:52 AM, Yoshihiro Shimoda
> > <yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote:
> > > According to the gadget.h, a "complete" function will always be called
> > > with interrupts disabled. However, sometimes usbhsg_queue_pop() function
> > > is called with interrupts enabled. So, this function should calls
> > > local_irq_save() before this calls the usb_gadget_giveback_request().
> > > Otherwise, there is possible to cause a spinlock suspected in a gadget
> > > complete function.
> >
> > I still feel uneasy about adding the call to local_irq_save(), as the need for
> > this is usually an indicator of another locking problem.
> 
> I also think that I would like to avoid using local_irq_save().
> But, I have no idea to resolve this issue for now.

After I modified usb-dmac driver to use a tasklet instead of a kthread,
this issue disappeared.

My understanding is the followings:
- According to the backtrace below, during usbhsf_dma_complete() was running,
 a softirq happened. After ncm_tx_tasklet() was called, the issue happened.
http://thread.gmane.org/gmane.linux.usb.general/122023/focus=43729

- This means that usbhsf_dma_complete() ran on a kthread. So, ncm driver is able
  to do the ncm_tx_tasklet().

- After the current usb-dmac driver, since usbhsf_dma_complete() runs on a tasklet,
  ncm driver is not able to do the ncm_tx_tasklet during usbhsf_dma_complete() was running.


So, I would like to recall this patch and I will resubmit this patch series as v3.

Best regards,
Yoshihiro Shimoda

��.n��������+%������w��{.n����z�{��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux