Re: New XHCI lockdep oops in 5.10-rc1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 10/28/20 1:22 PM, Mathias Nyman wrote:
> On 28.10.2020 12.57, Hans de Goede wrote:
>> Hi,
>>
>> On 10/28/20 10:31 AM, Mathias Nyman wrote:
>>> On 27.10.2020 23.51, Hans de Goede wrote:
>>>> Hi,
>>>>
>>>> I standard run my local kernel builds with lockdep enabled, booting 5.10-rc1 with lockdep enabled results in:
>>>>
>>>> [    3.339982] =====================================================
>>>> [    3.339984] WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
>>>> [    3.339987] 5.10.0-rc1pdx86+ #8 Not tainted
>>>> [    3.339988] -----------------------------------------------------
>>>> [    3.339991] systemd-udevd/386 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
>>>> [    3.339993] ffffffffb1a94038 (pin_fs_lock){+.+.}-{2:2}, at: simple_pin_fs+0x22/0xa0
>>>> [    3.339999] 
>>>>                and this task is already holding:
>>>> [    3.340002] ffff9e7b87fbc430 (&xhci->lock){-.-.}-{2:2}, at: xhci_alloc_streams+0x5f9/0x810
>>>> [    3.340008] which would create a new lock dependency:
>>>> [    3.340009]  (&xhci->lock){-.-.}-{2:2} -> (pin_fs_lock){+.+.}-{2:2}
>>>> [    3.340013] 
>>>>                but this new dependency connects a HARDIRQ-irq-safe lock:
>>>> [    3.340016]  (&xhci->lock){-.-.}-{2:2}
>>>
>>> Thanks, just read a similar report from Mike Galbraith <efault@xxxxxx>
>>>
>>> Looks like 673d74683627 ("usb: xhci: add debugfs support for ep with stream")
>>> creates the new xhci debugfs stream files while holding the xhci->lock,
>>> creating this dependency.
>>>
>>> Below code should help, but I need to find my UAS drive to test it.
>>>
>>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
>>> index 482fe8c5e3b4..d4a8d0efbbc4 100644
>>> --- a/drivers/usb/host/xhci.c
>>> +++ b/drivers/usb/host/xhci.c
>>> @@ -3533,11 +3533,14 @@ static int xhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev,
>>>  		xhci_dbg(xhci, "Slot %u ep ctx %u now has streams.\n",
>>>  			 udev->slot_id, ep_index);
>>>  		vdev->eps[ep_index].ep_state |= EP_HAS_STREAMS;
>>> -		xhci_debugfs_create_stream_files(xhci, vdev, ep_index);
>>>  	}
>>>  	xhci_free_command(xhci, config_cmd);
>>>  	spin_unlock_irqrestore(&xhci->lock, flags);
>>>  
>>> +	for (i = 0; i < num_eps; i++) {
>>> +		ep_index = xhci_get_endpoint_index(&eps[i]->desc);
>>> +		xhci_debugfs_create_stream_files(xhci, vdev, ep_index);
>>> +	}
>>>  	/* Subtract 1 for stream 0, which drivers can't use */
>>>  	return num_streams - 1;
>>>
>>
>> I can confirm that this patch fixes the lockdep oops.
> 
> Thanks, can I add your Tested-by: tag to it?

Yes please do:

Tested-by: Hans de Goede <hdegoede@xxxxxxxxxx>

> I found a UAS device and could reproduce the original issue, and verify that the patch
> resolves it for me as well.

Great :)

Regards,

Hans





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux