From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=xlDsd7xv; spf=none, err=SPF record not found (domain: semihalf.com, ip: 209.85.208.193, mailfrom: mw@semihalf.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by groups.io with SMTP; Tue, 30 Jul 2019 23:25:39 -0700 Received: by mail-lj1-f193.google.com with SMTP id x25so64508238ljh.2 for ; Tue, 30 Jul 2019 23:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=jONV+/HQ08OX6SR+2T6e7OaxoYryNoJg7qKc7dWOcOo=; b=xlDsd7xvZxqKRRuJ9GKDF3nRlXYJPfgzL1O/Df9LZ3yYkd6LZ4zc8hDEen4f0qtWFP Ix6fSW/nh+OE6F5OODFHHFoTg0o+xrI+KPkSHFyupGDcza/99R9BJwpIYjrndqnWlmk9 OVZMmpMAOeWMxkwoRLYo33LkZkwcsanFHWFGjF4pEU2WnvAqXnwgWfPRq+uRdOE3EfJ8 lXwvDTVI/GZQfOtptqM0JDOWTR6ln4L8ANi1VNXpYkqo/IEYDNIOVmGTiG3T1vVFh1gT 72mn9fXSOt2rAC4Ds7heQ1mhhgWGQ7/o7UsB1csXCkIQMqxWO9yHvupaVun+5H8vXPgk wHHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jONV+/HQ08OX6SR+2T6e7OaxoYryNoJg7qKc7dWOcOo=; b=L3bIyX/eMXPTWR4jVaAh5gVHc+aDpGcy6F+egHqX8rP8TTiS0vmYPTNHl/23x22phs MNMVVWnm78bMHWAQVQvlFkTegh6EILDeyUJmggzih9h2Oe2q4XRwuo3L+PYVnyUViHei ruuYtPVopZAfRQxsL/6xvpfTIcCgvghIG9SbmXkgOxS7tYvS4UATTHy03wm+jIBSFfF2 MBk1YabtVva8iIpukcJtQDQaab5e31wixJmd7nvLz4Ckt5f0zkhtnQ36SW/q5vRB23sl es7hIWuZPDyZIWKEOj/+j13IKoiXsQ7C5zJWgtsWy3irJCakLQZtk2kbUGMnDxWUu08Q s8ow== X-Gm-Message-State: APjAAAWxMM4Ai+WTOK1bnxFChiFjIbTPwW8vs2W16InNF5pgq4k9rzQ6 YJ7pxoa+eEFIMjh3PsJgNkC+/C7KL+A= X-Google-Smtp-Source: APXvYqw47o36TFG0PrF/QftdvcIml1LDH2a/+etOe4zSoFjRUKAAv1ltCck8oWGiO7X/z70yi3koGA== X-Received: by 2002:a2e:5b5b:: with SMTP id p88mr26662045ljb.192.1564554337196; Tue, 30 Jul 2019 23:25:37 -0700 (PDT) Return-Path: Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id m17sm11496056lfj.22.2019.07.30.23.25.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jul 2019 23:25:36 -0700 (PDT) From: "Marcin Wojtas" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, feng.tian@intel.com, michael.d.kinney@intel.com, liming.gao@intel.com, lersek@redhat.com Subject: [PATCH] MdeModulePkg/UsbBusDxe: Return error when the device is not present Date: Wed, 31 Jul 2019 08:25:19 +0200 Message-Id: <1564554319-26810-1-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 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 --- 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