From: Frank Li <Frank.Li@nxp.com>
To: cugyly@163.com
Cc: Frank.Li@nxp.com, a-govindraju@ti.com,
gregkh@linuxfoundation.org, imx@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
pawell@cadence.com, peter.chen@kernel.org, rogerq@kernel.org
Subject: [PATCH v2 0/4] usb: cdns3: usb uvc iso transfer fix
Date: Sun, 24 Dec 2023 10:38:12 -0500 [thread overview]
Message-ID: <20231224153816.1664687-1-Frank.Li@nxp.com> (raw)
Fix UVC ISO transfer since enable sg.
The basic there are 4 major problems.
Problem 1:
Previous code have not conside sg enable case at all for ISO transfer.
A typcial UVC package is
UVC Header: 8bytes
UVC DATA: P(1K,2K... 3K) - 8
So need prepare two TRB for this TD transfer.
CHAIN TRB
DATA TRB.
Hardware will fetch it when get every SOF regardless IN token. So
driver have to dupicate it to interval.
for example, if interval is 4. driver need duplcate 4 times
[CHIAN TRB] [DATA TRB]
[CHIAN TRB] [DATA TRB]
[CHIAN TRB] [DATA TRB]
[CHIAN TRB] [DATA TRB]
Hardware have limitation, LINK have to be first one when
ISO transfer. another words, the below pattern is *invalidate*
[CHIAN TRB] [LINK TRB] [DATA TRB]
So need insert some DUMMY LINK TRB when close to end of TRB list.
Problem 2:
When mult and wMaxburst is not zero, EP hardware config need match
EP descriptor, otherwise some data will be lost. for example: if mult is 2
at EP descipor, but hardware EP_CFG is 0, only 1 package will be transfer.
If 2k data lost every 3k data.
Problem 3:
Look like hardware have not fixed cross 4k bound problem at 8QXP
for ISO transfer. If dma buffer + length cross 4k bound, DMA will fetch
wrong data
Problem 4:
Latest f_uvc.c pass full speed descriptor, so missed mult and
wMaxBurst information, so cdns3 check_config() have not reserve enough
internal FIFO memory to ISO endponit.
Linux and ardroid UVC test passed. NCM/masstorage test passed.
Change from v1 to v2.
-Add comment at f_uvc.c
Please more detail for each patches.
Frank Li (4):
usb: cdns3: fix uvc failure work since sg support enabled
usb: cdns3: fix iso transfer error when mult is not zero
usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled
Revert "usb: gadget: f_uvc: change endpoint allocation in
uvc_function_bind()"
drivers/usb/cdns3/cdns3-gadget.c | 142 +++++++++++++++++++++-------
drivers/usb/cdns3/cdns3-gadget.h | 3 +
drivers/usb/gadget/function/f_uvc.c | 18 +++-
3 files changed, 127 insertions(+), 36 deletions(-)
--
2.34.1
next reply other threads:[~2023-12-24 15:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-24 15:38 Frank Li [this message]
2023-12-24 15:38 ` [PATCH v2 1/4] usb: cdns3: fix uvc failure work since sg support enabled Frank Li
2023-12-24 15:38 ` [PATCH v2 2/4] usb: cdns3: fix iso transfer error when mult is not zero Frank Li
2023-12-24 15:38 ` [PATCH v2 3/4] usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled Frank Li
2023-12-24 15:38 ` [PATCH v2 4/4] Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()" Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231224153816.1664687-1-Frank.Li@nxp.com \
--to=frank.li@nxp.com \
--cc=a-govindraju@ti.com \
--cc=cugyly@163.com \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pawell@cadence.com \
--cc=peter.chen@kernel.org \
--cc=rogerq@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®