public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Why is USB_BOOT_IO_BLOCKS set to 128?
@ 2016-10-19  1:57 Heyi Guo
  2016-10-19  2:10 ` Tian, Feng
  0 siblings, 1 reply; 6+ messages in thread
From: Heyi Guo @ 2016-10-19  1:57 UTC (permalink / raw)
  To: edk2-devel; +Cc: feng.tian, star.zeng

Dear experts,

Could anyone help to explain why USB_BOOT_IO_BLOCKS in 
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h is set to 128?

We found on some platforms this value may cause USB boot failure and 
*64* blocks will make them work. Though we have not got the final root 
cause, it will be really helpful if you can tell the reason of setting 
it to 128 and possible root cause for such issue.

Thanks and regards,

Heyi



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why is USB_BOOT_IO_BLOCKS set to 128?
  2016-10-19  1:57 Why is USB_BOOT_IO_BLOCKS set to 128? Heyi Guo
@ 2016-10-19  2:10 ` Tian, Feng
  2016-10-20  1:35   ` Heyi Guo
  2017-01-18  6:41   ` Heyi Guo
  0 siblings, 2 replies; 6+ messages in thread
From: Tian, Feng @ 2016-10-19  2:10 UTC (permalink / raw)
  To: Heyi Guo, edk2-devel@lists.01.org; +Cc: Zeng, Star, Tian, Feng

It's just an experience value and has been here about 10 years...

Which usb brand/model name do you have problem on?

Thanks
Feng

-----Original Message-----
From: Heyi Guo [mailto:heyi.guo@linaro.org] 
Sent: Wednesday, October 19, 2016 9:57 AM
To: edk2-devel@lists.01.org
Cc: Tian, Feng <feng.tian@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: [edk2] Why is USB_BOOT_IO_BLOCKS set to 128?

Dear experts,

Could anyone help to explain why USB_BOOT_IO_BLOCKS in MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h is set to 128?

We found on some platforms this value may cause USB boot failure and
*64* blocks will make them work. Though we have not got the final root cause, it will be really helpful if you can tell the reason of setting it to 128 and possible root cause for such issue.

Thanks and regards,

Heyi



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why is USB_BOOT_IO_BLOCKS set to 128?
  2016-10-19  2:10 ` Tian, Feng
@ 2016-10-20  1:35   ` Heyi Guo
  2017-01-18  6:41   ` Heyi Guo
  1 sibling, 0 replies; 6+ messages in thread
From: Heyi Guo @ 2016-10-20  1:35 UTC (permalink / raw)
  To: Tian, Feng, edk2-devel@lists.01.org; +Cc: Zeng, Star

It is a BMC virtual USB channel for BMC KVM.


在 10/19/2016 10:10 AM, Tian, Feng 写道:
> It's just an experience value and has been here about 10 years...
>
> Which usb brand/model name do you have problem on?
>
> Thanks
> Feng
>
> -----Original Message-----
> From: Heyi Guo [mailto:heyi.guo@linaro.org]
> Sent: Wednesday, October 19, 2016 9:57 AM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng <feng.tian@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] Why is USB_BOOT_IO_BLOCKS set to 128?
>
> Dear experts,
>
> Could anyone help to explain why USB_BOOT_IO_BLOCKS in MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h is set to 128?
>
> We found on some platforms this value may cause USB boot failure and
> *64* blocks will make them work. Though we have not got the final root cause, it will be really helpful if you can tell the reason of setting it to 128 and possible root cause for such issue.
>
> Thanks and regards,
>
> Heyi
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why is USB_BOOT_IO_BLOCKS set to 128?
  2016-10-19  2:10 ` Tian, Feng
  2016-10-20  1:35   ` Heyi Guo
@ 2017-01-18  6:41   ` Heyi Guo
  2017-01-19  1:00     ` Tian, Feng
  1 sibling, 1 reply; 6+ messages in thread
From: Heyi Guo @ 2017-01-18  6:41 UTC (permalink / raw)
  To: Tian, Feng, edk2-devel@lists.01.org; +Cc: Zeng, Star

Hi Feng,

Digging in the code history, I found the original value of 
USB_BOOT_IO_BLOCKS was 64, but it was changed to be 128 by the commit 
41e8ff2. So could you help to explain my questions as below?

1. What was the exact reason to change this value?

2. And for the comment in the code, it says "Max carried size is 512B * 
128 = 64KB", but we see that some USB CDROM has block size of 2KB. So do 
we mean something for 64KB max size?

3. From USB specification perspective, is there any limit for transfer 
length, or the device should be able to transfer arbitrary length?

commit 41e8ff2781f3ca14f73ef5f39e781ccba8cb373d
Author: yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Date:   Mon Oct 8 06:14:13 2007 +0000

     Fixed unexpected timeout in Usb MassStorage Driver.
     Fixed unexpected timeout in Uhci/Ehci driver.

     git-svn-id: 
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4038 
6f19259b-4bc3-4df7-8a09-765794883524

Thanks and regards,

Heyi


在 10/19/2016 10:10 AM, Tian, Feng 写道:
> It's just an experience value and has been here about 10 years...
>
> Which usb brand/model name do you have problem on?
>
> Thanks
> Feng
>
> -----Original Message-----
> From: Heyi Guo [mailto:heyi.guo@linaro.org]
> Sent: Wednesday, October 19, 2016 9:57 AM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng <feng.tian@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] Why is USB_BOOT_IO_BLOCKS set to 128?
>
> Dear experts,
>
> Could anyone help to explain why USB_BOOT_IO_BLOCKS in MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h is set to 128?
>
> We found on some platforms this value may cause USB boot failure and
> *64* blocks will make them work. Though we have not got the final root cause, it will be really helpful if you can tell the reason of setting it to 128 and possible root cause for such issue.
>
> Thanks and regards,
>
> Heyi
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why is USB_BOOT_IO_BLOCKS set to 128?
  2017-01-18  6:41   ` Heyi Guo
@ 2017-01-19  1:00     ` Tian, Feng
  2017-01-19  7:41       ` Heyi Guo
  0 siblings, 1 reply; 6+ messages in thread
From: Tian, Feng @ 2017-01-19  1:00 UTC (permalink / raw)
  To: Heyi Guo, edk2-devel@lists.01.org; +Cc: Zeng, Star, Tian, Feng

Hi, Heyi

Just I said before, it's just an experience value. 

The transfer length limitation only comes from real h/w and the largest transfer length shipped by SCSI Read10/Write10 cmd.

A SCSI Read10/Write10 cmd supports max 0xFFFF blocks. But according to our experience, some h/w devices don't have such big internal buffer to support read/write 0xFFFF blocks once. That's why we introduced a back-off algorithm in ScsiDiskDxe to handle such case. 

As for Usb cdrom/bot devices, we just directly use such a macro to specify the max transfer length. If you met real problem, please tell me the device model/serial no, then we can modify this value accordingly.

Thanks
Feng

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Heyi Guo
Sent: Wednesday, January 18, 2017 2:41 PM
To: Tian, Feng <feng.tian@intel.com>; edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>
Subject: Re: [edk2] Why is USB_BOOT_IO_BLOCKS set to 128?

Hi Feng,

Digging in the code history, I found the original value of USB_BOOT_IO_BLOCKS was 64, but it was changed to be 128 by the commit 41e8ff2. So could you help to explain my questions as below?

1. What was the exact reason to change this value?

2. And for the comment in the code, it says "Max carried size is 512B *
128 = 64KB", but we see that some USB CDROM has block size of 2KB. So do we mean something for 64KB max size?

3. From USB specification perspective, is there any limit for transfer length, or the device should be able to transfer arbitrary length?

commit 41e8ff2781f3ca14f73ef5f39e781ccba8cb373d
Author: yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Date:   Mon Oct 8 06:14:13 2007 +0000

     Fixed unexpected timeout in Usb MassStorage Driver.
     Fixed unexpected timeout in Uhci/Ehci driver.

     git-svn-id: 
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4038
6f19259b-4bc3-4df7-8a09-765794883524

Thanks and regards,

Heyi


在 10/19/2016 10:10 AM, Tian, Feng 写道:
> It's just an experience value and has been here about 10 years...
>
> Which usb brand/model name do you have problem on?
>
> Thanks
> Feng
>
> -----Original Message-----
> From: Heyi Guo [mailto:heyi.guo@linaro.org]
> Sent: Wednesday, October 19, 2016 9:57 AM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng <feng.tian@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] Why is USB_BOOT_IO_BLOCKS set to 128?
>
> Dear experts,
>
> Could anyone help to explain why USB_BOOT_IO_BLOCKS in MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h is set to 128?
>
> We found on some platforms this value may cause USB boot failure and
> *64* blocks will make them work. Though we have not got the final root cause, it will be really helpful if you can tell the reason of setting it to 128 and possible root cause for such issue.
>
> Thanks and regards,
>
> Heyi
>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why is USB_BOOT_IO_BLOCKS set to 128?
  2017-01-19  1:00     ` Tian, Feng
@ 2017-01-19  7:41       ` Heyi Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Heyi Guo @ 2017-01-19  7:41 UTC (permalink / raw)
  To: Tian, Feng, edk2-devel@lists.01.org; +Cc: Zeng, Star

Hi Feng,

This is a BMC emulated USB CDROM on a server platform, so there is no 
model or serial number for it.

For USB CDROM, we found that the block size is 2KB and then the transfer 
length will be 256KB (2KB * 128). Is this what we expect?

Thanks and regards,

Heyi


在 1/19/2017 9:00 AM, Tian, Feng 写道:
> Hi, Heyi
>
> Just I said before, it's just an experience value.
>
> The transfer length limitation only comes from real h/w and the largest transfer length shipped by SCSI Read10/Write10 cmd.
>
> A SCSI Read10/Write10 cmd supports max 0xFFFF blocks. But according to our experience, some h/w devices don't have such big internal buffer to support read/write 0xFFFF blocks once. That's why we introduced a back-off algorithm in ScsiDiskDxe to handle such case.
>
> As for Usb cdrom/bot devices, we just directly use such a macro to specify the max transfer length. If you met real problem, please tell me the device model/serial no, then we can modify this value accordingly.
>
> Thanks
> Feng
>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Heyi Guo
> Sent: Wednesday, January 18, 2017 2:41 PM
> To: Tian, Feng <feng.tian@intel.com>; edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>
> Subject: Re: [edk2] Why is USB_BOOT_IO_BLOCKS set to 128?
>
> Hi Feng,
>
> Digging in the code history, I found the original value of USB_BOOT_IO_BLOCKS was 64, but it was changed to be 128 by the commit 41e8ff2. So could you help to explain my questions as below?
>
> 1. What was the exact reason to change this value?
>
> 2. And for the comment in the code, it says "Max carried size is 512B *
> 128 = 64KB", but we see that some USB CDROM has block size of 2KB. So do we mean something for 64KB max size?
>
> 3. From USB specification perspective, is there any limit for transfer length, or the device should be able to transfer arbitrary length?
>
> commit 41e8ff2781f3ca14f73ef5f39e781ccba8cb373d
> Author: yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
> Date:   Mon Oct 8 06:14:13 2007 +0000
>
>       Fixed unexpected timeout in Usb MassStorage Driver.
>       Fixed unexpected timeout in Uhci/Ehci driver.
>
>       git-svn-id:
> https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4038
> 6f19259b-4bc3-4df7-8a09-765794883524
>
> Thanks and regards,
>
> Heyi
>
>
> 在 10/19/2016 10:10 AM, Tian, Feng 写道:
>> It's just an experience value and has been here about 10 years...
>>
>> Which usb brand/model name do you have problem on?
>>
>> Thanks
>> Feng
>>
>> -----Original Message-----
>> From: Heyi Guo [mailto:heyi.guo@linaro.org]
>> Sent: Wednesday, October 19, 2016 9:57 AM
>> To: edk2-devel@lists.01.org
>> Cc: Tian, Feng <feng.tian@intel.com>; Zeng, Star <star.zeng@intel.com>
>> Subject: [edk2] Why is USB_BOOT_IO_BLOCKS set to 128?
>>
>> Dear experts,
>>
>> Could anyone help to explain why USB_BOOT_IO_BLOCKS in MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h is set to 128?
>>
>> We found on some platforms this value may cause USB boot failure and
>> *64* blocks will make them work. Though we have not got the final root cause, it will be really helpful if you can tell the reason of setting it to 128 and possible root cause for such issue.
>>
>> Thanks and regards,
>>
>> Heyi
>>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-19  7:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-19  1:57 Why is USB_BOOT_IO_BLOCKS set to 128? Heyi Guo
2016-10-19  2:10 ` Tian, Feng
2016-10-20  1:35   ` Heyi Guo
2017-01-18  6:41   ` Heyi Guo
2017-01-19  1:00     ` Tian, Feng
2017-01-19  7:41       ` Heyi Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox