From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AC7932264A205 for ; Wed, 4 Apr 2018 01:09:58 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2018 01:09:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,405,1517904000"; d="scan'208,217";a="213794261" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 04 Apr 2018 01:09:56 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 4 Apr 2018 01:09:56 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 4 Apr 2018 01:09:55 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.61]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.88]) with mapi id 14.03.0319.002; Wed, 4 Apr 2018 16:09:54 +0800 From: "Zeng, Star" To: Rob Taglang , Laszlo Ersek CC: "Ni, Ruiyu" , "edk2-devel@lists.01.org" , Ming Huang , "Zeng, Star" Thread-Topic: [edk2] OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES Thread-Index: AQHTys+2Tf5Gg/fAXkKm5FD/OS/nK6PuZ/KAgAA4OwCAAAroAIAAEHaAgAGHWlA= Date: Wed, 4 Apr 2018 08:09:53 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BA882AB@shsmsx102.ccr.corp.intel.com> References: <1522707137.3698.1@server175.web-hosting.com> <1522768252.6404.0@server175.web-hosting.com> <1522770594.6404.1@server175.web-hosting.com> <1522774129.6404.2@server175.web-hosting.com> In-Reply-To: <1522774129.6404.2@server175.web-hosting.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.26 Subject: Re: OVMF UsbBulkTransfer returns EFI_OUT_OF_RESOURCES X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 08:09:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Good news. Thanks, Star From: Rob Taglang [mailto:rob@taglang.io] Sent: Wednesday, April 4, 2018 12:49 AM To: Laszlo Ersek Cc: Ni, Ruiyu ; edk2-devel@lists.01.org; Ming Huang ; Zeng, Star 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 calcul= ated 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 vari= able 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 > wrote: My apologies, it looks like the first link got messed up: https://sourcefor= ge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip/download -Rob On Tue, A= pr 3, 2018 at 11:10 AM, Rob Taglang >= wrote: Hi Lazlo, I have tried this with both the very old OVMF-X64-r15214.zip host= ed on SourceForge: edk2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rp= m And what I believe is the most recent OVMF hosted in the kraxel repo: edk= 2.git-ovmf-x64-0-20180226.b3485.gb1956b5d42.noarch.rpm And I see the same b= ehavior in both. The USB device is a proprietary CDC_ACM device. I have tes= ted on this motherboard: http://www.supermicro.com/products/motherboard/ato= m/x10/a1sri-2758f.cfm whose UEFI firmware does appear to be based on EDK an= d everything works as expected. Thanks, Rob On Tue, Apr 3, 2018 at 7:49 AM,= Laszlo Ersek > 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 endpoint= s 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 modif= ied various timeouts and transfer block sizes. For example: [edk2] [MdeModu= lePkg/Usb v2 0/1] Calculating the count of blocks to transfer Committed at = . 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 physi= cal platform firmware). Thanks! Laszlo _______________________________________________ edk2-devel mailing list edk= 2-devel@lists.01.org https://lists.01.org/m= ailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk= 2-devel@lists.01.org https://lists.01.org/m= ailman/listinfo/edk2-devel