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 <fml@rock-chips.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
This commit is contained in:
Feng Mingli
2015-12-11 14:09:51 +08:00
committed by Tao Huang
parent 677495f54c
commit 39415217b3

View File

@@ -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]->