linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible usb_request leak  in the function dwc2_gadget_complete_isoc_request_ddma
@ 2018-02-28  9:00 Zengtao (B)
  2018-02-28 10:27 ` Minas Harutyunyan
  0 siblings, 1 reply; 7+ messages in thread
From: Zengtao (B) @ 2018-02-28  9:00 UTC (permalink / raw)
  To: johnyoun; +Cc: gregkh, linux-usb, linux-kernel

Hi johnyoun:

I found a suspected bug, and I am writing to confirm with you.

In the function dwc2_gadget_complete_isoc_request_ddma(drivers/usb/dwc2/gadget.c).
Only the first request from the eq queue is processed while maybe there are more than one descriptors done by the HW.

1. Each usb request is associated with a DMA descriptor, but this is not reflect in the driver, so when one DMA descriptor is done, 
we don't know which usb request is done, but I think if only one DMA descriptor is done, we can know that the first USB request in 
eq queue is done, because the HW DMA descriptor and SW usb request are both in sequence.

2. In the function dwc2_gadget_complete_isoc_request_ddma, we may complete more than one DMA descriptor but only the first
Usb request is processed, but in fact, we should all the usb requests associated with all the done DMA descriptors.

3. I noticed that each DMA descriptor is configured to report an interrupt, and if each DMA descriptor generate an interrupt, the above
Flow should be ok, but the interrupts can merge and we have used the depdma to figure out the largest finished DMA descriptor index.

Looking forward your reply.

Thank you. 

Regards
Zengtao 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-16  8:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28  9:00 Possible usb_request leak in the function dwc2_gadget_complete_isoc_request_ddma Zengtao (B)
2018-02-28 10:27 ` Minas Harutyunyan
2018-03-02  1:48   ` 答复: " Zengtao (B)
2018-03-02 10:10     ` Minas Harutyunyan
2018-03-02 10:26       ` Minas Harutyunyan
2018-03-07  3:38         ` 答复: " Zengtao (B)
2018-03-16  8:18           ` Minas Harutyunyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).