From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/Bus/Pci/XhciDxe: Fix the Bug of clean InputContext in XhcEvaluateContext64(); To: Wu, Hao A ,devel@edk2.groups.io From: "Jiading Zhang" X-Originating-Location: Tokyo, JP (192.109.233.224) X-Originating-Platform: Windows Chrome 105 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 14 Sep 2022 02:23:01 -0700 References: In-Reply-To: Message-ID: <10580.1663147381171837795@groups.io> Content-Type: multipart/alternative; boundary="MQmh37PcvubmOnWpaRyy" --MQmh37PcvubmOnWpaRyy Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable When I use the newest XhciDxe driver in Phytium Platform( ARM) ,=C2=A0 I fo= und if clearing =E2=80=9CInput Context=E2=80=9D=C2=A0in XhcEvaluateContext6= 4(), the usb KB doesn't work, and mark the=C2=A0 code=C2=A0=C2=A0=C2=A0Zero= Mem (InputContext, sizeof (INPUT_CONTEXT_64)); =C2=A0it works. I viewed the code again, maybe change the ZeroMem (InputContext, sizeof (IN= PUT_CONTEXT_64)); to ZeroMem (InputContext, sizeof (INPUT_CONTRL_CONTEXT_64= )); is more resonable.=C2=A0 Because when clearing the INPUT_CONTEXT_64, th= e Slot context and the endpoint context are cleared too. But according the = xHCI Spec section 6.2.2 Note=EF=BC=9AUnless otherwise stated: As Input, all fields of the Slot Cont= ext shall be initialized to the appropriate value by software before issuin= g a command. And I test again, just clear INPUT_CONTRL_CONTEXT_64 is OK. --MQmh37PcvubmOnWpaRyy Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable When I use the newest XhciDxe driver in Phytium Platform( ARM) ,  I fo= und if clearing “Input Context” in XhcEvaluateContext64(),= the usb KB doesn't work, and mark the  code   ZeroMem = (InputContext, sizeof (INPUT_CONTEXT_64));  it works. 
I vie= wed the code again, maybe change the ZeroMem (InputContext, sizeof (INPUT_C= ONTEXT_64)); to ZeroMem (InputContext, sizeof (INPUT_CONTRL_CONTEXT_64)); i= s more resonable.  Because when clearing the INPUT_CONTEXT_64, the Slo= t context and the endpoint context are cleared too. But according the xHCI = Spec section 6.2.2 
Note=EF=BC=9AUnless otherwise stated: As Inpu= t, all fields of the Slot Context shall be initialized to the appropriate v= alue by software before issuing a command.
And I test again, just clea= r INPUT_CONTRL_CONTEXT_64 is OK.
--MQmh37PcvubmOnWpaRyy--