From: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
To: <mathias.nyman@intel.com>, <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<anirudh@xilinx.com>, Anurag Kumar Vulisha <anuragku@xilinx.com>
Subject: [LINUX PATCH] usb: xhci: Add toggle cycle bit for the last seg trb when cached ring is used
Date: Wed, 31 May 2017 19:11:50 +0530 [thread overview]
Message-ID: <1496238110-4998-1-git-send-email-anuragku@xilinx.com> (raw)
At present USB 2.0 cameras fail to play when run for 2nd time or greater.
This issue occurs only when previous endpoint cached ring is used instead
of allocating a new endpoint ring. The root cause of the problem narrows
down to the Toggle bit, which is not getting set on the last trb of the
cached ring last segment. When the controller fetches the last link trb
with no toggle bit set, abnormal behaviour is generated.
This patch solves that problem by adding the TOGGLE bit for the last trb
of the last segment of the cached ring.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
---
drivers/usb/host/xhci-mem.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 1f1687e..3e59ba9 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -455,6 +455,14 @@ static void xhci_reinit_cached_ring(struct xhci_hcd *xhci,
} while (seg != ring->first_seg);
ring->type = type;
xhci_initialize_ring_info(ring, cycle_state);
+
+ /* Only event ring does not use link TRB */
+ if (type != TYPE_EVENT) {
+ /* See xhci spec section 4.9.2.1 and 6.4.4.1 */
+ ring->last_seg->trbs[TRBS_PER_SEGMENT - 1].link.control |=
+ cpu_to_le32(LINK_TOGGLE);
+ }
+
/* td list should be empty since all URBs have been cancelled,
* but just in case...
*/
--
2.1.1
next reply other threads:[~2017-05-31 13:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 13:41 Anurag Kumar Vulisha [this message]
2017-06-01 13:20 ` Mathias Nyman
2017-06-01 16:03 ` Anurag Kumar Vulisha
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=1496238110-4998-1-git-send-email-anuragku@xilinx.com \
--to=anurag.kumar.vulisha@xilinx.com \
--cc=anirudh@xilinx.com \
--cc=anuragku@xilinx.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.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®