From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp01.apple.com (ma1-aaemail-dr-lapp01.apple.com [17.171.2.60]) by mx.groups.io with SMTP id smtpd.web11.5747.1626540932193544216 for ; Sat, 17 Jul 2021 09:55:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=Xa9P63d1; spf=pass (domain: apple.com, ip: 17.171.2.60, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp01.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp01.apple.com (8.16.0.42/8.16.0.42) with SMTP id 16HGqwG9005259; Sat, 17 Jul 2021 09:55:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=20180706; bh=q2eLABuhvIXvwsKO0WL4ewbIXLR2iMvsBBX69B5QZoA=; b=Xa9P63d1IzUQPMIQcwMTy7kyrfpaUVmh14nQq9/kn8kzWf9GVN37K9IPxfXqvRV9V2Oh UxdGZr8H1blngvhJiH3VK7tqaAgza6mUJHNwKbtOBAS0qMmScgjdB3BGPZHgH8A1Rz+w wJAiofPYfXIqR1XDg3un4TqiZXXvL4j8AtkSODazKn4cBeoGnbTwCt0cKzX0CO3KkDBt dJjevv50o1fALt32hCoYPIgaGKo0ASzdST/uyxUymN90EaernCGa1KLU7W3Re6/jU+60 3YQZpEauXzxS3xtzXa01d6HFnUPk20ZfK7NqWHRK/vh5eO7pob6uvIWfw4Q4t/ld2V3j Ug== Received: from rn-mailsvcp-mta-lapp01.rno.apple.com (rn-mailsvcp-mta-lapp01.rno.apple.com [10.225.203.149]) by ma1-aaemail-dr-lapp01.apple.com with ESMTP id 39uwv1mg90-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sat, 17 Jul 2021 09:55:31 -0700 Received: from rn-mailsvcp-mmp-lapp02.rno.apple.com (rn-mailsvcp-mmp-lapp02.rno.apple.com [17.179.253.15]) by rn-mailsvcp-mta-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) with ESMTPS id <0QWE00HI9F0IPP60@rn-mailsvcp-mta-lapp01.rno.apple.com>; Sat, 17 Jul 2021 09:55:30 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp02.rno.apple.com by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) id <0QWE00Z00EP70T00@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Sat, 17 Jul 2021 09:55:30 -0700 (PDT) X-Va-A: X-Va-T-CD: b2a6e213b1e93bac3561a11ee6934d40 X-Va-E-CD: ceead604d3dc9934217bd7086a0ba750 X-Va-R-CD: 72c81322cf6c0a93c7689898bb33f8a8 X-Va-CD: 0 X-Va-ID: 6b8dd041-5850-4bac-86c6-96ea10ad6655 X-V-A: X-V-T-CD: b2a6e213b1e93bac3561a11ee6934d40 X-V-E-CD: ceead604d3dc9934217bd7086a0ba750 X-V-R-CD: 72c81322cf6c0a93c7689898bb33f8a8 X-V-CD: 0 X-V-ID: 88950ccc-5acd-444e-b7c9-c816a18bb7cd X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-17_07:2021-07-16,2021-07-17 signatures=0 Received: from [17.235.34.166] (unknown [17.235.34.166]) by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) with ESMTPSA id <0QWE0043NF0HO900@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Sat, 17 Jul 2021 09:55:30 -0700 (PDT) MIME-version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.1\)) Subject: Re: OpenProtocol() giving me EFI_INVALID_PARAMETER From: "Andrew Fish" In-reply-to: Date: Sat, 17 Jul 2021 09:55:29 -0700 Cc: devel@edk2.groups.io, "Leif Lindholm (Nuvia address)" , Ray Ni Message-id: <88AE4AB4-12BA-433C-9EA4-EDC01B30DAD1@apple.com> References: To: Ethin Probst X-Mailer: Apple Mail (2.3654.20.0.2.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-17_07:2021-07-16,2021-07-17 signatures=0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable > On Jul 17, 2021, at 9:41 AM, Ethin Probst = wrote: >=20 > Hey all, >=20 > So my UsbAudio.efi app has hit a bit of a roadblock. This code: >=20 > ```C > status =3D st->BootServices->OpenProtocol(handles[i], > &gEfiUsbIoProtocolGuid, (void**)&UsbIo, imageHandle, NULL, > EFI_OPEN_PROTOCOL_EXCLUSIVE); > if (EFI_ERROR(status)) { > Print(L"%r, skipping\n", status); > continue; > } > ``` How are you constructing handle[]? Could it have gotten stale? You could = print out the value of handle[I] on the failure. The contents of a handle are not defined, but the current implementation = is a pointer to an IHANDLE internal data structure in the DXE Core. If = you are at the UEFI Shell and you `dh -v it will show the = and the value.=20 Shell> dh -v 98 98: 6d5CF18 =E2=80=A6. I think you can `dh -p UsbIo=E2=80=99 to get the list of the UsbIo = handles.=20 So you can poke around and see what is happening on that handle.=20 I guess the handle[] array could be getting corrupted? So you could = check for that?=20 Thanks, Andrew Fish > Is giving me EFI_INVALID_PARAMETER and I don=E2=80=99t know why. I = don't think > I'm violating any of its constraints, according to the specification, > and I haven't touched this code since it was written. It also happens > irregularly: sometimes it happens on the USB audio streaming device, > or if I have a device plugged in it might happen on that device, you > get the idea. But it doesn't consistently fail. Does anybody have any > idea what's going on? >=20 > --=20 > Signed, > Ethin D. Probst