linux/drivers/usb/dwc3
Felipe Balbi fca8892ae5 usb: dwc3: ep0: move DATA phase away from on-demand
We uncovered a limitation of this core WRT to the
Link Layer Compliance Suite's TD7.06.

On that test, host will start a GetDescriptor(DEVICE)
standard request, but it will do so only on the
SETUP phase, meaning there will *NOT* be any DATA or
STATUS phases.

The idea of the test is to verify robustness of the
IP WRT framing errors, so the test will send a
sequence of different SETUP_DPs each with a different
framing error and the Suite expects us to be able to
receive all SETUP_DPs with no timeouts.

This core, has the ability to tell us which phase the
host is expecting before we start it. Whenever we
receive a TP or DP when no transfers are cached on
the internal IP's caches, the IP will generate a
XferNotReady event with status informing us (in case
of physical ep0/ep1) if it's related to DATA or STATUS
phases - SETUP phase is expected to be prestarted.

Because we're always waiting for XferNotReady
events for DATA and STATUS phases, we will never
be able to know that the Host wants to start another
SETUP phase instead, which will render us "not
compliant" with TD7.06.

In order to "fix" the problem we must not rely
on XferNotReady events for the DATA phase  and try
to always pre-start DATA transfers on physical
endpoints 0 and 1. If host goes back to SETUP phase
from DATA phase we will receive a XferComplete for
that phase with TRB's status set to SETUP_PENDING,
which is only useful for printing a debugging log as
the core expects us to still go through to the STATUS
phase, initiate a CONTROL_STATUS TRB just so it
completes right away and, only then, we go back to
the pending SETUP phase.

SNPS has decided to modify the programming model of
the core so that on-demand DATA phases will not be
supported anymore. Note that this limitation does not
affect 2-stage transfers, meaning that if TD7.06 would
start a 2-stage transfer instead of a 3-stage transfer,
we would receive a "fake" XferNotReady(STATUS) which
would complete right after being initiated with
SETUP_PENDING status.

Other endpoints are also not affected, so we can still
use on-demand transfers on Bulk/Isoc/Interrupt endpoints.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-03 09:28:26 +03:00
..
core.c USB: DWC3: Issue device soft reset before core soft reset 2012-06-22 13:22:46 +03:00
core.h usb: dwc3: ep0: drop dead code 2012-08-03 09:28:25 +03:00
debug.h usb: dwc: remove "All rights reserved" statement. 2011-10-04 10:25:52 -07:00
debugfs.c usb: dwc3: debugfs: fix off by one when entering testmode 2012-02-10 12:14:53 +02:00
dwc3-exynos.c usb: dwc3: Remove duplicate header file inclusion 2012-06-22 13:21:43 +03:00
dwc3-omap.c usb: dwc3: omap: add dwc3_omap_readl/writel functions 2012-04-24 15:37:01 +03:00
dwc3-pci.c USB merge for 3.4-rc1 2012-03-20 11:26:30 -07:00
ep0.c usb: dwc3: ep0: move DATA phase away from on-demand 2012-08-03 09:28:26 +03:00
gadget.c usb: dwc3: gadget: set Ignore Sequence Number bit from ConnectDone Event 2012-08-03 09:28:22 +03:00
gadget.h usb: dwc3: correct set_halt implementation for ep0 2012-07-02 10:02:07 +03:00
host.c usb: dwc3: core: split host address space 2012-04-24 15:37:04 +03:00
io.h usb: dwc3: core: split host address space 2012-04-24 15:37:04 +03:00
Kconfig usb: dwc3: Fix the dwc3 dependency 2012-05-11 15:17:31 -07:00
Makefile usb: dwc3: Add Exynos Specific Glue layer 2012-03-02 12:11:28 +02:00