Files
kernel-tenderloin-3.0/include/linux
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
..
2010-03-12 15:53:10 -08:00
2009-12-16 07:20:13 -08:00
2010-04-25 08:54:42 +02:00
2010-03-12 15:52:32 -08:00
2010-02-05 07:35:05 -08:00
2009-12-15 08:53:33 -08:00
2009-12-23 13:33:54 +01:00
2010-04-23 10:39:48 -07:00
2010-03-16 08:55:32 +01:00
2010-02-09 11:13:56 +01:00
2009-12-14 23:55:34 +01:00
2010-03-07 22:17:09 +01:00
2010-03-02 12:23:42 +01:00
2010-04-01 01:31:13 -07:00
2010-02-18 14:08:38 -08:00
2010-02-17 16:35:17 -08:00
2010-02-02 07:32:29 -08:00
2010-01-11 16:28:01 -08:00
2010-03-12 15:52:40 -08:00
2010-03-12 15:52:36 -08:00
2010-03-12 15:52:40 -08:00
2010-03-12 15:53:10 -08:00
2009-12-16 06:56:12 -08:00
2010-04-06 10:55:33 -04:00
2009-12-15 08:53:36 -08:00
2009-12-26 20:40:34 -08:00
2010-02-03 17:39:50 +11:00
2010-03-12 15:53:10 -08:00
2010-02-09 11:13:56 +01:00
2010-02-19 03:35:12 -05:00
2010-03-12 15:52:38 -08:00
2009-12-15 08:53:20 -08:00
2010-03-12 15:52:28 -08:00
2010-04-07 08:38:04 -07:00
2010-02-10 23:49:08 +09:00
2010-02-03 20:32:28 -08:00
2010-04-12 07:55:15 -04:00
2010-02-19 15:52:40 -05:00
2010-02-14 07:13:47 -07:00
2010-02-23 23:14:47 -08:00
2010-02-04 10:23:02 -08:00
2010-03-12 15:53:11 -08:00
2010-03-05 00:20:31 +01:00
2010-02-10 17:47:17 -08:00
2010-03-12 15:52:44 -08:00
2010-03-02 14:28:49 -05:00
2010-03-12 15:53:10 -08:00
2010-03-12 15:52:43 -08:00
2010-01-21 23:55:25 -08:00
2010-02-16 13:38:56 +09:00
2010-03-12 15:52:44 -08:00
2009-12-16 22:32:29 -05:00
2010-01-14 22:38:09 -05:00
2010-03-12 15:52:36 -08:00
2010-02-18 15:43:09 -08:00
2010-01-05 09:17:33 +09:00
2010-03-12 10:03:42 +01:00
2009-12-16 12:16:49 -05:00