Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756876Ab2F0QLY (ORCPT ); Wed, 27 Jun 2012 12:11:24 -0400 Received: from bishop.asidev.net ([95.141.38.214]:46859 "EHLO bishop.asidev.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070Ab2F0QLX (ORCPT ); Wed, 27 Jun 2012 12:11:23 -0400 X-Greylist: delayed 568 seconds by postgrey-1.27 at vger.kernel.org; Wed, 27 Jun 2012 12:11:23 EDT Message-ID: <4FEB2E63.804@evidence.eu.com> Date: Wed, 27 Jun 2012 18:01:39 +0200 From: Claudio Scordino User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20 MIME-Version: 1.0 To: ok@artecdesign.ee CC: linux-usb@vger.kernel.org, Linux Kernel , gregkh@linuxfoundation.org, bruno Subject: [PATCH] isp1362-hcd.c: usb message always saved in case of underrun Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2229 Lines: 61 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 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 Signed-off-by: Claudio Scordino Tested-by: Bruno Morelli --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/