From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D949C3A5A2 for ; Tue, 3 Sep 2019 14:32:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D12B23697 for ; Tue, 3 Sep 2019 14:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729592AbfICOcp (ORCPT ); Tue, 3 Sep 2019 10:32:45 -0400 Received: from mga03.intel.com ([134.134.136.65]:33380 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728992AbfICOcp (ORCPT ); Tue, 3 Sep 2019 10:32:45 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 07:32:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,463,1559545200"; d="scan'208";a="198783088" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 03 Sep 2019 07:32:40 -0700 Received: by lahna (sSMTP sendmail emulation); Tue, 03 Sep 2019 17:32:40 +0300 Date: Tue, 3 Sep 2019 17:32:40 +0300 From: Mika Westerberg To: Dominik Brodowski Cc: andreas.noever@gmail.com, michael.jamet@intel.com, YehezkelShB@gmail.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: lockdep warning on thunderbolt docking Message-ID: <20190903143240.GH2691@lahna.fi.intel.com> References: <20190830125848.GA25929@owl.dominikbrodowski.net> <20190831130317.GL3177@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190831130317.GL3177@lahna.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.