Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1483717ybc; Tue, 12 Nov 2019 22:38:01 -0800 (PST) X-Google-Smtp-Source: APXvYqw1QRzBSGas/Lb9ezYENB9D4ob/FQIj2GPm5ZOrEO+3fAd9Q9KkAznCrhQJ4zpNaPHNDLTf X-Received: by 2002:a17:906:b289:: with SMTP id q9mr1188610ejz.183.1573627081171; Tue, 12 Nov 2019 22:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573627081; cv=none; d=google.com; s=arc-20160816; b=gkZZVo7RGbPk3ICL4hP/I5jHlut/LZrl4F3/tKSx4zmVoFMpapIUv3eWOg7c7ZTgIp lSBpXKXnM/6bpiRuuclwJIT50aRDs44avR6Klhkw+4RNhCwMGLlaE6jAIJ/LHT/xbRGr 0//pnyDuihdzEj7GpukiY0AEVUgZeigpOhpKQNR63suZJKgah7i/63lArucxmCxuj4TT 1ahy65KIE7ZSJfm9Qjj7OOBJ2KkppRdVIuShD2uEhGCoEcoGLHcX8UTSkBh0Ekmqjsnv cP5GIA36vmG4zditppzgM6o/8HMOFWGDrfrS2hKeiLTxD8y2OQOVykYOoRZK9BaAr94L JpKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=sxvaiGLUcawXofu5gmaqJJoMq3ZQTvs7hKFfBlC1sHg=; b=HXLz4QaqS7BjP7Sl4lIq/kDAU+umNBhCm4GjEp2LDjwS+eUpAsDMup/MXfU3QfoHQf n7u+/gNEbbF0YhZLecuxBHw6RCRnPjx/HpGbKmE2bmFQir3ZTSjOi6gUexJIvwS6n5Al cAh4T6i9cPJURbD+iF2Twow00htfmn84x780xn0IWK4KZtYb1J/S3zWtEUZxnTN72Fn1 P0bNwmjQry3Fb7CywWbzzcGvr2e7DBV+YTzsLqib1M8Y4r4aXHFCOS6VVwY25Qr/3l/7 JA3sgHNNxefzkrMl3wVtpNi+O1Kxh3y4D5Rr2Fgh3RhytHAtkF4GPU5vDIhVfuph7gc2 IgPg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si786062edj.25.2019.11.12.22.37.36; Tue, 12 Nov 2019 22:38:01 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726216AbfKMGfW (ORCPT + 99 others); Wed, 13 Nov 2019 01:35:22 -0500 Received: from bmailout1.hostsharing.net ([83.223.95.100]:36249 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbfKMGfW (ORCPT ); Wed, 13 Nov 2019 01:35:22 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id F002B3000D92B; Wed, 13 Nov 2019 07:35:19 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id BCF3C30C9DD; Wed, 13 Nov 2019 07:35:19 +0100 (CET) Date: Wed, 13 Nov 2019 07:35:19 +0100 From: Lukas Wunner To: Bjorn Helgaas Cc: Mika Westerberg , "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 v3 2/2] PCI: pciehp: Prevent deadlock on disconnect Message-ID: <20191113063519.ivv2ehejxonkfufe@wunner.de> References: <20191029170022.57528-2-mika.westerberg@linux.intel.com> <20191113031752.GA227753@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191113031752.GA227753@google.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 12, 2019 at 09:17:52PM -0600, Bjorn Helgaas wrote: > On Tue, Oct 29, 2019 at 08:00:22PM +0300, Mika Westerberg wrote: > > parent PCIe downstream port, who got the hot-remove event, starts > > removing devices below it taking pci_lock_rescan_remove() lock. When the > > child PCIe port is runtime resumed it calls pciehp_check_presence() > > which ends up calling pciehp_card_present() and pciehp_check_link_active(). > > Oh, I see, pciehp_resume() calls pciehp_check_presence(), which > schedules the IRQ thread via pciehp_request(). So does this deadlock > only happen if the port(s) have been runtime suspended? No, there is a multitude of situations when the deadlock may occur and this is just one of them. See my comment on v1 of this patch: https://patchwork.ozlabs.org/patch/1117870/#2230798 Thanks, Lukas