Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp814499ybn; Tue, 24 Sep 2019 09:55:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNfJ2FBVvCqeNnLjtSS+7Xkacnb7iAzzcfVnInv+8WjxRG/Z1q7lcH/jHyp/hX5niCDnar X-Received: by 2002:a17:907:20c1:: with SMTP id qq1mr3313229ejb.87.1569344145199; Tue, 24 Sep 2019 09:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569344145; cv=none; d=google.com; s=arc-20160816; b=T4uOyZ9fDS28Vc79BtN9K45EdeSe8LqCZBA9SA8RBbqDxhz2VICECxUwkkWRm2b5v6 C0BKr7HRli27YDuvSYUKEYrR9j8J14VQVvm5zBD8fOwLM6jajfShLGQQ+07+rWcB1zv1 Ti1EC0FJI9wJi5nItEGE9zbI5rKZ0JI5aMjS4CbXBfeyTNUL1oLIvR+3dcNAmimfJf9L lZyPK6rgLxUnOJLx6jqh/l9SdR1OggW+o6CP7V7Fv3bT0vM0hxNra3e2QAmStksDpm7T yHo1b9Xh1oyRrDZhLuOBtjus9sICVuHyUkMkZOazyyUxgwbkJM75QadXuNBXrTQLGhdz zbEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=j2CLh4LBYD07vzGB5fSQAFDjCz32eWikeSiyV0E05MQ=; b=nRhcOx2MNmEDx0IAPVT8S3PQtHWR2aOkCjuM1FpkP7q9sM18GGmt7pkx2ZRcNM3bn7 2/0Sdr5mfDF6MIe1TzeaaiyPnmyivaYbcvYysq73J9taUUDevmL/TyviiLK4WekhxLK4 HiAcSXYWAxwHbvGo/kZc1gH9G+5vL4z7fT21yjZdRMoppAg/n//9NsePXeE9f7iY+oEA gUJ1ncy5iPhpl0EgPdXYXotfoDPETeJl9+NjHmxh0NGR+VTBniEfAtWF3IBuOiqDzSmu IhAyZAShPlFJFzAljPAZBLB9N8ppMwA+q46MGOgcR8WPIgzeyn2nq+1CybVwyqQFwxDn q8GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rh23si1200782ejb.75.2019.09.24.09.55.20; Tue, 24 Sep 2019 09:55:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405360AbfIWI2k (ORCPT + 99 others); Mon, 23 Sep 2019 04:28:40 -0400 Received: from mga06.intel.com ([134.134.136.31]:52622 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392172AbfIWI2i (ORCPT ); Mon, 23 Sep 2019 04:28:38 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Sep 2019 01:28:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,539,1559545200"; d="scan'208";a="203078174" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 23 Sep 2019 01:28:32 -0700 Received: by lahna (sSMTP sendmail emulation); Mon, 23 Sep 2019 11:28:32 +0300 Date: Mon, 23 Sep 2019 11:28:32 +0300 From: Mika Westerberg To: Lukas Wunner Cc: Bjorn Helgaas , "Rafael J. Wysocki" , Keith Busch , Andy Shevchenko , Frederick Lawler , "Gustavo A . R . Silva" , Sinan Kaya , Kai-Heng Feng , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect Message-ID: <20190923082832.GD2773@lahna.fi.intel.com> References: <20190812143133.75319-1-mika.westerberg@linux.intel.com> <20190812143133.75319-2-mika.westerberg@linux.intel.com> <20190923053403.jdjw6ed3sub6iuou@wunner.de> <20190923081237.GB2773@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190923081237.GB2773@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 Mon, Sep 23, 2019 at 11:12:42AM +0300, Mika Westerberg wrote: > Regarding suggestion of unbinding PCI drivers without > pci_lock_rescan_remove() hold, I haven't looked it too closely but I > think we need to take that lock anyway because when we are unbinding a > hotplug driver it is supposed to remove the hierarchy below touching the > shared structures, possibly concurrently. Unfortunately there is no > documentation what data pci_lock_rescan_remove() actually protects so > first one needs to understand that. I think one way to clean up this is > to use finer grained locking (with documented lock ordering) for PCI bus > structures that can be accessed simultaneusly by different threads. But > that is not a simple task. Now that I looked more closely, I realized it actually is not supposed to remove the hierarchy below so indeed it might be possible to do that without taking pci_lock_rescan_remove().