linux-imx/drivers/usb/chipidea
Xu Yang 2ffc90eb9e LF-12220 usb: chipidea: udc: disable sg_support for uvc and enable it dynamically
The UVC rev1.5 spec has requirements with data payload as below, take HS
Isoc transfer as example (2.4.3.2.2 Sample Isochronous Transfers):

+-----+ +----+ +---+-------+ +----+ +-------+ +----+ +-------+ +-----+
| SOF | | IN | | H | DATA2 | | IN | | DATA1 | | IN | | DATA0 | | SOF |
+-----+ +----+ +---+-------+ +----+ +-------+ +----+ +-------+ +-----+
                 \
                  Payload Header (8 bytes)

Three DATA packets need to be sent to the USB bus within 1 micro-frame.

However, the start address of payload header and DATA2 passed from uvc
layer may be not 4K page-aligned when using scatterlist.

The sgs may have below formats:
sgs:
 - sg[0]: 8 bytes (payload header)
 - sg[1]: 3064 bytes (payload)

In this case, the udc needs 2 dTDs to send data out. However, the packets
on USB bus will show as:

+-----+ +----+ +---+ +-----+ +----+ +-------+ +----+ +-------+ +----+ +-------+ +-----+
| SOF | | IN | | H | | SOF | | IN | | DATA2 | | IN | | DATA1 | | IN | | DATA0 | | SOF |
+-----+ +----+ +---+ +-----+ +----+ +-------+ +----+ +-------+ +----+ +-------+ +-----+
                 \
                  Payload Header (8 bytes)

This behavior is unexpected since the host will not recognize uvc data
correctly. The root cause should be dTD doesn't support scatterlist very
well. Such as (1) doesn't support one DATA packet span two or more dTD
(2) doesn't support specify offset for page1-4.

So in order for uvc gadget works properly, disable sg_support when it has
uvc function, or else enable it.

Note: most of the functions use sg_support after bind stage, except uvc
      which uses sg_support when call bind(), so if a function in future
      also uses sg_support when call bind(), it will be limited to non-sg
      way.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-05-08 11:14:12 +08:00
..
bits.h MLK-22025-1 usb: chipidea: phy enter low power mode when host suspend 2023-10-30 16:19:11 +08:00
ci_hdrc_imx.c LF-10575-2 usb: chipidea: ci_hdrc_imx: add wakeup irq handling 2023-11-20 22:14:10 +08:00
ci_hdrc_imx.h usb: chipidea: imx: add one fsl picophy parameter tuning implementation 2023-07-25 18:21:52 +02:00
ci_hdrc_msm.c usb: chipidea/ci_hdrc_msm: Convert to platform remove callback returning void 2023-05-28 12:36:15 +01:00
ci_hdrc_pci.c usb: chipidea: ci_hdrc_pci: Fix improper use of kerneldoc format 2020-07-09 17:19:56 +02:00
ci_hdrc_tegra.c usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
ci_hdrc_usb2.c usb: chipidea/ci_hdrc_usb2: Convert to platform remove callback returning void 2023-05-28 12:36:15 +01:00
ci.h usb: chipidea: core: handle power lost in workqueue 2024-01-29 11:50:32 +08:00
core.c usb: chipidea: core: handle power lost in workqueue 2024-01-29 11:50:32 +08:00
debug.c usb: chipidea: debug: remove redundant 'role' debug file 2023-03-23 17:27:46 +01:00
host.c Merge tag 'v6.6.2' into lf-6.6.y 2023-11-30 09:40:58 -06:00
host.h usb: chipidea: add inline for ci_hdrc_host_driver_init if host is not defined 2020-01-22 07:54:27 +01:00
Kconfig usb: chipidea: make configs for glue drivers visible with EXPERT 2022-09-08 13:32:50 +02:00
Makefile usb: chipidea: imx: avoid unnecessary probe defer 2023-04-05 19:16:59 +02:00
otg_fsm.c usb: chipidea: fix deadlock in ci_otg_del_timer 2022-11-09 12:34:18 +01:00
otg_fsm.h USB: chipidea: Use the correct style for SPDX License Identifier 2020-03-16 11:13:47 +08:00
otg.c usb: chipidea: core: fix possible concurrent when switch role 2023-03-23 18:17:32 +01:00
otg.h usb: chipidea: core: add controller resume support when controller is powered off 2022-10-23 14:34:53 +02:00
trace.c usb: chipidea: add tracepoint support for udc 2020-12-10 08:45:26 +08:00
trace.h usb: chipidea: tracing: Use the new __vstring() helper 2022-07-15 17:44:40 -04:00
udc.c LF-12220 usb: chipidea: udc: disable sg_support for uvc and enable it dynamically 2024-05-08 11:14:12 +08:00
udc.h usb: chipidea: udc: add software sg list support 2020-05-06 09:42:35 +08:00
ulpi.c usb: chipidea: Always build ULPI code 2018-07-05 14:22:47 +08:00
usbmisc_imx.c LF-10575-3 usb: chipidea: imx: add HSIO blkctl wakup handling 2023-11-20 22:14:19 +08:00