Re: Lockdep warning about ctrl->reset_lock in pciehp_check_presence/pciehp_ist on TB3 dock unplug

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

 



Hi,

On 11/24/21 15:31, Hans de Goede wrote:
> Hi,
> 
> On 11/24/21 05:13, Lukas Wunner wrote:
>> On Mon, Nov 22, 2021 at 03:29:43PM -0600, Bjorn Helgaas wrote:
>>> On Mon, Nov 22, 2021 at 05:45:32PM +0100, Hans de Goede wrote:
>>>> With 5.16-rc2 I'm getting the following lockdep warning when unplugging
>>>> a Lenovo X1C8 from a Lenovo 2nd gen TB3 dock:
>>
>> Thanks for the report.  I'm aware of this issue, it's still on my todo
>> list.  Theodore already came across it a while ago:
>>
>> https://lore.kernel.org/linux-pci/20190402021933.GA2966@xxxxxxx/
>>
>> It's a false positive, we need to use a separate lockdep class either
>> for each hotplug port or for each level in the PCI hierarchy.
> 
> Can we easily determine what the level in the PCI hierarchy is ?
> 
> If yes; and if having a separate lock class per level is enough,
> then the code could simply switch to down_read_nested
> (and other xxx_nested) functions passing the level as
> "subclass" parameter.
> 
> If no, maybe we should add an "int level" member to
> struct controller ?
> 
> And then make the switch to the foo_nested locking functions
> based on that ?

So I've given the above idea a shot and fixes the false-positive
lockdep warning for me. I've posted a 2 patch series fixing this
upstream:

https://lore.kernel.org/linux-pci/20211129121934.4963-1-hdegoede@xxxxxxxxxx/T/#t

Note the 2nd patch can probably use a Fixes: tag but I had no
idea which commit to put there. Or maybe add a Cc: stable to
both patches?

Regards,

Hans




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux