public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Scordino <claudio@evidence.eu.com>
To: ok@artecdesign.ee
Cc: linux-usb@vger.kernel.org,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	gregkh@linuxfoundation.org, bruno <bruno@evidence.eu.com>
Subject: [PATCH] isp1362-hcd.c: usb message always saved in case of underrun
Date: Wed, 27 Jun 2012 18:01:39 +0200	[thread overview]
Message-ID: <4FEB2E63.804@evidence.eu.com> (raw)

Hi Olav,

	please find below a patch for the isp1362-hcd.c driver to always
save the message in case of underrun. More information is provided
inside the patch comment. Let us know if you need any further
information.

Best regards,

	Claudio


Subject: isp1362-hcd.c: usb message always saved in case of underrun
From: Bruno Morelli <bruno@evidence.eu.com>

The usb message must be saved also in case the USB endpoint is not a
control endpoint (i.e., "endpoint 0"), otherwise in some circumstances
we don't have a payload in case of error.

The patch has been created by tracing with usbmon the different error
messages generated by this driver with respect to the ehci-hcd driver.

Signed-off-by: Bruno Morelli <bruno@evidence.eu.com>
Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Tested-by: Bruno Morelli <bruno@evidence.eu.com>
---
  drivers/usb/host/isp1362-hcd.c |   11 ++++++-----
  1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 2ed112d..61bf1b2 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -543,13 +543,14 @@ static void postproc_ep(struct isp1362_hcd *isp1362_hcd, struct isp1362_ep *ep)
  			    usb_pipein(urb->pipe) ? "IN" : "OUT", ep->nextpid,
  			    short_ok ? "" : "not_",
  			    PTD_GET_COUNT(ptd), ep->maxpacket, len);
+			/* save the data underrun error code for later and
+			 * proceed with the status stage
+			 */
+			urb->actual_length += PTD_GET_COUNT(ptd);
+			BUG_ON(urb->actual_length >
+			    urb->transfer_buffer_length);
  			if (usb_pipecontrol(urb->pipe)) {
  				ep->nextpid = USB_PID_ACK;
-				/* save the data underrun error code for later and
-				 * proceed with the status stage
-				 */
-				urb->actual_length += PTD_GET_COUNT(ptd);
-				BUG_ON(urb->actual_length > urb->transfer_buffer_length);
  
  				if (urb->status == -EINPROGRESS)
  					urb->status = cc_to_error[PTD_DATAUNDERRUN];
-- 
1.7.1


             reply	other threads:[~2012-06-27 16:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27 16:01 Claudio Scordino [this message]
2012-07-06 17:41 ` [PATCH] isp1362-hcd.c: usb message always saved in case of underrun Greg KH
2012-07-18  8:53   ` Claudio Scordino
2012-07-19 22:58     ` Greg KH
2012-07-20 10:26       ` Claudio Scordino
2012-07-20 15:15         ` Greg KH
2012-07-30 13:26           ` Claudio Scordino

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=4FEB2E63.804@evidence.eu.com \
    --to=claudio@evidence.eu.com \
    --cc=bruno@evidence.eu.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ok@artecdesign.ee \
    /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