From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 BE0024315A for ; Mon, 22 Dec 2025 05:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766381772; cv=none; b=nxLl3NNV/d6EQ6LA1L/rK7JiWvur0djSJB91JF0MTEeLKJeJzcDs/4/sWGOMUOfysZFp0dvl4SuhSOreo1Yzd2RRK4mJigfcuAjjq+QnfrEWFlrUIoJkAjHzFUjMoy0OxVzAufLzJKsAnVE8NwiXoOi6SGiOJ4SDh61a91Uf08A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766381772; c=relaxed/simple; bh=itHdEZ7XRFOvolTr2r7h/2hfcl6bcEG44YqH5C81goE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=M0aBX/CTrFnSLNeMRu7YNrQtfyinUgQLGaVDXqxb+AefPvMXVBEBMs3v0Z3OGs6/MRFtEGFjnZJz0tOoXzvjrmCpBCQVYnCA6cgXHCYtl/aVGtDpBr+wF2+lDOpaoOV3fBNW1zJyAZxaK62t55WN1on2KmLmnu/hEyX8MIxS+/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=oFxFySNg; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="oFxFySNg" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5BLDkVwx026873; Mon, 22 Dec 2025 05:35:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=cBho8n j0EBBhQZZ51Wy31/RvrMpQ1gDfqzobPNxVe+I=; b=oFxFySNgoUtKuhVQ61hU00 sHd/5gTBZPznXeeS5STB6FLs/icwSgll5uGQH5WX4xd+Dch/Z+HrkMkY5iZ4ytai xO8bztMmmLWPsiupe7YX8QM8VjToQ2s/XCoE2/5x6zqvmE6O7gFY9WfVIw8n3bPD kwcETX8v3D+eaHf8SNHUZpsTxM4gnFKk3JCdRIH764PDF9/snImAiJhZONbCYCj6 BpstfJVvxue0/9ZOa9t3HaV/8Rcpkm6G+1wFTvgjALIib1yt8IbTUsm9/hw4++jL Qd/8OrbCey35GIn8jzVRHAuNSqr2MB2jTQs2ixoozpG154Wi5uemVUNyEh4Rv+Zw == Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4b5ketp44c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Dec 2025 05:35:41 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 5BM5VvGt008790; Mon, 22 Dec 2025 05:35:40 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4b5ketp446-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Dec 2025 05:35:40 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5BM4XOgS001126; Mon, 22 Dec 2025 05:35:39 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4b664s4kjv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Dec 2025 05:35:39 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5BM5ZbAN62390706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Dec 2025 05:35:37 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E3365805A; Mon, 22 Dec 2025 05:35:37 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9A8E58062; Mon, 22 Dec 2025 05:35:30 +0000 (GMT) Received: from [9.111.68.45] (unknown [9.111.68.45]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 22 Dec 2025 05:35:30 +0000 (GMT) Message-ID: Date: Mon, 22 Dec 2025 11:05:28 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/1] powerpc/eeh: fix recursive pci_lock_rescan_remove locking in EEH event handling To: Narayana Murty N , Timothy Pearson Cc: mahesh , Oliver , Madhavan Srinivasan , Michael Ellerman , npiggin , christophe leroy , Bjorn Helgaas , linuxppc-dev , linux-kernel , vaibhav , Shivaprasad G Bhat , ganeshgr@linux.ibm.com References: <20251210142559.8874-1-nnmlinux@linux.ibm.com> <1869613445.153778.1765467944808.JavaMail.zimbra@raptorengineeringinc.com> <1ea29e17-654a-41fd-b80c-0fc2a50ca49f@linux.ibm.com> Content-Language: en-US From: Nilay Shroff In-Reply-To: <1ea29e17-654a-41fd-b80c-0fc2a50ca49f@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: rP4jUDTpWSkRZWsK-Zz2YD4eYUPXQV2V X-Authority-Analysis: v=2.4 cv=Qdxrf8bv c=1 sm=1 tr=0 ts=6948d8ad cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=pGLkceISAAAA:8 a=1UX6Do5GAAAA:8 a=1XWaLZrsAAAA:8 a=_AprYWD3AAAA:8 a=voM4FWlXAAAA:8 a=VwQbUJbxAAAA:8 a=As8EeNG6lE4Wsrx9IP4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=Et2XPkok5AAZYJIKzHr1:22 a=fKH2wJO7VO9AkD4yHysb:22 a=IC2XNlieTeVoXbcui8wp:22 X-Proofpoint-ORIG-GUID: aAkYZub6s5iMKRDV07ERafNyjXSZvjJ1 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjIyMDA0NSBTYWx0ZWRfX0R2L26D7TWwx GDlyFB3h7dOpg8g/KOF72FCj0eoQcRiHO3uO74FpsjYmRlcT6MTtnYavjV0s7vKMOcuSuwe+EBB jgd2oVpAa5OKpWhu4KhKnyQ95kiNuhuOm+FevLnRjtQoAqOJ7OeYW8hrbhIwPVe0zWyXp74nHgz TWlE+ntZ4M1PqaRmVqKN6AxhgfF7dj2aUgdpHzI0dUehX5eQkTJuUYoA+ggeVTwE74w7rutnC/z aN67fDIG+Ydjzo4B7hTVHyilJjKd7rduYnd16le8ju+C+bA3h7FGqyGeyLaKJlKaStiKCTGTTTO 0v7XaUzR/vLupLf+C4D4JyQ6lAy3rzxK1dA7S7xrmuwVL51JLgRYsM3hDE2zjyilmf4jq6Hf891 JaGgpMvsm35k5AJejL7sydhTlgVta1rM06gWZ01IU/UYNmrog7QbN6EPOL0fO76PQ9HEPpu9nx+ xG4xwBgHACi6KvUmFug== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-21_05,2025-12-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1011 priorityscore=1501 phishscore=0 impostorscore=0 adultscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2512120000 definitions=main-2512220045 On 12/17/25 10:31 AM, Narayana Murty N wrote: > > On 11/12/25 9:15 PM, Timothy Pearson wrote: >> >> ----- Original Message ----- >>> From: "Narayana Murty N" >>> To: "mahesh" , "Oliver" , "Madhavan Srinivasan" , "Michael >>> Ellerman" , "npiggin" , "christophe 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. >>> >>> 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. >>> >>> 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. >>> >>> Callers that already hold pci_lock_rescan_remove() now use >>> eeh_pe_bus_get_nolock() to avoid recursive lock acquisition. >>> >>> Additionally, pci_lock_rescan_remove() calls are restored to the correct >>> position—after eeh_pe_bus_get() and immediately before iterating affected >>> PEs and devices. This ensures EEH-triggered PCI removes occur under proper >>> bus rescan locking without recursive lock contention. >>> >>> 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 subsystems 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! > It has not been specifically tested for NVMe hotplug on PowerNV hardware. > > However, this change does not remove or relax any of the existing locking > > around EEH handling, so the NVMe hotplug paths should continue to see > > the same serialization as before. > > If you have a convenient setup for NVMe hotplug on PowerNV, additional testing > > there would definitely be helpful before merging. Yes, I'd also suggest testing this patch against NVMe pcie error recovery code path. Please note that NVMe driver hooks into the EEH (pcie recovery) subsystem, and so, IMO, it'd be necessary to test it using NVMe. Thanks, --Nilay