Re: lockdep warning on thunderbolt docking

From: Mika Westerberg
Date: Tue Sep 03 2019 - 10:32:47 EST


On Sat, Aug 31, 2019 at 04:03:21PM +0300, Mika Westerberg wrote:
> Hi Dominik,
>
> On Fri, Aug 30, 2019 at 02:58:48PM +0200, Dominik Brodowski wrote:
> > When connecting a thunderbolt-enabled docking station to my work laptop,
> > the following lockdep warning is reported on v5.3.0-rc6+ as of Thursday
> > morning (can look up the exact git id if so required):
>
> Thanks for reporting. No need to dig for the commit ID.
>
> I'll take a look at this next week.

This seems to be impossible case. The two code paths cannot run at the
same time (on different CPUs) because device authorization is only
possible after the domain itself has been added and we've got firmware
notification that there is a device connected.

This was added by me in commit a03e828915c0 ("thunderbolt: Serialize
PCIe tunnel creation with PCI rescan") claiming that it prevents PCI
rescan code to find connected devices too early but now that I have
gotten bit more experience in PCIe, I think this is not the case. I
think I probably actually saw some issue in PCI stack that may even be
fixed already. I'm going to try to reproduce the original issue and see
if we can get rid of the whole pci_rescan_remove_lock in the driver.