public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"jdzhang@kunluntech.com.cn" <jdzhang@kunluntech.com.cn>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/Bus/Pci/XhciDxe: Fix the Bug of clean InputContext in XhcEvaluateContext64();
Date: Wed, 14 Sep 2022 08:31:50 +0000	[thread overview]
Message-ID: <DM6PR11MB40251208CC29B0BF2F20A346CA469@DM6PR11MB4025.namprd11.prod.outlook.com> (raw)
In-Reply-To: <jLnJ.1663139687887555664.HOSE@groups.io>

[-- Attachment #1: Type: text/plain, Size: 2492 bytes --]

Hello,

For the proposed patch, may I know what kind of issue was met?

After referring to the xHCI spec, my take is that the “Input Context” is different (and should be re-initialed) for each xHC command.

1. Under section 4.6.5 Address Device of the xHCI 1.1 spec:
The Add Context flags A0 and A1 of the Input Control Context data structure (in the Input Context) shall be
set to ‘1’, and all remaining Add Context and Drop Context flags shall all be cleared to ‘0’.

System software shall initialize Slot Context and Endpoint Context 0 entries of the Input Context. All other
Endpoint Contexts in the Input Context shall be ignored by the xHC during the execution of this command.

2. And for section 4.6.7 Evaluate Context:
The state of the Add Context flags depends on the specific endpoints
affected by the command. All Drop Context flags of the Input Control Context shall be cleared to ‘0’ (these
flags do not apply to the Evaluate Context Command). System software shall initialize Contexts of the
Input Context affected by the command. All Contexts not referenced by an Add Context flag in the Input
Context are ignored by the xHC.

Could you help to provide more information for the background of the patch? Thanks in advance.

Best Regards,
Hao Wu

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jiading Zhang
Sent: Wednesday, September 14, 2022 3:15 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH] MdeModulePkg/Bus/Pci/XhciDxe: Fix the Bug of clean InputContext in XhcEvaluateContext64();

The value of InputContext structure is initialized in XhcInitializeDeviceSlot/XhcInitializeDeviceSlot64, it shouldn't be cleared when used in XhcEvaluateContext64().

Signed-off-by: jdzhang <jdzhang@kunluntech.com.cn<mailto:jdzhang@kunluntech.com.cn>>
---
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index c2906e06fd..efbbe247c1 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -4021,7 +4021,6 @@ XhcEvaluateContext64 (
   // 4.6.7 Evaluate Context
   //
   InputContext = Xhc->UsbDevContext[SlotId].InputContext;
-  ZeroMem (InputContext, sizeof (INPUT_CONTEXT_64));

   InputContext->InputControlContext.Dword2 |= BIT1;
   InputContext->EP[0].MaxPacketSize         = MaxPacketSize;
--
2.20.1.windows.1



[-- Attachment #2: Type: text/html, Size: 6956 bytes --]

  reply	other threads:[~2022-09-14  8:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14  7:14 [PATCH] MdeModulePkg/Bus/Pci/XhciDxe: Fix the Bug of clean InputContext in XhcEvaluateContext64(); Jiading Zhang
2022-09-14  8:31 ` Wu, Hao A [this message]
2022-09-14  9:23   ` [edk2-devel] " Jiading Zhang
2022-09-15  3:26     ` Wu, Hao A
2022-09-20  0:46       ` Jiading Zhang
2022-09-20  3:03         ` Wu, Hao A
2022-09-20  3:16           ` Wu, Hao A
2022-09-20  5:59             ` Jiading Zhang
2022-09-20  6:27               ` Wu, Hao A
2022-09-20 10:00                 ` Jiading Zhang
2022-09-21  1:34                   ` Wu, Hao A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR11MB40251208CC29B0BF2F20A346CA469@DM6PR11MB4025.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox