From 39415217b34119ae7ea2ac5a36aa67d691e251c9 Mon Sep 17 00:00:00 2001 From: Feng Mingli Date: Fri, 11 Dec 2015 14:09:51 +0800 Subject: [PATCH] usb: dwc_otg_310: pcd: fix ep stop transfer bug When dequeue a transfer request, dwc_otg_310 pcd driver will call dwc_otg_pcd_ep_stop_transfer() function, it set the whole depctl register value to 0. But actually it should only set nak and disable ep, and do not change ep type or mps information and so on, because these information should only be setted by ep_enable() or ep_disable() functions. If clear the whole depctl register in dwc_otg_pcd_ep_stop_transfer, it will cause the current transfer failed during dequeue. TEST: set usb gadget work as mtp mode, copy data from the PC to the device, cancel it, and copy again. If don't use this patch, the mtp driver will block in mtp_read until we're online. Change-Id: I5fb6c1645c24eb69b339488f8f613e19af1933d0 Signed-off-by: Feng Mingli Signed-off-by: Wu Liang feng --- drivers/usb/dwc_otg_310/dwc_otg_pcd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/dwc_otg_310/dwc_otg_pcd.c b/drivers/usb/dwc_otg_310/dwc_otg_pcd.c index 884b77f666f5..9a25c58112b6 100644 --- a/drivers/usb/dwc_otg_310/dwc_otg_pcd.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_pcd.c @@ -1763,7 +1763,6 @@ static void dwc_otg_pcd_ep_stop_transfer(dwc_otg_core_if_t diepint, diepint.d32); } - depctl.d32 = 0; depctl.b.epdis = 1; DWC_WRITE_REG32(&core_if->dev_if-> in_ep_regs[ep->num]->diepctl, @@ -1805,7 +1804,6 @@ static void dwc_otg_pcd_ep_stop_transfer(dwc_otg_core_if_t ->gintsts, gintsts.d32); } - depctl.d32 = 0; depctl.b.epdis = 1; depctl.b.snak = 1; DWC_WRITE_REG32(&core_if->dev_if->out_ep_regs[ep->num]->