From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=144.76.133.104 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796058966; b=TXrJz9FoZImJqbFb7MeiM45XiKFVm7UyjVFJRfTOazhUSvkGnoUonCeVIdDR1y/B5UQg C5+Xr3nggyYLVr3hKq+cXh4ks/RqMNUDn0h/Ze4Q+N027e+/XeLjysVW9vYVjW6ljnT7Z 3QDqwEVkWSaxxP2x3k1qKM7uU/200vDIPcGbQTgYmV2kCvvRnCki2W1xSa5DMxuiOZbie CI9UDFb56GlIHgNA7CklhceiKD3/YMxK+fSFv6lDSV6H1wcZqr8PNMoQtf6CmHXcE21cP QBDpDnc4sONueiPgI/mXj+NDX5DP1jHec0GVyXeexEAmqalbYK6+sTmLHAEdgk1AX1Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796058966; h=DMARC-Filter:Received:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=otdGi1MSEkDamn92rtvRLy6zykb1jkaGEAPrHzgIhzk=; b=cF976ndwmC3POS3lDacuafLi3MLQ/8szZ2BttKqflbvGjtVg6yIx5lzev9kZaBI8Zj/7 bT4Xg56cdRtyoluw0wSNeHUsSTmwcy3jW5MifvOZcrwWpGuMY1CY66lmrz+quF4FiAwIh b8LXpzy5i382SGn88eqKQfqaouT0NTnBtclB+2hYQpXhZDFL+FIAGV8oPwjjxQ4O5FPNQ AFF8+iYhkrALKUVYsmLg5UOk3LN8LVtAV1GoLywtlRRsqeGp4us9+tgEqocN6CkBe5h5y ypuaWSogqHJYMkZSwh2VTg8j0NCQf8LU9U7mGZQATXauVAJF/a4sEGnYnJ+aps/3aPw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=wunner.de; spf=pass smtp.mailfrom=wunner.de; arc=none smtp.remote-ip=144.76.133.104 Received: from mailout3.hostsharing.net (mailout3.hostsharing.net [144.76.133.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20379606A320; Mon, 30 Nov 2026 17:16:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 20379606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wunner.de Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "*.hostsharing.net", Issuer "GlobalSign GCC R6 AlphaSSL CA 2025" (verified OK)) by mailout3.hostsharing.net (Postfix) with ESMTPS id 244A2C98; Mon, 30 Nov 2026 18:16:04 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id E52BE602790B; Mon, 30 Nov 2026 18:16:03 +0100 (CET) Date: Mon, 30 Nov 2026 18:16:03 +0100 From: Lukas Wunner To: Paul Cercueil Cc: Bjorn Helgaas , Manivannan Sadhasivam , Thomas Petazzoni , linux-pci@vger.kernel.org, stable@vger.kernel.org, Qiang Yu Subject: Re: [PATCH] PCI: Fix root port reset lock ordering Message-ID: References: <20261130153218.189926-1-paul.cercueil@bootlin.com> X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261130153218.189926-1-paul.cercueil@bootlin.com> [cc += Qiang] On Mon, Nov 30, 2026 at 04:32:18PM +0100, Paul Cercueil wrote: > Currently, pci_host_reset_root_port() calls pci_lock_rescan_remove(), > to protect pci_bus_error_reset(). > > The reset function then calls pci_reset_bridge(), then pci_slot_reset(), > pci_reset_hotplug_slot(), which will call the .reset_slot callback. > For a pciehp root port, this calls the pciehp_reset_slot() function, > which will grab the 'reset_lock'. > > On the other hand, the pciehp IRQ handler pciehp_ist() gets the > 'reset_lock' first, then calls pciehp_handle_presence_or_link_change(), > which will call pciehp_enable_slot(), __pciehp_enable_slot(), > board_added(), then finally pciehp_configure_device(), which will call > pci_lock_rescan_remove(). > > Address this ABBA locking issue by temporarily releasing the > 'reset_lock' in pciehp_{un}configure_device, just to grab the rescan > lock before locking the 'reset_lock' once again. Duplicate of: https://lore.kernel.org/r/20261126-fix_deadlock_1126-v2-1-c0ed50bc7b04@oss.qualcomm.com/ Please see the discussion there.