On Wed, 6 Jul 2005, Pete Zaitcev wrote:

> Hi, Guys:
> 
> I'm thinking about carrying this patch in Fedora for the time being:
> 
> diff -urp -X dontdiff linux-2.6.12/drivers/usb/storage/transport.c 
> linux-2.6.12-lem/drivers/usb/storage/transport.c
> --- linux-2.6.12/drivers/usb/storage/transport.c      2005-06-21 
> 12:58:48.000000000 -0700
> +++ linux-2.6.12-lem/drivers/usb/storage/transport.c  2005-07-06 
> 14:00:30.000000000 -0700
> @@ -948,8 +948,9 @@ int usb_stor_Bulk_max_lun(struct us_data
>  
>  int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
>  {
> -     struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
> -     struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf;
> +     /* Offset into iobuf a little in order to defeat pre-set DMA */
> +     struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) (us->iobuf + 4);
> +     struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) (us->iobuf + 4);
>       unsigned int transfer_length = srb->request_bufflen;
>       unsigned int residue;
>       int result;
> @@ -960,7 +961,7 @@ int usb_stor_Bulk_transport(struct scsi_
>       /* Take care of BULK32 devices; set extra byte to 0 */
>       if ( unlikely(us->flags & US_FL_BULK32)) {
>               cbwlen = 32;
> -             us->iobuf[31] = 0;
> +             ((unsigned char *)bcb)[31] = 0;
>       }
>  
>       /* set up the command wrapper */
> 
> I do not detect performance issues, although that says nothing.
> There may be some.
> 
> Without it, the usbmon in 2.6.12 cannot capture SCSI commands.
> This ought to be fixed in usbmon, but it takes some time.
> 
> Does anyone think that this is a very bad idea?

Performance issues would be highly platform-dependent.  With x86 machines 
there is practically no overhead to DMA mapping (as far as I know).  What 
about PPC or others?

In the end you will want to update usbmon to be able to read data, given 
only the DMA mapping.  For now, this seems like a reasonable substitute.

Alan Stern



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to