Re: [PATCH]dma rules violation in the option driver

Pete Zaitcev <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Red Hat, Inc.
Message-ID <[email protected]>
On Tue, 27 Mar 2007 14:30:52 +0200, Oliver Neukum <[email protected]> wrote:

> --- a/drivers/usb/serial/option.c	2007-03-27 13:31:04.000000000 +0200
> +++ b/drivers/usb/serial/option.c	2007-03-27 14:21:21.000000000 +0200
> @@ -627,14 +629,23 @@
> +	*buf = usb_buffer_alloc(serial->dev, len, GFP_KERNEL, handle);
>  		/* Fill URB using supplied data. */
>  	usb_fill_bulk_urb(urb, serial->dev,
>  		      usb_sndbulkpipe(serial->dev, endpoint) | dir,
> -		      buf, len, callback, ctx);
> +		      *buf, len, callback, ctx);
> +	urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
> +	urb->transfer_dma = *handle;

Why don't you just use kmalloc here? The needless use of usb_buffer_alloc
always irritates me. It's as if the iommu space is free and endless.

We have tons of this crap all over the USB stack and I cannot understand
just why we keep doing this. Even printer and HID now got into the game.
Crazy!

-- Pete

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.