linux/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
ehci-atmel.c
ehci-au1xxx.c USB: ehci-au1xxx does not need EHCI IO watchdog 2010-05-20 13:21:31 -07:00
ehci-dbg.c
ehci-fsl.c
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
ehci-mem.c USB: EHCI: defer reclamation of siTDs 2010-04-22 15:18:28 -07:00
ehci-mxc.c
ehci-omap.c
ehci-orion.c
ehci-pci.c
ehci-ppc-of.c
ehci-ps3.c
ehci-q.c
ehci-sched.c USB: EHCI: defer reclamation of siTDs 2010-04-22 15:18:28 -07:00
ehci-w90x900.c
ehci-xilinx-of.c
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
imx21-dbg.c
imx21-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
imx21-hcd.h
isp116x-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
isp116x.h
isp1362-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
isp1362.h
isp1760-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
isp1760-hcd.h
isp1760-if.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
Kconfig
Makefile
ohci-at91.c USB: ohci-at91: fix power management hanging 2010-04-30 09:25:12 -07:00
ohci-au1xxx.c
ohci-da8xx.c
ohci-dbg.c
ohci-ep93xx.c
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
ohci-mem.c
ohci-omap.c
ohci-pci.c
ohci-pnx4008.c
ohci-pnx8550.c
ohci-ppc-of.c
ohci-ppc-soc.c
ohci-ps3.c
ohci-pxa27x.c
ohci-q.c
ohci-s3c2410.c
ohci-sa1111.c
ohci-sh.c
ohci-sm501.c
ohci-ssb.c
ohci-tmio.c
ohci.h
oxu210hp-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
oxu210hp.h
pci-quirks.c
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
sl811_cs.c
sl811-hcd.c USB: straighten out port feature vs. port status usage 2010-05-20 13:21:31 -07:00
sl811.h
u132-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
uhci-debug.c
uhci-hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
uhci-hcd.h
uhci-hub.c
uhci-q.c
xhci-dbg.c
xhci-ext-caps.h
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