From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from raptorengineering.com (mail.raptorengineering.com [23.155.224.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B15F22CBC6 for ; Thu, 11 Dec 2025 15:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=23.155.224.40 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765467964; cv=none; b=PeVpmfBi4F0dpIuanuwh9XO3DgQ33AxsRUc2Se+BhmvTFNLa5NS0gHOF4BZFHJVCH/+X4W2r4y+JxfEuddRmqOe3Gp9kZNhqb1heOvpPHy9dzOKqIU7BHQPx1GqVEjpBOrNkyGpShGMIGv8W62zZy9kGMLtF0yp6p1h9SHIrxaw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765467964; c=relaxed/simple; bh=r/SWQ5N22MiOgvWON5cm5Q1T6o3WdH2cGJq3AcuS4Os=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=nzX6xn2Gvxb5pcc3mGeFAdRp/+AZhSFOage3yZ54DIJkGNLemzhVk+tE9Q7xO0IEDXh8BtFApwGO2qHzmwQ0G6YDntpz/pOSAa0ygFdZWR8dcLXMYlEnlmzNpbUETsJ2+n9w2+h0XgnozzpTj9GmvCL9CyWjay3p2s8J7EHV/EI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=raptorengineering.com; spf=pass smtp.mailfrom=raptorengineering.com; dkim=pass (1024-bit key) header.d=raptorengineering.com header.i=@raptorengineering.com header.b=UJr+U7Ul; arc=none smtp.client-ip=23.155.224.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=raptorengineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raptorengineering.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=raptorengineering.com header.i=@raptorengineering.com header.b="UJr+U7Ul" Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 504E27790B9F; Thu, 11 Dec 2025 09:45:52 -0600 (CST) Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id l--XkjLSVDbC; Thu, 11 Dec 2025 09:45:48 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 911007790ECC; Thu, 11 Dec 2025 09:45:48 -0600 (CST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 911007790ECC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD; t=1765467948; bh=YVj/tVG/Ny2P9i0KPrZNdm9ETStme89+Qf5/a9iQ8VE=; h=Date:From:To:Message-ID:MIME-Version; b=UJr+U7UlYOHwZgTm3eB1LIVeHJaUyophCrCxoxCzPVe8PE/neCTeJwilFIjTi0nbJ /tt2PmGyjcMLnSjs4Bi/KgrR6/2K7zihBFc+qrfn7IzGJ1JoH8vty1TK2gYmXP96zJ cxSe9Edlc5lxgbdQl+v0gZhPVvjorP5pzIj6BwWA= X-Virus-Scanned: amavisd-new at rptsys.com Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IFdpd6rWcFwT; Thu, 11 Dec 2025 09:45:48 -0600 (CST) Received: from vali.starlink.edu (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 497207790B9F; Thu, 11 Dec 2025 09:45:48 -0600 (CST) Date: Thu, 11 Dec 2025 09:45:44 -0600 (CST) From: Timothy Pearson To: Narayana Murty N Cc: mahesh , Oliver , Madhavan Srinivasan , Michael Ellerman , npiggin , christophe leroy , Bjorn Helgaas , Timothy Pearson , linuxppc-dev , linux-kernel , vaibhav , Shivaprasad G Bhat , ganeshgr@linux.ibm.com Message-ID: <1869613445.153778.1765467944808.JavaMail.zimbra@raptorengineeringinc.com> In-Reply-To: <20251210142559.8874-1-nnmlinux@linux.ibm.com> References: <20251210142559.8874-1-nnmlinux@linux.ibm.com> Subject: Re: [PATCH v2 1/1] powerpc/eeh: fix recursive pci_lock_rescan_remove locking in EEH event handling Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: Zimbra 8.5.0_GA_3042 (ZimbraWebClient - GC143 (Linux)/8.5.0_GA_3042) Thread-Topic: powerpc/eeh: fix recursive pci_lock_rescan_remove locking in EEH event handling Thread-Index: C2GPHp36/gzbyX7Qf9oUG0b1Lq+I5Q== ----- Original Message ----- > From: "Narayana Murty N" > To: "mahesh" , "Oliver" , "Madhav= an Srinivasan" , "Michael > Ellerman" , "npiggin" , "christoph= e leroy" > Cc: "Bjorn Helgaas" , "Timothy Pearson" , "linuxppc-dev" > , "linux-kernel" , "vaibhav" , > "Shivaprasad G Bhat" , ganeshgr@linux.ibm.com > Sent: Wednesday, December 10, 2025 8:25:59 AM > Subject: [PATCH v2 1/1] powerpc/eeh: fix recursive pci_lock_rescan_remove= locking in EEH event handling > The recent commit 1010b4c012b0 ("powerpc/eeh: Make EEH driver device > hotplug safe") restructured the EEH driver to improve synchronization > with the PCI hotplug layer. >=20 > However, it inadvertently moved pci_lock_rescan_remove() outside its > intended scope in eeh_handle_normal_event(), leading to broken PCI > error reporting and improper EEH event triggering. Specifically, > eeh_handle_normal_event() acquired pci_lock_rescan_remove() before > calling eeh_pe_bus_get(), but eeh_pe_bus_get() itself attempts to > acquire the same lock internally, causing nested locking and disrupting > normal EEH event handling paths. >=20 > This patch adds a boolean parameter do_lock to _eeh_pe_bus_get(), > with two public wrappers: > eeh_pe_bus_get() with locking enabled. > eeh_pe_bus_get_nolock() that skips locking. >=20 > Callers that already hold pci_lock_rescan_remove() now use > eeh_pe_bus_get_nolock() to avoid recursive lock acquisition. >=20 > Additionally, pci_lock_rescan_remove() calls are restored to the correct > position=E2=80=94after eeh_pe_bus_get() and immediately before iterating = affected > PEs and devices. This ensures EEH-triggered PCI removes occur under prope= r > bus rescan locking without recursive lock contention. >=20 > The eeh_pe_loc_get() function has been split into two functions: > eeh_pe_loc_get(struct eeh_pe *pe) which retrieves the loc for given PE= . > eeh_pe_loc_get_bus(struct pci_bus *bus) which retrieves the location > code for given bus. Conceptually the patch sounds OK, but given the complexity of these subsyst= ems it's difficult to forsee all interactions. Was the patch verified not = to break NVMe hotplug on PowerNV systems using actual hardware? If not, I = will need to do so before sending an ack. Thanks!