Skip to content

Commit

Permalink
usb: dwc2: Don't program DMA address for 0 length request
Browse files Browse the repository at this point in the history
Check the request length in dwc2_hsotg_start_req() function. If
length == 0, do not write DMA address to control register.

Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Razmik Karapetyan authored and Felipe Balbi committed Nov 18, 2016
1 parent 9d8da85 commit 729e657
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/dwc2/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ static void dwc2_hsotg_start_req(struct dwc2_hsotg *hsotg,
/* write size / packets */
dwc2_writel(epsize, hsotg->regs + epsize_reg);

if (using_dma(hsotg) && !continuing) {
if (using_dma(hsotg) && !continuing && (length != 0)) {
/*
* write DMA address to control register, buffer
* already synced by dwc2_hsotg_ep_queue().
Expand Down

0 comments on commit 729e657

Please sign in to comment.