[edk2-devel] [PATCH] MdeModulePkg/UsbBusDxe: Return error when the device is not present

Ni, Ray ray.ni at intel.com
Wed Jul 31 16:51:03 UTC 2019


Marcin,
What does the failure look like without your fix?

Thanks,
Ray

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Marcin Wojtas
> Sent: Wednesday, July 31, 2019 2:25 PM
> To: devel at edk2.groups.io
> Cc: leif.lindholm at linaro.org; ard.biesheuvel at linaro.org; mw at semihalf.com; jsd at semihalf.com; jaz at semihalf.com; Tian, Feng
> <feng.tian at intel.com>; Kinney, Michael D <michael.d.kinney at intel.com>; Gao, Liming <liming.gao at intel.com>;
> lersek at 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 <mw at 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 (#44690): https://edk2.groups.io/g/devel/message/44690
Mute This Topic: https://groups.io/mt/32662408/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