Re: lockdep warning in urb.c:363 usb_submit_urb

From: Alan Stern
Date: Tue Mar 24 2020 - 09:52:15 EST


On Tue, 24 Mar 2020, Qais Yousef wrote:

> On 03/24/20 14:20, Oliver Neukum wrote:
> > Am Dienstag, den 24.03.2020, 10:46 +0000 schrieb Qais Yousef:
> > >
> > > I should have stuck to what I know then. I misread the documentation. Hopefully
> > > the attached looks better. I don't see the new debug you added emitted.
> >
> > That is odd. Please try
> >
> > echo "module usbcore +mfp" > /sys/kernel/debug/dynamic_debug/control
> >
> > with the attached improved patch.
>
> Hmm still no luck
>
>
> # history
> 0 echo "module usbcore +mfp" > /sys/kernel/debug/dynamic_debug/control
> 1 swapoff -a
> 2 echo suspend > /sys/power/disk
> 3 echo disk > /sys/power/state
> 4 dmesg > usb.dmesg

What happens if you omit step 1 (the swapoff)?

> $ git log -p
> commit dfd1731f9a3e7592135d2a6b2a5c5e1640a7eea4 (HEAD)
> Author: Oliver Neukum <oneukum@xxxxxxxx>
> Date: Mon Mar 23 16:34:35 2020 +0100
>
> usb: hub additional debugging
>
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 54cd8ef795ec..12ce2fdc4c2a 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -1629,6 +1629,7 @@ static int hub_configure(struct usb_hub *hub,
> ret = -ENOMEM;
> goto fail;
> }
> + dev_dbg(hub_dev, "%p URB allocated \n", hub->urb);
>
> usb_fill_int_urb(hub->urb, hdev, pipe, *hub->buffer, maxp, hub_irq,
> hub, endpoint->bInterval);

Oliver, by the way, %p isn't a good way to get pointer values for
debugging. Its output depends on how the system is configured. Use
%px instead (see Documentation/core-api/printk-formats.rst).

Alan Stern