> -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Ni, > Ray > Sent: Thursday, August 01, 2019 12:51 AM > To: devel@edk2.groups.io; m...@semihalf.com > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org; j...@semihalf.com; > j...@semihalf.com; Tian, Feng; Kinney, Michael D; Gao, Liming; > ler...@redhat.com > Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBusDxe: Return error > when the device is not present > > Marcin, > What does the failure look like without your fix?
>From my observation of the code: A. Changes are made in UsbEnumerateNewDev(); B. Caller of UsbEnumerateNewDev(): UsbEnumeratePort(); C. UsbEnumeratePort() directly returns the status from UsbEnumerateNewDev() as its own return value; D. Callers of UsbEnumeratePort(): UsbHubEnumeration() and UsbRootHubEnumeration(); E. Both of them do not care about the return status from UsbEnumeratePort(). I think there is no direct failure without the proposed fix. However, let us wait the confirmation from Marcin. Also, I think the proposed patch is a good refinement. If future updates to the driver requires checking the return status during the above code path, then proper status will be returned. Best Regards, Hao Wu > > Thanks, > Ray > > > -----Original Message----- > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > Marcin Wojtas > > Sent: Wednesday, July 31, 2019 2:25 PM > > To: devel@edk2.groups.io > > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org; > m...@semihalf.com; j...@semihalf.com; j...@semihalf.com; Tian, Feng > > <feng.t...@intel.com>; Kinney, Michael D <michael.d.kin...@intel.com>; > Gao, Liming <liming....@intel.com>; > > ler...@redhat.com > > Subject: [edk2-devel] [PATCH] MdeModulePkg/UsbBusDxe: Return error > when the device is not present > > > > Until now, during the USB device enumeration when its PortState > > USB_PORT_STAT_CONNECTION bit was not set, the stack was not > informed > > that the device is not present. Fix that by returning appropriate > > error code. > > > > Change-Id: I588f82b987993e9755f64ce76cde9eb690ef1d54 > > Signed-off-by: Marcin Wojtas <m...@semihalf.com> > > --- > > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > > index be9d9bd..ab1db15 100644 > > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > > @@ -719,6 +719,7 @@ UsbEnumerateNewDev ( > > > > if (!USB_BIT_IS_SET (PortState.PortStatus, > USB_PORT_STAT_CONNECTION)) { > > DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: No device present at > port %d\n", Port)); > > + Status = EFI_NOT_FOUND; > > goto ON_ERROR; > > } else if (USB_BIT_IS_SET (PortState.PortStatus, > USB_PORT_STAT_SUPER_SPEED)){ > > Child->Speed = EFI_USB_SPEED_SUPER; > > -- > > 2.7.4 > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44822): https://edk2.groups.io/g/devel/message/44822 Mute This Topic: https://groups.io/mt/32662408/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-