[U-Boot] usb_test_unit_ready called every block read - performance

Marek Vasut marek.vasut at gmail.com
Sun Aug 19 01:16:25 CEST 2012


Dear Jim Shimer,

> Hi Marek,
> 
> I looked at the ext4 branch.  It looks like he has the patch to remove the
> usb_test_unit_ready() calls which were not needed. Actually those calls are
> commented out on that branch:
> #if 0
>         if (usb_test_unit_ready(srb, ss)) {
>                 printf("Device NOT ready\n   Request Sense returned %02X
> %02X"
>                        " %02X\n", srb->sense_buf[2], srb->sense_buf[12],
>                         srb->sense_buf[13]);
>                 return 0;
>         }
> #endif
> 
> In the u-boot-usb.git, this code is removed so at some point there will be
> a merge conflict.
> 
> Also the ext4 branch still has the mdelay(5) always being done in
> usb_stor_BBB_transport() line 696 which we found to be the largest
> performance killer.

The ext4 branch doesn't contain a few other things indeed. Can you try applying 
the ext4 patches on uboot-usb and retest?

> Regards,
> Jim
> 
> On Sun, Aug 12, 2012 at 7:54 PM, Marek Vasut <marex at denx.de> wrote:
> > Dear Jim Shimer,
> > 
> > > While tuning ext2load, we found that usb_test_unit_ready was being
> > > called every block read.  We compared the usb block storage to the
> > > scsi block storage cmd_scsi.c, and found that the scsi device was only
> > > calling its scsi_setup_test_unit_ready() during scsi_can.  It appears
> > > that usb_test_unit_ready() really only needs to be called once during
> > > usb_stor_scan(), via usb_stor_get_info().   Is there a particular
> > > reason usb_test_unit_ready is called for every block read, or do you
> > > think its
> > 
> > ok
> > 
> > > to only call during usb_stor_scan()?  We're finding this speeds up
> > 
> > ext2load
> > 
> > > quite a bit.
> > 
> > Jim, did we get anywhere on this one ? Can you try with the new ext4 code
> > in
> > Wolfgangs' u-boot-master/ext4 branch?
> > 
> > > Regards,
> > > Jim
> > 
> > Best regards,
> > Marek Vasut

Best regards,
Marek Vasut


More information about the U-Boot mailing list