diff mbox series

[RFT,4/4] usb: dwc2: Make "trimming xfer length" a debug message

Message ID 20200226210414.28133-5-linux@roeck-us.net (mailing list archive)
State New, archived
Headers show
Series usb: dwc2: Fixes and improvements | expand

Commit Message

Guenter Roeck Feb. 26, 2020, 9:04 p.m. UTC
With some USB network adapters, such as DM96xx, the following message
is seen for each maximum size receive packet.

dwc2 ff540000.usb: dwc2_update_urb_state(): trimming xfer length

This happens because the packet size requested by the driver is 1522
bytes, wMaxPacketSize is 64, the dwc2 driver configures the chip to
receive 24*64 = 1536 bytes, and the chip does indeed send more than
1522 bytes of data. Since the event does not indicate an error condition,
the message is just noise. Demote it to debug level.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/usb/dwc2/hcd_intr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Douglas Anderson Feb. 27, 2020, 10:07 p.m. UTC | #1
Hi,

On Wed, Feb 26, 2020 at 1:04 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> With some USB network adapters, such as DM96xx, the following message
> is seen for each maximum size receive packet.
>
> dwc2 ff540000.usb: dwc2_update_urb_state(): trimming xfer length
>
> This happens because the packet size requested by the driver is 1522
> bytes, wMaxPacketSize is 64, the dwc2 driver configures the chip to
> receive 24*64 = 1536 bytes, and the chip does indeed send more than
> 1522 bytes of data. Since the event does not indicate an error condition,
> the message is just noise. Demote it to debug level.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/usb/dwc2/hcd_intr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Suggest a "Fixes" or "Cc: stable" tag.  This one isn't as important as
the others, but presumably you'll start hitting it a lot more now
(whereas previously we'd just crash).

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Guenter Roeck Feb. 28, 2020, 12:38 a.m. UTC | #2
On Thu, Feb 27, 2020 at 02:07:14PM -0800, Doug Anderson wrote:
> Hi,
> 
> On Wed, Feb 26, 2020 at 1:04 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > With some USB network adapters, such as DM96xx, the following message
> > is seen for each maximum size receive packet.
> >
> > dwc2 ff540000.usb: dwc2_update_urb_state(): trimming xfer length
> >
> > This happens because the packet size requested by the driver is 1522
> > bytes, wMaxPacketSize is 64, the dwc2 driver configures the chip to
> > receive 24*64 = 1536 bytes, and the chip does indeed send more than
> > 1522 bytes of data. Since the event does not indicate an error condition,
> > the message is just noise. Demote it to debug level.
> >
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> >  drivers/usb/dwc2/hcd_intr.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Suggest a "Fixes" or "Cc: stable" tag.  This one isn't as important as
> the others, but presumably you'll start hitting it a lot more now
> (whereas previously we'd just crash).
> 
Good point. Added

Fixes: 7359d482eb4d3 ("staging: HCD files for the DWC2 driver")

> Reviewed-by: Douglas Anderson <dianders@chromium.org>

Thanks again!

Guenter
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
index 12819e019e13..d5f4ec1b73b1 100644
--- a/drivers/usb/dwc2/hcd_intr.c
+++ b/drivers/usb/dwc2/hcd_intr.c
@@ -500,7 +500,7 @@  static int dwc2_update_urb_state(struct dwc2_hsotg *hsotg,
 						      &short_read);
 
 	if (urb->actual_length + xfer_length > urb->length) {
-		dev_warn(hsotg->dev, "%s(): trimming xfer length\n", __func__);
+		dev_dbg(hsotg->dev, "%s(): trimming xfer length\n", __func__);
 		xfer_length = urb->length - urb->actual_length;
 	}