public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@ti.com>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephen Warren <swarren@wwwdotorg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Alexandre Courbot <gnurou@gmail.com>,
	linux-tegra@vger.kernel.org, Johan Hovold <johan@kernel.org>
Subject: [PATCH v2 0/3] USB: fix inefficient copy of unaligned buffers
Date: Thu, 23 Apr 2015 16:06:49 +0200	[thread overview]
Message-ID: <1429798012-21916-1-git-send-email-johan@kernel.org> (raw)

These patches (for 4.1) make sure that only the received data is copied
from the temporary buffers used for unaligned transfers.

I discovered this when debugging an issue where the Beaglebone Black
would lock up on disconnect.

Turns out it was related to the transfer_buffers not being properly
aligned, causing musb to use temporary buffers for the transfers. On
transfer errors (e.g. during disconnect), the full buffer content was
still being copied, something which would alter timings enough to
prevent the disconnect from being detected and processed.

The first patch in the series works around the problem in that
particular set up, but obviously does not solve the underlying issue,
which needs to be analysed further.

I also included a corresponding patch for ehci-tegra that has been
compile tested only.

Note that the octeon-hcd driver in staging, which also uses temporary
buffers for unaligned transfers, was broken for isochronous transfers.
The third patch fixes that, but is also untested due to lack of
hardware.

Johan


v2:
 - Make sure to copy the full buffer for isochronous transfers, in which
   case the received data is not necessarily contiguous (thanks Alan).
 - Drop stable tags as this is really just an optimisation.


Johan Hovold (3):
  USB: musb: fix inefficient copy of unaligned buffers
  USB: ehci-tegra: fix inefficient copy of unaligned buffers
  staging: octeon-usb: fix unaligned isochronous transfers

 drivers/staging/octeon-usb/octeon-hcd.c | 12 +++++++++---
 drivers/usb/host/ehci-tegra.c           | 12 +++++++++---
 drivers/usb/musb/musb_host.c            |  9 +++++++--
 3 files changed, 25 insertions(+), 8 deletions(-)

-- 
2.0.5


             reply	other threads:[~2015-04-23 14:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 14:06 Johan Hovold [this message]
2015-04-23 14:06 ` [PATCH v2 1/3] USB: musb: fix inefficient copy of unaligned buffers Johan Hovold
2015-04-23 14:06 ` [PATCH v2 2/3] USB: ehci-tegra: " Johan Hovold
2015-04-23 14:31   ` Frans Klaver
2015-04-23 14:45     ` Johan Hovold
2015-04-23 14:48   ` Alan Stern
2015-04-23 20:32   ` Stephen Warren
2015-04-24  6:31     ` Johan Hovold
2015-04-23 14:06 ` [PATCH v2 3/3] staging: octeon-usb: fix unaligned isochronous transfers Johan Hovold

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=1429798012-21916-1-git-send-email-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=balbi@ti.com \
    --cc=gnurou@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.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