Re: the proper value of timeout of usb_control_msg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 29 Nov 2010, vichy wrote:

> Recently I trace scsi and usb storage driver and try to improve the
> read speed of my usb stick.
> I have some questions about them:
> 1.  below is the struct of scsi cmd, and there is a list seems for
> linking multiple scsi cmd
> But I found usb storage driver seems always get one cmd at a time.
> why don't upper layer link more of them to send it once?

usb-storage can only handle one command at a time.  In fact, your USB 
stick can only handle one command at a time.

Besides, if you look carefully at the times you'll see that the major 
source of delays isn't the interval between commands.  It's the 
intervals within a single command.

> 2. I have traced upper layer source code to find out where the scsi
> cmd come from and I found it just pass from  cmd = req->special; one
> of element of request_queue that passes to scsi_request_fn?
> where and how upper layer made it?(I guess it should made from block layer )

It depends on what command you're talking about.  Some of them come
from req->special as you saw, other SCSI commands are built
specifically from req in the sd driver.  See sd_prep_fn() in
drivers/scsi/sd.c.  Of course, req itself usually comes from the block 
layer -- but not always!  See scsi_execute() and scsi_execute_req() in 
drivers/scsi/scsi_lib.c.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux