public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES
@ 2018-04-02 22:12 Rob Taglang
  2018-04-03 11:49 ` Laszlo Ersek
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Taglang @ 2018-04-02 22:12 UTC (permalink / raw)
  To: edk2-devel

Hello,

I can pass a host USB device to QEMU boot with OVMF, and it shows up as 
a EFI_USB_IO_PROTOCOL device and the interface descriptors and 
endpoints are detected correctly. A UsbControlTransfer operation 
succeeds. However, UsbBulkTransfer returns EFI_OUT_OF_RESOURCES 
regardless of how much memory I allocate for QEMU.

This application does work correctly on real hardware. Is this expected 
behavior in OVMF?

Thanks,
Rob


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

* Re: OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES
  2018-04-02 22:12 OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES Rob Taglang
@ 2018-04-03 11:49 ` Laszlo Ersek
  2018-04-03 15:10   ` Rob Taglang
  0 siblings, 1 reply; 6+ messages in thread
From: Laszlo Ersek @ 2018-04-03 11:49 UTC (permalink / raw)
  To: Rob Taglang; +Cc: edk2-devel, Ming Huang, Star Zeng, Ruiyu Ni

Hi Rob,

On 04/03/18 00:12, Rob Taglang wrote:
> Hello,
> 
> I can pass a host USB device to QEMU boot with OVMF, and it shows up as
> a EFI_USB_IO_PROTOCOL device and the interface descriptors and endpoints
> are detected correctly. A UsbControlTransfer operation succeeds.
> However, UsbBulkTransfer returns EFI_OUT_OF_RESOURCES regardless of how
> much memory I allocate for QEMU.
> 
> This application does work correctly on real hardware. Is this expected
> behavior in OVMF?

I seem to recall recent patches for the core USB drivers in edk2 that
modified various timeouts and transfer block sizes. For example:

  [edk2] [MdeModulePkg/Usb v2 0/1] Calculating the count of blocks to
                                   transfer

Committed at
<https://github.com/tianocore/edk2/commit/824b6e3b5fa080df36626db3eb8465c25a12c053>.

Can you try a fresh edk2 build, and/or state git commit hashes at which
the tree does or does not work for you?

It would also be interesting to know the exact USB device (vendor, model
etc) that produces this issue for you. Chances are the edk2 USB drivers
would have the same issue if they encountered your device on the bare
metal (i.e. with edk2 running as physical platform firmware).

Thanks!
Laszlo


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

* Re: OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES
  2018-04-03 11:49 ` Laszlo Ersek
@ 2018-04-03 15:10   ` Rob Taglang
  2018-04-03 15:49     ` Rob Taglang
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Taglang @ 2018-04-03 15:10 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: edk2-devel, Ming Huang, Star Zeng, Ruiyu Ni

Hi Lazlo,

I have tried this with both the very old OVMF-X64-r15214.zip hosted on 
SourceForge: edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm

And what I believe is the most recent OVMF hosted in the kraxel repo: 
edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm

And I see the same behavior in both.

The USB device is a proprietary CDC_ACM device. I have tested on this 
motherboard: 
http://www.supermicro.com/products/motherboard/atom/x10/a1sri-2758f.cfm
whose UEFI firmware does appear to be based on EDK and everything works 
as expected.

Thanks,
Rob

On Tue, Apr 3, 2018 at 7:49 AM, Laszlo Ersek <lersek@redhat.com> wrote:
> Hi Rob,
> 
> On 04/03/18 00:12, Rob Taglang wrote:
>>  Hello,
>> 
>>  I can pass a host USB device to QEMU boot with OVMF, and it shows 
>> up as
>>  a EFI_USB_IO_PROTOCOL device and the interface descriptors and 
>> endpoints
>>  are detected correctly. A UsbControlTransfer operation succeeds.
>>  However, UsbBulkTransfer returns EFI_OUT_OF_RESOURCES regardless of 
>> how
>>  much memory I allocate for QEMU.
>> 
>>  This application does work correctly on real hardware. Is this 
>> expected
>>  behavior in OVMF?
> 
> I seem to recall recent patches for the core USB drivers in edk2 that
> modified various timeouts and transfer block sizes. For example:
> 
>   [edk2] [MdeModulePkg/Usb v2 0/1] Calculating the count of blocks to
>                                    transfer
> 
> Committed at
> <https://github.com/tianocore/edk2/commit/824b6e3b5fa080df36626db3eb8465c25a12c053>.
> 
> Can you try a fresh edk2 build, and/or state git commit hashes at 
> which
> the tree does or does not work for you?
> 
> It would also be interesting to know the exact USB device (vendor, 
> model
> etc) that produces this issue for you. Chances are the edk2 USB 
> drivers
> would have the same issue if they encountered your device on the bare
> metal (i.e. with edk2 running as physical platform firmware).
> 
> Thanks!
> Laszlo





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

* Re: OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES
  2018-04-03 15:10   ` Rob Taglang
@ 2018-04-03 15:49     ` Rob Taglang
  2018-04-03 16:48       ` Rob Taglang
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Taglang @ 2018-04-03 15:49 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: Ruiyu Ni, edk2-devel, Ming Huang, Star Zeng

My apologies, it looks like the first link got messed up: 
https://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip/download

-Rob

On Tue, Apr 3, 2018 at 11:10 AM, Rob Taglang <rob@taglang.io> wrote:
> Hi Lazlo,
> 
> I have tried this with both the very old OVMF-X64-r15214.zip hosted 
> on SourceForge: 
> edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm
> 
> And what I believe is the most recent OVMF hosted in the kraxel repo: 
> edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm
> 
> And I see the same behavior in both.
> 
> The USB device is a proprietary CDC_ACM device. I have tested on this 
> motherboard: 
> http://www.supermicro.com/products/motherboard/atom/x10/a1sri-2758f.cfm
> whose UEFI firmware does appear to be based on EDK and everything 
> works as expected.
> 
> Thanks,
> Rob
> 
> On Tue, Apr 3, 2018 at 7:49 AM, Laszlo Ersek <lersek@redhat.com> 
> wrote:
>> Hi Rob,
>> 
>> On 04/03/18 00:12, Rob Taglang wrote:
>>>  Hello,
>>> 
>>>  I can pass a host USB device to QEMU boot with OVMF, and it shows 
>>> up as
>>>  a EFI_USB_IO_PROTOCOL device and the interface descriptors and 
>>> endpoints
>>>  are detected correctly. A UsbControlTransfer operation succeeds.
>>>  However, UsbBulkTransfer returns EFI_OUT_OF_RESOURCES regardless 
>>> of how
>>>  much memory I allocate for QEMU.
>>> 
>>>  This application does work correctly on real hardware. Is this 
>>> expected
>>>  behavior in OVMF?
>> 
>> I seem to recall recent patches for the core USB drivers in edk2 that
>> modified various timeouts and transfer block sizes. For example:
>> 
>>   [edk2] [MdeModulePkg/Usb v2 0/1] Calculating the count of blocks to
>>                                    transfer
>> 
>> Committed at
>> <https://github.com/tianocore/edk2/commit/824b6e3b5fa080df36626db3eb8465c25a12c053>.
>> 
>> Can you try a fresh edk2 build, and/or state git commit hashes at 
>> which
>> the tree does or does not work for you?
>> 
>> It would also be interesting to know the exact USB device (vendor, 
>> model
>> etc) that produces this issue for you. Chances are the edk2 USB 
>> drivers
>> would have the same issue if they encountered your device on the bare
>> metal (i.e. with edk2 running as physical platform firmware).
>> 
>> Thanks!
>> Laszlo
> 
> 
> 
> _______________________________________________
> 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: OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES
  2018-04-03 15:49     ` Rob Taglang
@ 2018-04-03 16:48       ` Rob Taglang
  2018-04-04  8:09         ` Zeng, Star
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Taglang @ 2018-04-03 16:48 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: Ruiyu Ni, edk2-devel, Ming Huang, Star Zeng

Hello,

Thanks for you help, I got to the bottom of it.

I was passing a pointer to an unsigned int (note, not UINTN) as the 
length. Some garbage in the top bits was getting shifted in and causing 
the calculated number of pages to be very large in RootBridgeIoMap, 
hence the OUT_OF_RESOURCES. Copying the length to a UINTN and passing a 
pointer to that variable works correctly. I must have just been getting 
lucky with the top bits being zeroed out when running on real hardware.

Again thank you,
-Rob

On Tue, Apr 3, 2018 at 11:49 AM, Rob Taglang <rob@taglang.io> wrote:
> My apologies, it looks like the first link got messed up: 
> https://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip/download
> 
> -Rob
> 
> On Tue, Apr 3, 2018 at 11:10 AM, Rob Taglang <rob@taglang.io> wrote:
>> Hi Lazlo,
>> 
>> I have tried this with both the very old OVMF-X64-r15214.zip hosted 
>> on SourceForge: 
>> edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm
>> 
>> And what I believe is the most recent OVMF hosted in the kraxel 
>> repo: edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm
>> 
>> And I see the same behavior in both.
>> 
>> The USB device is a proprietary CDC_ACM device. I have tested on 
>> this motherboard: 
>> http://www.supermicro.com/products/motherboard/atom/x10/a1sri-2758f.cfm
>> whose UEFI firmware does appear to be based on EDK and everything 
>> works as expected.
>> 
>> Thanks,
>> Rob
>> 
>> On Tue, Apr 3, 2018 at 7:49 AM, Laszlo Ersek <lersek@redhat.com> 
>> wrote:
>>> Hi Rob,
>>> 
>>> On 04/03/18 00:12, Rob Taglang wrote:
>>>>  Hello,
>>>> 
>>>>  I can pass a host USB device to QEMU boot with OVMF, and it shows 
>>>> up as
>>>>  a EFI_USB_IO_PROTOCOL device and the interface descriptors and 
>>>> endpoints
>>>>  are detected correctly. A UsbControlTransfer operation succeeds.
>>>>  However, UsbBulkTransfer returns EFI_OUT_OF_RESOURCES regardless 
>>>> of how
>>>>  much memory I allocate for QEMU.
>>>> 
>>>>  This application does work correctly on real hardware. Is this 
>>>> expected
>>>>  behavior in OVMF?
>>> 
>>> I seem to recall recent patches for the core USB drivers in edk2 
>>> that
>>> modified various timeouts and transfer block sizes. For example:
>>> 
>>>   [edk2] [MdeModulePkg/Usb v2 0/1] Calculating the count of blocks 
>>> to
>>>                                    transfer
>>> 
>>> Committed at
>>> <https://github.com/tianocore/edk2/commit/824b6e3b5fa080df36626db3eb8465c25a12c053>.
>>> 
>>> Can you try a fresh edk2 build, and/or state git commit hashes at 
>>> which
>>> the tree does or does not work for you?
>>> 
>>> It would also be interesting to know the exact USB device (vendor, 
>>> model
>>> etc) that produces this issue for you. Chances are the edk2 USB 
>>> drivers
>>> would have the same issue if they encountered your device on the 
>>> bare
>>> metal (i.e. with edk2 running as physical platform firmware).
>>> 
>>> Thanks!
>>> Laszlo
>> 
>> 
>> 
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
> 
> 
> 
> _______________________________________________
> 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: OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES
  2018-04-03 16:48       ` Rob Taglang
@ 2018-04-04  8:09         ` Zeng, Star
  0 siblings, 0 replies; 6+ messages in thread
From: Zeng, Star @ 2018-04-04  8:09 UTC (permalink / raw)
  To: Rob Taglang, Laszlo Ersek
  Cc: Ni, Ruiyu, edk2-devel@lists.01.org, Ming Huang, Zeng, Star

Good news.

Thanks,
Star
From: Rob Taglang [mailto:rob@taglang.io]
Sent: Wednesday, April 4, 2018 12:49 AM
To: Laszlo Ersek <lersek@redhat.com>
Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org; Ming Huang <ming.huang@linaro.org>; Zeng, Star <star.zeng@intel.com>
Subject: Re: [edk2] OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES

Hello,

Thanks for you help, I got to the bottom of it.

I was passing a pointer to an unsigned int (note, not UINTN) as the length. Some garbage in the top bits was getting shifted in and causing the calculated number of pages to be very large in RootBridgeIoMap, hence the OUT_OF_RESOURCES. Copying the length to a UINTN and passing a pointer to that variable works correctly. I must have just been getting lucky with the top bits being zeroed out when running on real hardware.

Again thank you,
-Rob

On Tue, Apr 3, 2018 at 11:49 AM, Rob Taglang <rob@taglang.io<mailto:rob@taglang.io>> wrote:

My apologies, it looks like the first link got messed up: https://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip/download -Rob On Tue, Apr 3, 2018 at 11:10 AM, Rob Taglang <rob@taglang.io<mailto:rob@taglang.io>> wrote:
Hi Lazlo, I have tried this with both the very old OVMF-X64-r15214.zip hosted on SourceForge: edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm And what I believe is the most recent OVMF hosted in the kraxel repo: edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm And I see the same behavior in both. The USB device is a proprietary CDC_ACM device. I have tested on this motherboard: http://www.supermicro.com/products/motherboard/atom/x10/a1sri-2758f.cfm whose UEFI firmware does appear to be based on EDK and everything works as expected. Thanks, Rob On Tue, Apr 3, 2018 at 7:49 AM, Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>> wrote:
Hi Rob, On 04/03/18 00:12, Rob Taglang wrote:
Hello, I can pass a host USB device to QEMU boot with OVMF, and it shows up as a EFI_USB_IO_PROTOCOL device and the interface descriptors and endpoints are detected correctly. A UsbControlTransfer operation succeeds. However, UsbBulkTransfer returns EFI_OUT_OF_RESOURCES regardless of how much memory I allocate for QEMU. This application does work correctly on real hardware. Is this expected behavior in OVMF?
I seem to recall recent patches for the core USB drivers in edk2 that modified various timeouts and transfer block sizes. For example: [edk2] [MdeModulePkg/Usb v2 0/1] Calculating the count of blocks to transfer Committed at <https://github.com/tianocore/edk2/commit/824b6e3b5fa080df36626db3eb8465c25a12c053>. Can you try a fresh edk2 build, and/or state git commit hashes at which the tree does or does not work for you? It would also be interesting to know the exact USB device (vendor, model etc) that produces this issue for you. Chances are the edk2 USB drivers would have the same issue if they encountered your device on the bare metal (i.e. with edk2 running as physical platform firmware). Thanks! Laszlo
_______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org<mailto: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:[~2018-04-04  8:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-02 22:12 OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES Rob Taglang
2018-04-03 11:49 ` Laszlo Ersek
2018-04-03 15:10   ` Rob Taglang
2018-04-03 15:49     ` Rob Taglang
2018-04-03 16:48       ` Rob Taglang
2018-04-04  8:09         ` Zeng, Star

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