mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Aleksey Kuleshov <rndfax@yandex.ru>
To: barebox@lists.infradead.org
Cc: Aleksey Kuleshov <rndfax@yandex.ru>
Subject: [PATCH] ehci-hcd: preserve DTC in QH for interrupt transactions
Date: Thu,  3 Mar 2016 15:49:25 +0300	[thread overview]
Message-ID: <1457009365-27265-1-git-send-email-rndfax@yandex.ru> (raw)

In Linux ehci-q Data Toggle Control bit for interrupt transactions
is preserved in Queue Head (EHCI 3.6.2). So don't set 14's bit in
qh_endpt1 and don't manage toggle bit anywhere in int transactions.

This fixes an idle issue for USB keyboards, where keys
were physically changed but barebox haven't seen them in polling
until the next USB keyboard polling occurs.
---
 drivers/usb/host/ehci-hcd.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 9327015..7362f56 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1011,7 +1011,7 @@ static struct int_queue *ehci_create_int_queue(struct usb_device *dev,
 	struct usb_host *host = dev->host;
 	struct ehci_priv *ehci = to_ehci(host);
 	struct int_queue *result = NULL;
-	uint32_t i, toggle;
+	uint32_t i;
 	struct QH *list = ehci->periodic_queue;
 
 	/*
@@ -1063,8 +1063,6 @@ static struct int_queue *ehci_create_int_queue(struct usb_device *dev,
 	memset(result->first, 0, sizeof(struct QH) * queuesize);
 	memset(result->tds, 0, sizeof(struct qTD) * queuesize);
 
-	toggle = usb_gettoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe));
-
 	for (i = 0; i < queuesize; i++) {
 		struct QH *qh = result->first + i;
 		struct qTD *td = result->tds + i;
@@ -1079,7 +1077,6 @@ static struct int_queue *ehci_create_int_queue(struct usb_device *dev,
 		qh->qh_endpt1 =
 			cpu_to_hc32((0 << 28) | /* No NAK reload (ehci 4.9) */
 			(usb_maxpacket(dev, pipe) << 16) | /* MPS */
-			(1 << 14) |
 			QH_ENDPT1_EPS(ehci_encode_speed(dev->speed)) |
 			(usb_pipeendpoint(pipe) << 8) | /* Endpoint Number */
 			(usb_pipedevice(pipe) << 0));
@@ -1098,7 +1095,6 @@ static struct int_queue *ehci_create_int_queue(struct usb_device *dev,
 			"communication direction is '%s'\n",
 			usb_pipein(pipe) ? "in" : "out");
 		td->qt_token = cpu_to_hc32(
-			QT_TOKEN_DT(toggle) |
 			(elementsize << 16) |
 			((usb_pipein(pipe) ? 1 : 0) << 8) | /* IN/OUT token */
 			0x80); /* active */
@@ -1114,7 +1110,6 @@ static struct int_queue *ehci_create_int_queue(struct usb_device *dev,
 		    cpu_to_hc32((td->qt_buffer[0] + 0x4000) & ~0xfff);
 
 		*buf = buffer + i * elementsize;
-		toggle ^= 1;
 	}
 
 	if (ehci->periodic_schedules > 0) {
@@ -1150,8 +1145,7 @@ static void *ehci_poll_int_queue(struct usb_device *dev,
 {
 	struct QH *cur = queue->current;
 	struct qTD *cur_td;
-	uint32_t token, toggle;
-	unsigned long pipe = queue->pipe;
+	uint32_t token;
 
 	/* depleted queue */
 	if (cur == NULL) {
@@ -1168,9 +1162,6 @@ static void *ehci_poll_int_queue(struct usb_device *dev,
 		return NULL;
 	}
 
-	toggle = QT_TOKEN_GET_DT(token);
-	usb_settoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe), toggle);
-
 	if (!(cur->qh_link & QH_LINK_TERMINATE))
 		queue->current++;
 	else
-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2016-03-03 12:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1457009365-27265-1-git-send-email-rndfax@yandex.ru \
    --to=rndfax@yandex.ru \
    --cc=barebox@lists.infradead.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