From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "brit.chesley@amd.com" <brit.chesley@amd.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>,
"Ni, Ray" <ray.ni@intel.com>
Subject: Re: [PATCH v1 1/1] MdeModulePkg: UsbBusDxe: Build Descriptor table after resetting port
Date: Tue, 6 Jun 2023 03:14:07 +0000 [thread overview]
Message-ID: <DM6PR11MB402568F1EBCD1FE755D3ABE8CA52A@DM6PR11MB4025.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230516221557.471-1-brit.chesley@amd.com>
Sorry for the late response, inline comments below:
> -----Original Message-----
> From: brit.chesley@amd.com <brit.chesley@amd.com>
> Sent: Wednesday, May 17, 2023 6:16 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray
> <ray.ni@intel.com>
> Subject: [PATCH v1 1/1] MdeModulePkg: UsbBusDxe: Build Descriptor table
> after resetting port
>
> From: Britton Chesley <Brit.Chesley@amd.com>
>
> Fixed a bug which led to an ASSERT due to the USB device context being
> maintained after a port reset, but the underlying XHCI context was
> uninitialized. Added build descriptor table call in UsbIoPortReset
Could you help to elaborate on what data in XHCI is not initialized that leads to the assert? Thanks.
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Britton Chesley <Brit.Chesley@amd.com>
> ---
> MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> index c25f3cc2f279..55e0e1f16cdb 100644
> --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> @@ -882,6 +882,12 @@ UsbIoPortReset (
> // is in CONFIGURED state.
> //
> if (Dev->ActiveConfig != NULL) {
> + Status = UsbBuildDescTable (Dev);
The UsbBuildDescTable function will allocate new buffer resources for and under Dev->DevDesc (device, configuration and interface descriptors).
Could you help to double check if the old buffers are properly freed for the proposed change?
Best Regards,
Hao Wu
> +
> + if (EFI_ERROR (Status)) {
> + DEBUG ((DEBUG_ERROR, "UsbIoPortReset: failed to build descriptor
> table - %r\n", Status));
> + }
> +
> Status = UsbSetConfig (Dev, Dev->ActiveConfig-
> >Desc.ConfigurationValue);
>
> if (EFI_ERROR (Status)) {
> --
> 2.36.1
next prev parent reply other threads:[~2023-06-06 3:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 22:15 [PATCH v1 1/1] MdeModulePkg: UsbBusDxe: Build Descriptor table after resetting port brit.chesley
2023-06-06 3:14 ` Wu, Hao A [this message]
2023-06-28 23:38 ` [edk2-devel] " Mike Maslenkin
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=DM6PR11MB402568F1EBCD1FE755D3ABE8CA52A@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