Re: r8152 logs error `can't resubmit intr, status -1`

From: Alan Stern
Date: Fri Nov 17 2023 - 11:03:07 EST


On Thu, Nov 16, 2023 at 03:59:31PM +0100, Paul Menzel wrote:
> Dear Linux folks,
>
>
> On the Dell XPS 13 9360/0596KF, BIOS 2.21.0 06/02/2022, with a USB-C Dell
> DA300 adapter attached to the only USB-C port on the left, Linux 6.5.10
> logged the message below:
>
> r8152 4-1.2:1.0 enx18dbf22dccf3: can't resubmit intr, status -1
>
> As this is error log level, how can I fix it?
>
> Trying to understand the code, does `-1` mean `NOPERM`?
>
> $ git grep EPERM include/uapi/asm-generic/errno-base.h
> #define EPERM 1 /* Operation not permitted */
>
> Skimming the code this is returned by `usb_submit_urb()`, which in turn
> returns the return value of `usb_hcd_submit_urb()`.

That's right. This error code is returned by usb_hcd_link_urb_to_ep()
when a driver tries to resubmit an URB that is being killed and
therefore is not currently available for reuse.

I have no idea why the r8152 driver tries to resubmit an interrupt URB
that has been killed. It may be something innocuous, and the error
message in the log may be unnecessary. You'll have to speak about
this with the driver's maintainer.

> Do you have some
> debugging hints how to for example print the call trace for this case or
> enable more debug messages to understand the issue?

You can add a "dump_stack();" call to the section of
usb_hcd_link_urb_to_ep() that returns the -EPERM error code. However
it may not give you any information you couldn't already get by
reading the source code for the r8152 driver.

Alan Stern