public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pete Batard" <pete@akeo.ie>
To: devel@edk2.groups.io
Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org
Subject: [edk2-platforms: PATCH 3/3] Platform/RPi3: Reduce debug noise when using a USB network device
Date: Wed, 17 Jul 2019 12:46:45 +0100	[thread overview]
Message-ID: <20190717114645.7776-4-pete@akeo.ie> (raw)
In-Reply-To: <20190717114645.7776-1-pete@akeo.ie>

From: Michael Brown <mbrown@fensystems.co.uk>

The design of the EFI_USB2_HC_PROTOCOL does not allow for long-lived
bulk IN transactions as used by network devices, but instead requires
the network driver to rely on repeatedly issuing bulk IN transactions
with a very short timeout and in the expectation that most bulk IN
transactions will time out since no packet will have been received.

Timeouts are therefore normal and expected events when using a USB
network device under UEFI.  This currently results in a constant
stream of spurious "Wait4Bit: set timeout" and "Channel %u did not
halt" debug messages whenever the network device is open.

All callers of Wait4Bit already report a meaningful error in the event
of a timeout, so the Wait4Bit message may safely be removed without
impacting the ability to debug the code.

The "Channel %u did not halt" message may be moved to its sole call
site and restricted to the situation in which the subsequent attempt
to gracefully disable the channel did actually fail.

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
Signed-off-by: Pete Batard <pete@akeo.ie>
---
 Platform/RaspberryPi/RPi3/Drivers/DwUsbHostDxe/DwUsbHostDxe.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/Platform/RaspberryPi/RPi3/Drivers/DwUsbHostDxe/DwUsbHostDxe.c b/Platform/RaspberryPi/RPi3/Drivers/DwUsbHostDxe/DwUsbHostDxe.c
index 22d9bd822f96..37ebf503fd60 100644
--- a/Platform/RaspberryPi/RPi3/Drivers/DwUsbHostDxe/DwUsbHostDxe.c
+++ b/Platform/RaspberryPi/RPi3/Drivers/DwUsbHostDxe/DwUsbHostDxe.c
@@ -74,9 +74,6 @@ Wait4Bit (
     }
   } while (EFI_ERROR (gBS->CheckEvent (Timeout)));
 
-  DEBUG ((DEBUG_ERROR, "Wait4Bit: %a timeout (reg:0x%x, value:0x%x, mask:0x%x)\n",
-    Set ? "set" : "clear", Reg, Set ? Value : ~Value, Mask));
-
   return EFI_TIMEOUT;
 }
 
@@ -99,7 +96,6 @@ Wait4Chhltd (
   Status = Wait4Bit (Timeout, DwHc->DwUsbBase + HCINT (Channel),
                      DWC2_HCINT_CHHLTD, 1);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "Channel %u did not halt\n", Channel));
     return XFER_NOT_HALTED;
   }
 
@@ -331,6 +327,7 @@ DwHcTransfer (
       if (Status == EFI_SUCCESS) {
         Status = EFI_TIMEOUT;
       } else {
+        DEBUG ((DEBUG_ERROR, "Channel %u did not halt\n", Channel));
         Status = EFI_DEVICE_ERROR;
       }
       break;
-- 
2.21.0.windows.1


  parent reply	other threads:[~2019-07-17 11:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 11:46 [edk2-platforms: PATCH 0/3] Platform/RPi3: Improve timeout handling in DwUsbHostDxe Pete Batard
2019-07-17 11:46 ` [edk2-platforms: PATCH 1/3] Platform/RPi3: Use Wait4Bit return value consistently Pete Batard
2019-07-17 11:46 ` [edk2-platforms: PATCH 2/3] Platform/RPi3: Gracefully disable USB channel after a timeout Pete Batard
2019-07-17 11:46 ` Pete Batard [this message]
2019-07-19 11:53 ` [edk2-platforms: PATCH 0/3] Platform/RPi3: Improve timeout handling in DwUsbHostDxe Leif Lindholm
2019-07-19 15:22   ` [edk2-devel] " Michael Brown
2019-07-19 16:43     ` Leif Lindholm
2019-07-19 15:40   ` Pete Batard
2019-07-19 16:35     ` Leif Lindholm

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=20190717114645.7776-4-pete@akeo.ie \
    --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