public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "Jiang, Guomin" <guomin.jiang@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>, "Ni, Ray" <ray.ni@intel.com>
Subject: Re: [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table after Reset Device
Date: Sun, 26 Apr 2020 05:09:42 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A093C9F807D@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20200425013620.1159-1-guomin.jiang@intel.com>

> -----Original Message-----
> From: Jiang, Guomin
> Sent: Saturday, April 25, 2020 9:36 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> Subject: [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table
> after Reset Device
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2694
> 
> When the USB fail and then Reset Device, it should rebuild description.
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
>  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> index 4b4915c019..9f2d2cc87f 100644
> --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> @@ -869,6 +869,11 @@ UsbIoPortReset (
> 
> 
>    DEBUG (( EFI_D_INFO, "UsbIoPortReset: device is now ADDRESSED
> at %d\n", Dev->Address));
> 
> 
> 
> +  //
> 
> +  // The description will be invalid after reset, should rebuild it as well.
> 
> +  //
> 
> +  UsbBuildDescTable (Dev);


Hello Guomin,

Thanks for the proposed patch.

Could you help to explain in more detail for the above fix with regard to the
transfer ring not being set properly in the XHCI driver? Thanks.

Also, judging from the function description comments in UsbBuildDescTable():
|>  /**
|>    Build the whole array of descriptors. This function must
|>    be called after UsbGetMaxPacketSize0 returns the max packet
|>    size correctly for endpoint 0.
|>  ...
|>  **/
|>  EFI_STATUS
|>  UsbBuildDescTable (
|>    IN USB_DEVICE           *UsbDev
|>    )

Does function UsbGetMaxPacketSize0() need to be called before
UsbBuildDescTable() in the proposed fix?

Best Regards,
Hao Wu


> 
> +
> 
>    //
> 
>    // Reset the current active configure, after this device
> 
>    // is in CONFIGURED state.
> 
> --
> 2.25.1.windows.1


  reply	other threads:[~2020-04-26  5:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25  1:36 [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table after Reset Device Guomin Jiang
2020-04-26  5:09 ` Wu, Hao A [this message]
2020-04-26  5:12   ` [edk2-devel] " Wu, Hao A
2020-04-26  6:43     ` Guomin Jiang
2020-04-26  8:03       ` Wu, Hao A
2020-04-26 13:04         ` Guomin Jiang
2020-04-27  1:36           ` Wu, Hao A
2020-04-28  1:03             ` Jeremy Linton
2020-04-28  1:14             ` Guomin Jiang
2020-04-28  2:31               ` Jeremy Linton
2020-04-28  3:22                 ` Guomin Jiang
     [not found]                 ` <1609DDC63BB4AEBF.19313@groups.io>
2020-04-30  9:47                   ` Guomin Jiang

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=B80AF82E9BFB8E4FBD8C89DA810C6A093C9F807D@SHSMSX104.ccr.corp.intel.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