dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/usb/host
Alan Stern ff9c895f07 USB: fix usbmon and DMA mapping for scatter-gather URBs
This patch (as1368) fixes a rather obscure bug in usbmon: When tracing
URBs sent by the scatter-gather library, it accesses the data buffers
while they are still mapped for DMA.

The solution is to move the mapping and unmapping out of the s-g
library and into the usual place in hcd.c.  This requires the addition
of new URB flag bits to describe the kind of mapping needed, since we
have to call dma_map_sg() if the HCD supports native scatter-gather
operation and dma_map_page() if it doesn't.  The nice thing about
having the new flags is that they simplify the testing for unmapping.

The patch removes the only caller of usb_buffer_[un]map_sg(), so those
functions are #if'ed out.  A later patch will remove them entirely.

As a result of this change, urb->sg will be set in situations where
it wasn't set previously.  Hence the xhci and whci drivers are
adjusted to test urb->num_sgs instead, which retains its original
meaning and is nonzero only when the HCD has to handle a scatterlist.

Finally, even when a submission error occurs we don't want to hand
URBs to usbmon before they are unmapped.  The submission path is
rearranged so that map_urb_for_dma() is called only for non-root-hub
URBs and unmap_urb_for_dma() is called immediately after a submission
error.  This simplifies the error handling.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:37 -07:00
..
whci USB: fix usbmon and DMA mapping for scatter-gather URBs 2010-05-20 13:21:37 -07:00
Kconfig USB: MXC: Add i.MX21 specific USB host controller driver. 2010-03-02 14:52:55 -08:00
Makefile USB: xhci: rename driver to xhci_hcd 2010-03-19 07:24:08 -07:00
ehci-atmel.c USB: ehci-atmel.c: use resource_size() 2010-03-02 14:53:18 -08:00
ehci-au1xxx.c USB: ehci-au1xxx does not need EHCI IO watchdog 2010-05-20 13:21:31 -07:00
ehci-dbg.c USB: EHCI: split ehci_qh into hw and sw parts 2009-09-23 06:46:29 -07:00
ehci-fsl.c USB: ehci-fsl: Add power management support 2010-03-02 14:53:15 -08:00
ehci-fsl.h
ehci-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
ehci-hub.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
ehci-ixp4xx.c USB: EHCI: use the new clear_tt_buffer interface 2009-07-12 15:16:39 -07:00
ehci-mem.c USB: EHCI: defer reclamation of siTDs 2010-04-22 15:18:28 -07:00
ehci-mxc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ehci-omap.c USB: ehci: omap: fix kernel panic with rmmod 2010-04-22 15:18:21 -07:00
ehci-orion.c USB: ehci-orion.c: use resource_size() 2010-03-02 14:53:17 -08:00
ehci-pci.c USB: work around for EHCI with quirky periodic schedules 2009-11-30 16:43:16 -08:00
ehci-ppc-of.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ehci-ps3.c USB: EHCI: use the new clear_tt_buffer interface 2009-07-12 15:16:39 -07:00
ehci-q.c USB: EHCI: fix handling of unusual interrupt intervals 2010-01-20 15:24:34 -08:00
ehci-sched.c USB: EHCI: defer reclamation of siTDs 2010-04-22 15:18:28 -07:00
ehci-w90x900.c USB: Add nuvoton Ehci driver for w90p910 platform 2009-09-23 06:46:20 -07:00
ehci-xilinx-of.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ehci.h USB: remove bogus USB_PORT_FEAT_*_SPEED symbols 2010-05-20 13:21:31 -07:00
fhci-dbg.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci-hub.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci-mem.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci-q.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci-sched.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci-tds.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci.h USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
hwa-hc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
imx21-dbg.c USB: MXC: Add i.MX21 specific USB host controller driver. 2010-03-02 14:52:55 -08:00
imx21-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
imx21-hcd.h USB: MXC: Add i.MX21 specific USB host controller driver. 2010-03-02 14:52:55 -08:00
isp116x-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
isp116x.h USB: add missing KERN_* constants to printks 2009-03-24 16:20:30 -07:00
isp1362-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
isp1362.h USB: FIX bitfield istl_flip:1, make it unsigned. 2009-12-11 11:55:20 -08:00
isp1760-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
isp1760-hcd.h USB: isp1760: allow platform devices to customize devflags 2009-09-23 06:46:29 -07:00
isp1760-if.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
ohci-at91.c USB: ohci-at91: fix power management hanging 2010-04-30 09:25:12 -07:00
ohci-au1xxx.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
ohci-da8xx.c USB: OHCI: DA8xx/OMAP-L1x: fix up macro rename 2010-04-22 15:18:24 -07:00
ohci-dbg.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-ep93xx.c USB: ohci-ep93xx.c: remove unused variable 2009-09-23 06:46:34 -07:00
ohci-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
ohci-hub.c USB: OHCI: don't look at the root hub to get the number of ports 2010-04-30 09:25:10 -07:00
ohci-lh7a404.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-mem.c
ohci-omap.c omap: headers: Move remaining headers from include/mach to include/plat 2009-10-20 09:40:47 -07:00
ohci-pci.c USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer 2009-11-17 16:46:33 -08:00
ohci-pnx4008.c USB: fix I2C API usage in ohci-pnx4008. 2010-03-02 14:55:15 -08:00
ohci-pnx8550.c USB: automatically enable RHSC interrupts 2008-08-21 10:26:38 -07:00
ohci-ppc-of.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-ppc-soc.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-ps3.c usb/ps3: Add missing annotations 2009-06-16 14:17:32 +10:00
ohci-pxa27x.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
ohci-q.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ohci-s3c2410.c USB: S3C: Move usb-control.h to platform include 2009-03-24 16:20:45 -07:00
ohci-sa1111.c USB: Convert concatenated __FILE__ to %s, __FILE__ 2010-03-02 14:54:59 -08:00
ohci-sh.c USB: automatically enable RHSC interrupts 2008-08-21 10:26:38 -07:00
ohci-sm501.c USB: automatically enable RHSC interrupts 2008-08-21 10:26:38 -07:00
ohci-ssb.c USB: automatically enable RHSC interrupts 2008-08-21 10:26:38 -07:00
ohci-tmio.c usb: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-07 09:59:52 -08:00
ohci.h USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer 2009-11-17 16:46:33 -08:00
oxu210hp-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
oxu210hp.h USB: replace uses of __constant_{endian} 2009-03-24 16:20:33 -07:00
pci-quirks.c Revert "USB: Work around BIOS bugs by quiescing USB controllers earlier" 2009-10-11 15:57:57 -07:00
pci-quirks.h
r8a66597-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
r8a66597.h usb: move r8a66597 register defines 2009-07-23 13:04:10 +09:00
sl811-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
sl811.h Rename WARN() to WARNING() to clear the namespace 2008-07-25 10:53:29 -07:00
sl811_cs.c pcmcia: rework the irq_req_t typedef 2009-11-28 18:03:14 +01:00
u132-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
uhci-debug.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
uhci-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
uhci-hcd.h USB: replace uses of __constant_{endian} 2009-03-24 16:20:33 -07:00
uhci-hub.c USB: add missing delay during remote wakeup 2010-01-20 15:24:34 -08:00
uhci-q.c USB: uhci: rm repeatedly evaluation for urbp->qh 2009-09-23 06:46:30 -07:00
xhci-dbg.c USB: xhci: Fix compile issues with xhci_get_slot_state() 2010-03-02 14:54:01 -08:00
xhci-ext-caps.h USB: xhci: Fix finding extended capabilities registers 2010-03-02 14:55:02 -08:00
xhci-hub.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
xhci-mem.c USB: xhci: properly set endpoint context fields for periodic eps. 2010-04-30 09:25:10 -07:00
xhci-pci.c USB: xhci: Limit bus sg_tablesize to 62 TRBs. 2010-05-20 13:21:30 -07:00
xhci-ring.c USB: fix usbmon and DMA mapping for scatter-gather URBs 2010-05-20 13:21:37 -07:00
xhci.c USB: xhci: Fix issue with set interface after stall. 2010-05-20 13:21:30 -07:00
xhci.h USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00