linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/6] USB: HCD/EHCI: giveback of URB in tasklet context
@ 2013-06-18 15:03 Ming Lei
  2013-06-18 15:03 ` [RFC PATCH v1 1/6] USB: HCD: support " Ming Lei
                   ` (5 more replies)
  0 siblings, 6 replies; 43+ messages in thread
From: Ming Lei @ 2013-06-18 15:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

The patchset supports to run giveback of URB in tasklet context, so that
DMA unmapping/mapping on transfer buffer and compelte() callback can be
run with interrupt enabled, then time of HCD interrupt handler(IRQs
disabled time) can be saved much. Also this approach may simplify HCD
since HCD lock needn't be released any more before calling
usb_hcd_giveback_urb().

But, some drivers may assume IRQs are disabled in complete(),
and they may use spin_lock() to hold lock, so deadlock might be caused
when the lock is acquired in hard interrupt context. So currently patch
2/6 disables IRQs when calling complete() in tasklet, and at the same time
we can start to clean up drivers by converting spin_lock() in complete()
to spin_lock_irqsave() if the deadlock situation may exist. After the
cleanup is completed, complete() in tasklet will be called with IRQs
enabled.

Patch 5/6 improves interrupt qh unlink on EHCI HCD when the mechanism
is introduced.

The patchset enables the mechanism on EHCI HCD.

In the commit log of patch 6/6, detailed test result on three machines
(ARM A9/A15 dual core, X86) are provided about transfer performance and
ehci irq handling time. From the result, no transfer performance loss
is found and ehci irq handling time drops much with the patchset.


V1:
	- change percput tasklet into tasklet in HCD to avoid out of order
	of URB->complete() for same endpoint

	- disable local IRQs when calling complete() from tasklet to
	avoid deadlock which is caused by holding lock via spin_lock
	and the same lock might be acquired in hard irq context

	- document coming change about calling complete() with irq enabled
	so that we can start to clean up USB drivers which call spin_lock()
	in complete()


 Documentation/usb/URB.txt         |   30 +++---
 drivers/usb/core/hcd.c            |  196 ++++++++++++++++++++++++++++++++-----
 drivers/usb/host/ehci-fsl.c       |    2 +-
 drivers/usb/host/ehci-grlib.c     |    2 +-
 drivers/usb/host/ehci-hcd.c       |   18 +++-
 drivers/usb/host/ehci-hub.c       |    1 +
 drivers/usb/host/ehci-mv.c        |    2 +-
 drivers/usb/host/ehci-octeon.c    |    2 +-
 drivers/usb/host/ehci-pmcmsp.c    |    2 +-
 drivers/usb/host/ehci-ppc-of.c    |    2 +-
 drivers/usb/host/ehci-ps3.c       |    2 +-
 drivers/usb/host/ehci-q.c         |    6 +-
 drivers/usb/host/ehci-sched.c     |   60 +++++++++++-
 drivers/usb/host/ehci-sead3.c     |    2 +-
 drivers/usb/host/ehci-sh.c        |    2 +-
 drivers/usb/host/ehci-tegra.c     |    2 +-
 drivers/usb/host/ehci-tilegx.c    |    2 +-
 drivers/usb/host/ehci-timer.c     |   43 ++++++++
 drivers/usb/host/ehci-w90x900.c   |    2 +-
 drivers/usb/host/ehci-xilinx-of.c |    2 +-
 drivers/usb/host/ehci.h           |    3 +
 include/linux/usb/hcd.h           |   17 ++++
 22 files changed, 341 insertions(+), 59 deletions(-)

Thanks,
--
Ming Lei

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2013-06-24  4:55 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18 15:03 [RFC PATCH v1 0/6] USB: HCD/EHCI: giveback of URB in tasklet context Ming Lei
2013-06-18 15:03 ` [RFC PATCH v1 1/6] USB: HCD: support " Ming Lei
2013-06-18 16:05   ` Alan Stern
2013-06-19  2:59     ` Ming Lei
2013-06-19 11:50       ` Ming Lei
2013-06-19 15:37       ` Alan Stern
2013-06-20  1:50         ` Ming Lei
2013-06-20 14:59           ` Alan Stern
2013-06-20 15:13             ` Ming Lei
2013-06-20 16:52               ` Alan Stern
2013-06-21  1:12                 ` Ming Lei
2013-06-21  4:46                   ` Ming Lei
2013-06-21  5:13                     ` Ming Lei
2013-06-21  8:33                   ` Oliver Neukum
2013-06-21  9:13                     ` Ming Lei
2013-06-21  9:20                       ` Oliver Neukum
2013-06-21  9:43                         ` Ming Lei
2013-06-21 10:09                           ` Ming Lei
2013-06-21 14:48                           ` Alan Stern
2013-06-21 16:12                             ` Ming Lei
2013-06-18 15:03 ` [RFC PATCH v1 2/6] USB: disable IRQs deliberately when calling complete() Ming Lei
2013-06-18 15:13   ` Sergei Shtylyov
2013-06-18 16:36   ` Alan Stern
2013-06-19  3:02     ` Ming Lei
2013-06-19 15:30       ` Alan Stern
2013-06-18 15:03 ` [RFC PATCH v1 3/6] USB: URB documentation: claim complete() may be run with IRQs enabled Ming Lei
2013-06-18 16:42   ` Alan Stern
2013-06-19  3:06     ` Ming Lei
2013-06-18 15:03 ` [RFC PATCH v1 4/6] USB: EHCI: don't release ehci->lock if URB giveback in tasklet context Ming Lei
2013-06-18 16:43   ` Alan Stern
2013-06-19  3:13     ` Ming Lei
2013-06-19 15:47       ` Alan Stern
2013-06-20  1:53         ` Ming Lei
2013-06-18 15:03 ` [RFC PATCH v1 5/6] USB: EHCI: improve interrupt qh unlink Ming Lei
2013-06-18 16:51   ` Alan Stern
2013-06-19  3:36     ` Ming Lei
2013-06-19 15:44       ` Alan Stern
2013-06-20  6:05         ` Ming Lei
2013-06-21 20:16           ` Alan Stern
2013-06-24  4:55             ` Ming Lei
2013-06-18 15:03 ` [RFC PATCH v1 6/6] USB: EHCI: support running URB giveback in tasklet context Ming Lei
2013-06-18 16:55   ` Alan Stern
2013-06-19  3:39     ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).