From: Piyush Mehta <piyush.mehta@amd.com>
To: <michal.simek@amd.com>, <peter.chen@kernel.org>,
<gregkh@linuxfoundation.org>
Cc: <siva.durga.prasad.paladugu@amd.com>,
<radhey.shyam.pandey@amd.com>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Piyush Mehta <piyush.mehta@amd.com>
Subject: [PATCH V2] usb: chipidea: udc: Add revision check of 2.20[CI_REVISION_22]
Date: Thu, 2 Nov 2023 12:36:03 +0530 [thread overview]
Message-ID: <20231102070603.777313-1-piyush.mehta@amd.com> (raw)
Issue: Adding a dTD to a Primed Endpoint May Not Get Recognized with
revision 2.20a.
There is an issue with the add dTD tripwire semaphore (ATDTW bit in
USBCMD register) that can cause the controller to ignore a dTD that is
added to a primed endpoint. When this happens, the software can read
the tripwire bit and the status bit at '1' even though the endpoint is
unprimed.
This issue observed with the Windows host machine.
Workaround:
The software must implement a periodic cycle, and check for each dTD
pending on execution (Active = 1), if the endpoint is primed. It can do
this by reading the corresponding bits in the ENDPTPRIME and ENDPTSTAT
registers. If these bits are read at 0, the software needs to re-prime
the endpoint by writing 1 to the corresponding bit in the ENDPTPRIME
register.
Added conditional revision check of 2.20[CI_REVISION_22] along with 2.40.
Signed-off-by: Piyush Mehta <piyush.mehta@amd.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
---
Change in V2:
- Addressed the Peter review comment - Update the subject line.
- Added Peter Ack in patch as Acked-by.
- Switch to new @amd.com to AMD/Xilinx acquisition.
Link: https://lore.kernel.org/all/1629825378-8089-7-git-send-email-manish.narani@xilinx.com
---
drivers/usb/chipidea/udc.c | 3 ++-
drivers/usb/chipidea/udc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 0b7bd3c643c3..2d7f616270c1 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -688,7 +688,8 @@ static int _hardware_dequeue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
if ((TD_STATUS_ACTIVE & tmptoken) != 0) {
int n = hw_ep_bit(hwep->num, hwep->dir);
- if (ci->rev == CI_REVISION_24)
+ if (ci->rev == CI_REVISION_24 ||
+ ci->rev == CI_REVISION_22)
if (!hw_read(ci, OP_ENDPTSTAT, BIT(n)))
reprime_dtd(ci, hwep, node);
hwreq->req.status = -EALREADY;
--
2.25.1
next reply other threads:[~2023-11-02 7:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 7:06 Piyush Mehta [this message]
2025-03-06 14:12 ` Junzhong Pan
2025-03-06 14:17 ` Junzhong Pan
2025-03-06 14:22 ` Michal Simek
2025-03-09 14:55 ` Pandey, Radhey Shyam
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=20231102070603.777313-1-piyush.mehta@amd.com \
--to=piyush.mehta@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=peter.chen@kernel.org \
--cc=radhey.shyam.pandey@amd.com \
--cc=siva.durga.prasad.paladugu@amd.com \
/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®