[edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Abort the Address Device cmd when time out

Wu, Hao A hao.a.wu at intel.com
Mon Sep 25 04:09:57 UTC 2023


Pushed via:
PR - https://github.com/tianocore/edk2/pull/4863
Commit - https://github.com/tianocore/edk2/commit/d11f0ea045f598e08b414eeba4f8a74ac1b4ca0b

Best Regards,
Hao Wu

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Wu, Hao
> A
> Sent: Thursday, September 21, 2023 2:17 PM
> To: Cai, Xianglei <xianglei.cai at intel.com>; devel at edk2.groups.io
> Cc: Ni, Ray <ray.ni at intel.com>; Wang, Jian J <jian.j.wang at intel.com>; Gao,
> Liming <gaoliming at byosoft.com.cn>; Shih, More <more.shih at intel.com>;
> Huang, Jenny <jenny.huang at intel.com>
> Subject: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Abort the
> Address Device cmd when time out
> 
> Reviewed-by: Hao A Wu <hao.a.wu at intel.com>
> 
> Best Regards,
> Hao Wu
> 
> > -----Original Message-----
> > From: Cai, Xianglei <xianglei.cai at intel.com>
> > Sent: Thursday, September 21, 2023 11:58 AM
> > To: devel at edk2.groups.io
> > Cc: Cai, Xianglei <xianglei.cai at intel.com>; Wu, Hao A
> <hao.a.wu at intel.com>;
> > Ni, Ray <ray.ni at intel.com>; Wang, Jian J <jian.j.wang at intel.com>; Gao,
> > Liming <gaoliming at byosoft.com.cn>; Shih, More <more.shih at intel.com>;
> > Huang, Jenny <jenny.huang at intel.com>
> > Subject: [PATCH V2 1/1] MdeModulePkg/XhciDxe: Abort the Address Device
> > cmd when time out
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=4552
> >
> > Following XHCI spec 4.6.1.2, software may abort the
> > execution of Address Device Command when command failed
> > due to timeout.
> >
> > Cc: Hao A Wu     <hao.a.wu at intel.com>
> > Cc: Ray Ni       <ray.ni at intel.com>
> > Cc: Jian J Wang  <jian.j.wang at intel.com>
> > Cc: Liming Gao   <gaoliming at byosoft.com.cn>
> > Cc: More Shih    <more.shih at intel.com>
> > Cc: Jenny Huang  <jenny.huang at intel.com>
> > Signed-off-by: Xianglei Cai <xianglei.cai at intel.com>
> > ---
> >  MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 36
> > ++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> >
> > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> > index 53421e64a850..f6efcf80f376 100644
> > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> > @@ -2121,6 +2121,26 @@ RingIntTransferDoorBell (
> >    return EFI_SUCCESS;
> >  }
> >
> > +/**
> > +  Set Command abort
> > +
> > +  @param  Xhc           The XHCI Instance.
> > +  @param  SlotId        The slot id to be disabled.
> > +
> > +**/
> > +VOID
> > +XhcCmdRingCmdAbort (
> > +  IN USB_XHCI_INSTANCE  *Xhc,
> > +  IN UINT8              SlotId
> > +  )
> > +{
> > +  //
> > +  // Set XHC_CRCR_CA bit in XHC_CRCR_OFFSET to abort command.
> > +  //
> > +  DEBUG ((DEBUG_INFO, "Command Ring Control set Command Abort,
> > SlotId: %d\n", SlotId));
> > +  XhcSetOpRegBit (Xhc, XHC_CRCR_OFFSET, XHC_CRCR_CA);
> > +}
> > +
> >  /**
> >    Assign and initialize the device slot for a new device.
> >
> > @@ -2331,6 +2351,14 @@ XhcInitializeDeviceSlot (
> >      Xhc->UsbDevContext[SlotId].XhciDevAddr = DeviceAddress;
> >    } else {
> >      DEBUG ((DEBUG_ERROR, "    Slot %d address not assigned successfully.
> > Status = %r\n", SlotId, Status));
> > +    //
> > +    // Software may abort the execution of Address Device Command when
> > command failed
> > +    // due to timeout by following XHCI spec. 4.6.1.2.
> > +    //
> > +    if (Status == EFI_TIMEOUT) {
> > +      XhcCmdRingCmdAbort (Xhc, SlotId);
> > +    }
> > +
> >      XhcDisableSlotCmd (Xhc, SlotId);
> >    }
> >
> > @@ -2547,6 +2575,14 @@ XhcInitializeDeviceSlot64 (
> >      Xhc->UsbDevContext[SlotId].XhciDevAddr = DeviceAddress;
> >    } else {
> >      DEBUG ((DEBUG_ERROR, "    Slot %d address not assigned successfully.
> > Status = %r\n", SlotId, Status));
> > +    //
> > +    // Software may abort the execution of Address Device Command when
> > command failed
> > +    // due to timeout by following XHCI spec. 4.6.1.2.
> > +    //
> > +    if (Status == EFI_TIMEOUT) {
> > +      XhcCmdRingCmdAbort (Xhc, SlotId);
> > +    }
> > +
> >      XhcDisableSlotCmd64 (Xhc, SlotId);
> >    }
> >
> > --
> > 2.42.0.windows.2
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109035): https://edk2.groups.io/g/devel/message/109035
Mute This Topic: https://groups.io/mt/101493909/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list