{"id":2225553,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2225553/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/288517e50996200c368cfe172de86ceb02bbd342.1776756380.git.ionut.nechita@windriver.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/1.2/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<288517e50996200c368cfe172de86ceb02bbd342.1776756380.git.ionut.nechita@windriver.com>","list_archive_url":null,"date":"2026-04-21T07:34:20","name":"[v13,1/2] PCI/IOV: Make pci_lock_rescan_remove() reentrant and protect sriov_add_vfs/sriov_del_vfs","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"31dcb4c5ac19cab80c2c9b6fe0b45d1c4730a8e2","submitter":{"id":92607,"url":"http://patchwork.ozlabs.org/api/1.2/people/92607/?format=json","name":"Ionut Nechita (Wind River)","email":"ionut.nechita@windriver.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/288517e50996200c368cfe172de86ceb02bbd342.1776756380.git.ionut.nechita@windriver.com/mbox/","series":[{"id":500749,"url":"http://patchwork.ozlabs.org/api/1.2/series/500749/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=500749","date":"2026-04-21T07:34:20","name":"PCI/IOV: Fix SR-IOV locking races and AB-BA deadlock","version":13,"mbox":"http://patchwork.ozlabs.org/series/500749/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2225553/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2225553/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-52823-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=windriver.com header.i=@windriver.com\n header.a=rsa-sha256 header.s=PPS06212021 header.b=ZxejIFVg;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-pci+bounces-52823-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com\n header.b=\"ZxejIFVg\"","smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=205.220.178.238","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=windriver.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=windriver.com"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0DgC3s78z1yJG\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 17:36:07 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 96DA13012B76\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 07:35:36 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 927028C1F;\n\tTue, 21 Apr 2026 07:35:30 +0000 (UTC)","from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com\n [205.220.178.238])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id CC7D2382F2A;\n\tTue, 21 Apr 2026 07:35:28 +0000 (UTC)","from pps.filterd (m0250811.ppops.net [127.0.0.1])\n\tby mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63L517X8383621;\n\tTue, 21 Apr 2026 07:34:56 GMT","from bl2pr02cu003.outbound.protection.outlook.com\n (mail-eastusazon11011031.outbound.protection.outlook.com [52.101.52.31])\n\tby mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4dky5yb2vx-1\n\t(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n\tTue, 21 Apr 2026 07:34:55 +0000 (GMT)","from SJ2PR11MB7546.namprd11.prod.outlook.com (2603:10b6:a03:4cc::8)\n by SA1PR11MB6782.namprd11.prod.outlook.com (2603:10b6:806:25e::11) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.16; Tue, 21 Apr\n 2026 07:34:53 +0000","from SJ2PR11MB7546.namprd11.prod.outlook.com\n ([fe80::ca9b:dcf:8881:bced]) by SJ2PR11MB7546.namprd11.prod.outlook.com\n ([fe80::ca9b:dcf:8881:bced%4]) with mapi id 15.20.9846.016; Tue, 21 Apr 2026\n 07:34:53 +0000"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776756930; cv=fail;\n b=Yg7KSWPqM7K2396hElocWOf81eBSOq1n26Ko+2wtsjAZ1nC2poQSDDEv0fzANRffzlnOouwCGddTtbFky6o9WRJjnLDipk0RiK+/Sb1uH/1mzgxNpaEqHHh01h0VB2pB13lMsXt96qJ4TqCqLd4TGssxxQW8wnZUDYnIVXjiHkk=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=K0IUNg3gfyO7A4uk9QAEefcuSaQXMMSvebOrbU7wsTB1LMxYhR+37vzYXDiRZsHIE0pdnOeyhBiCkxo2S2cBAixN/tLNLtc4hsRow6Ha2QSN/Q+nyWekvFC4Z7fvwaBHtVEzWsaAC4IDizMPUfPMDFGaRggSb8mj6h85EXQ63Oz1la+3FE+sWe4+3VZgqm97wNVmgL+MaJ1bUtuCnwKxICgUIZUeniHvBg7g8Vhj+hOUwF7COJVQHoRVcEx2H0zxbKIcSbvF58MeVWogCDUILOUQkrg9xpcIa5sVOtnKj8Lu8aXiz9ru4zxLm+RjSGafE9gbX0JEM09RJAn3Cangow=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776756930; c=relaxed/simple;\n\tbh=ro+NEVngoJwLV3zH9wmio+fSihSxr60pYfH3e0bNFeo=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=rdVVrMD0K0EYRU5LAwrsUr1PaBJxTJ4DLcweB49NxxMjcD8t/v3p/8pEJ3zP0vYhQGGNtTVZn8fYU2Z2eFTYSG+2ksOR/Ii98keqnkinxirNHx+k0Y/6JifrK7NYO8uqT7PSJr+WzS3+7I7pJCuuNL9dCK3Vd1Qd4QgdwCeSAFU=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=xj1MG6PjxfLHcjimUsHntnROzsCNKvwim/LTNuA+FJ4=;\n b=TRUG1xI1fA8uiNgMy4jz6pD5EUL/ib6gZnjPfxlQFM4REdpQs1Fg+WYm216sDUvX1DvCj8RjTs5KnKWPkHRhjbVnx7A/YeLfUbUEI+RkeZ6nbkKHkVRseLrosPAGR0Lw4z6Vue1Hgn6cdyA/vQ6QobBhUIi5vjnt52jfZGpCI1eI8dGAA5un8G/mSYH7DqTAmUphnSK07XK01hzRZ6tzuQc5Rw0/md4f7G8HlqKTmzaJMVFoc5fHOa7vIs7ectGUWRzahT2lm3C7Z1+Cj1OVjrnbx7H0tx1KyYdj+xA3atahRP08CQqaB0L0M4KRhlTF+PqWU+DzX6vtv/JVIRqUKQ=="],"ARC-Authentication-Results":["i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=windriver.com;\n spf=pass smtp.mailfrom=windriver.com;\n dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com\n header.b=ZxejIFVg; arc=fail smtp.client-ip=205.220.178.238","i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=windriver.com; dmarc=pass action=none\n header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com;\n\t h=cc:content-transfer-encoding:content-type:date:from\n\t:in-reply-to:message-id:mime-version:references:subject:to; s=\n\tPPS06212021; bh=xj1MG6PjxfLHcjimUsHntnROzsCNKvwim/LTNuA+FJ4=; b=\n\tZxejIFVgQWUm7/MTxMZikk7jfRTm++dYQ1S26e70lGX6NFAlx4WJgRWsFXRnehca\n\tXr6ixYIK3XyOunXW2O7RoMVGCEYaBaXoSbAjbdKmpWwK/LzSL7H/rczICgEtT89j\n\tXJI0dHvpqzVMwn+2iNGkcjlWg2wfnh5hMJ2eJjVvNgvu27zn76sGDUWpWUoq9nC8\n\tTeBR6EctaGHFc3Erq15OmduUd0WvcuIRuF3Faf9Ur3BrM06uEa263n5L+/7jiCEi\n\tVClf9IedAFQRhfOT9b1Prns15vdLvebJpUAb4Q1RNH40vLLGctfg1Q+x37OQ2R2R\n\t0TdI2O39r+JAix5qoOJLqg==","From":"\"Ionut Nechita (Wind River)\" <ionut.nechita@windriver.com>","To":"linux-pci@vger.kernel.org, bhelgaas@google.com","Cc":"helgaas@kernel.org, sebott@linux.ibm.com, schnelle@linux.ibm.com,\n        bblock@linux.ibm.com, linux@roeck-us.net, lukas@wunner.de,\n        stable@vger.kernel.org, linux-kernel@vger.kernel.org,\n        intel-xe@lists.freedesktop.org, matthew.brost@intel.com,\n        michal.wajdeczko@intel.com, piotr.piorkowski@intel.com,\n        dtatulea@nvidia.com, mani@kernel.org, kbusch@kernel.org,\n        lkml@mageta.org, alifm@linux.ibm.com, julianr@linux.ibm.com,\n        ionut_n2001@yahoo.com, sunlightlinux@gmail.com","Subject":"[PATCH v13 1/2] PCI/IOV: Make pci_lock_rescan_remove() reentrant and\n protect sriov_add_vfs/sriov_del_vfs","Date":"Tue, 21 Apr 2026 10:34:20 +0300","Message-ID":"\n <288517e50996200c368cfe172de86ceb02bbd342.1776756380.git.ionut.nechita@windriver.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<cover.1776756380.git.ionut.nechita@windriver.com>","References":"<cover.1776756380.git.ionut.nechita@windriver.com>","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-ClientProxiedBy":"VI1PR0202CA0012.eurprd02.prod.outlook.com\n (2603:10a6:803:14::25) To SJ2PR11MB7546.namprd11.prod.outlook.com\n (2603:10b6:a03:4cc::8)","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"SJ2PR11MB7546:EE_|SA1PR11MB6782:EE_","X-MS-Office365-Filtering-Correlation-Id":"59dc9201-c35e-4751-9cac-08de9f787a98","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|1800799024|10070799003|366016|376014|7416014|52116014|22082099003|18002099003|56012099003;","X-Microsoft-Antispam-Message-Info":"\n\tY+D3RxlA5QeSzpBXV+69xjg40RECnmZMUSQSeQ7PzwBYYTTPZHQFQPo8XvWQc70H+uefl5S+kAPMj98kkNQKOuZZtu7OkFNZATy3qUnP5vKCSdjIntIrNIMtWS2ej74PoPDFBXzrOSnSFohIiG5WdCxtNUjHikjNVkPkMvVab9m+LUgXwZannCARAtP/sSktaK46S8rXq3gsb0i3DUTrH7UOcofYaVvafC3APA8+0CbEq2/uP82/z4muPNiyG5o+NI40vGCNPASC9Aj2Y+NAkIHmEcWlSxILInrLECiFzev4UUa8xDhu4InkwLntPLhee8/XwlTguyAZQaHsS71FHGJF0acJsNvaixrZm2KYBdabZBjvHwre3Yb2CzqoxYhNBmtTPwQYL0Fz5qYduLJHFU1iLdVRFuwjeW7KmtZZKwi0OD2xl29HpIFytvw+3XFEUOvZEb/PoUZ8iXAles2RnnatVWk5bqdaw8pM9v9a7C/ilGBvaJ2sWS+N5eOPJEWe0aR4mDUXcENC8cLl8hsr3pAog+AxevtRugdg34VSY1OS+NLOFeolViQkeVJLL9nvJG6vQ8yWsaaVxSaph+BG4jciQ54tXg7wIkurq81M8HgSAFax6+6F0aasDJ6blWbzw0jso5JhwID9osl7/2Nk5QXyd37MEdjMHyU7M/kC4cNE2k2LzIsg7OMEp3MXhQxfQeBYg77uS4igzyKUQd2WYQpWQU72x6JSBzYvVnZPqc8=","X-Forefront-Antispam-Report":"\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7546.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(10070799003)(366016)(376014)(7416014)(52116014)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"2","X-MS-Exchange-AntiSpam-MessageData-0":"\n nUE0ofBkvffITZiC2+Zw6qM25JKcX7/rGztEjnmjPJQN0wbEdwOK6eC/dKZ2+6gv5bbIfgLIffxtJisjkA1s+RiO9EdyFsDjtT2xPMpdPeACE4T0MC2CrdVcxI7zKsO6pvWzKCw+44Am2XD/CYHQW5hdYuqQjAIOh707dajuQ+MLLxInVmxkt+YS1XPKSowYj7PChax/DCYCUSDlDYvIJkwHh5X+C50iQm+3o/gR1SR/me8aqZyvGId0agTrxJ15XLOzo7A8zhXH25NO8G8JSO0ZZhuPawgOKOf4XX1O1iqpmAW1ey7DxaPHq/g0fOH2glUOviwef34Ck1f7OUqa0wz8truHHnH0haTWG1Sz1G7eFie0QJRcJrn3Yyez3Gi3fCTJjjNjlq5WJxD5g/itgPqcSYk6zY/ecD/gWqABBp8RnblXzOduiT8JFxua0ohVrCSGl9FI6xABlkOUNosAOqkQ7V2222hIt5+9cVIjv7Rba4AMQmBw2Q/6CCHkQxYy+Lf77aLQe/51kDFOElJPyurBc21PgtNrWFPTuN54F7aN9lolcaOBCTlScF4skMCWtlr0A8xlIiFk1bGZm+8hLtl8HUfzwP4uG3OU6gNCNKqEHeLJOMgsYolMCJTWMOiv2WCFoJwzvZkdtQ1gjCsl4jDBPssnkYqmtMUQG2xryauIvfEEL5JcVZoiPUM9Qt61KoqHh1s72eK5RpdfRWRloIDMGELWcjEjQGZKbkU34aQSz5dxUT7fpMu+UIdYi4+Lqol+B/5qkTfLP9WqdP8LlghweSUm2tnBT4/db7A2FgJXvbtb8UkUwteHWpm0EspsHJ4of5syK1oMBiWpcsnZilVkZ56qkHEuWEFifXVTXgKLJf1vJow4ms9VlFevjT9bpNCd3fHJiMfr6aq8n+VlQpT8NodQcSurMYdPll7hqJPN3J5dGYx+juqYzAhK96E+kcvgY/IXzKPru9H9c8KP17uvOdf5sZ5PK4EIgRFY8jB/hlRF0ouUD1u1covayx8L5QCqohttMmP3Dp+S0JcoA/mm/t99u3vyUmLIhmH4tmvv1b9RWyfXdUf69zK6YbFlBd2UJctjPlCk3BgBxzApePOo9DIJSIq3klg5vw/YjynHvDanQFVnmhe1v9KdGLEu9s6Ps2lqAc3wbiOjWTnk8QcyUk4y0hkyVg8KgsmhVxVpkoNWVR1qulECTeRwL+khNK6k3YgHThbFdVJq1g3ZuCiAxDjRibax0bktxU6z2bDElwndGVjUC+n+ny9rBdIITUQG4YcPPdZPo9gxv10VRuk5xKKzd/gZO6RCSYeD3WN18kCX0+OqIsM0vM/cAUZi3Haf1cc6XVGHSDyLmgpfP009PM7KKs+MrA6k0Wbh/mfkxpMYsMre/eNehoKTgTBc6cooRIjKqcSZPOt/mgZAQnBfdyCL5g3waK2pwTinLS0+IcfRmtzcTBlm2MssJ8VDb5sC4cJ15XX+1U4vgYtpEp29yEDmSgftAZZ3oVCv6721XithNpYAwa6DwBJae/WUhJye9ImN493PtTeQTyHoAgZnmoWSpzSspJBvSG8eDJMuOs+gK0T3Ocpm0cG9ZTExvMRQxTA39FOs/ZyaDGTbFmU0CUXhgq8NZ7UB6u8aGvQGSvnet63CfM7PMVOfI3ywYX+xHsfSUSROEpmn77Hhi0yJE7mK0rZY3WgJIDxtFaviedz1g9075zYP0P4VU1G8CGMaFxybu/zmxV2a47q7KAgblbIMLe8YWwdzhiFQdrIoiaO0f/ZYEkHH4a57/Wn48VwgH+GQ","X-MS-Exchange-AntiSpam-MessageData-1":"FF1S+ND4FyBVA2sj5rhiDetPSRs/QscvMJE=","X-Exchange-RoutingPolicyChecked":"\n\tE5yB0sBBZSajDCJnCdyvPYHHFm2KTRysH5Wxi3x6XbQhqQYetDdaOlWbNVhKl0UPBQCbxzhT4ELQu61wwDs1+1x0iGGB2FQZP43rvLM0+bwsFBW9FbWUHV9etI68cJ8lliDFEYSK+2CmkDoPL7/PIxc5+0VN2hu+owj6Sp2seDD5WvrbpaaUGh2fp4lGxnTBcix4QQ+8IlSviSJwSxeObElx0qRaWtASLZkYXwWjg+2lsU6UkReag6TAE7TfIlLHd0Xyvyoiidr0LyuJvEhgNYyEfhv7rAOVPPCZfcFOkoFgs+dpPRuaHESo3oDdS4doxZIbDe9MfCA66JAa33ocWA==","X-OriginatorOrg":"windriver.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 59dc9201-c35e-4751-9cac-08de9f787a98","X-MS-Exchange-CrossTenant-AuthSource":"SJ2PR11MB7546.namprd11.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"21 Apr 2026 07:34:53.6686\n (UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"8ddb2873-a1ad-4a18-ae4e-4644631433be","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"\n hBmi0Scw/USkMypXTEKr7ftfY0Ojvnx7nzY8GbBBqAbbzja3YbKAC8/oeOW9Zws23Yq3+xqPMII8RLmQJ1RfSFVqY6S9I79whQVlhOm1ILw=","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"SA1PR11MB6782","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDIxMDA3MiBTYWx0ZWRfX/QNndMXjkHlu\n BVLIxZzbEMhuIkWKw5dMWlkbYabmg6cNgrfNHKowTwACX72a03RPH6A7xU3EX8Osp2sjvOBG4ay\n 5LLy9vh8w72QS/3FIj4fV4IHAOAf6f9Hs+LgbMj10fZRyU+JbE1QOvZf7Eh3bENFDxl/QnoYv38\n iFfhGTjjELnokG0i6ecAw/F97404blnyYDZ5ILc1dd96daM2DF3wKwDqngv4On1vNIqAFOsNspP\n W6XpVXE6GImdzQuh7NjWDgNBIM/6Eh4rJZbA5WsDEL0YRmqlRCHJ5p3ogDDo5DMnAYwKVyq+ESz\n k2iCDpFPB44dI159HePeAT8NKhdGbexQDmoMBg8y2oE7BI50ta5o/Ct/oWsCi6ramEN/G7f7DGT\n dBaXzWiq/sH+69hVp5cILzdgDTf8eIEx4iouCBWSyzyDlQCNlnCuDHke8fWcSEvxhOH1lijrUR6\n daaFGj5UVDL1heTrQ5g==","X-Proofpoint-GUID":"WQbKc-ePUuOVm0h7K2y5s1Chu5LpS6Jm","X-Proofpoint-ORIG-GUID":"WQbKc-ePUuOVm0h7K2y5s1Chu5LpS6Jm","X-Authority-Analysis":"v=2.4 cv=Bp+tB4X5 c=1 sm=1 tr=0 ts=69e7289f cx=c_pps\n a=PWz2vMGk566g1z9MD32Dlw==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19\n a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19\n a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=bi6dqmuHe4P4UrxVR6um:22 a=klDOsUkWDRETUCZYPvoE:22 a=t7CeM3EgAAAA:8\n a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=hh5_vNSPTWDFZ6TSUYYA:9\n a=FdTzh2GWekK77mhwV6Dw:22","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-21_01,2026-04-20_02,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n spamscore=0 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0\n malwarescore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0\n suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc=\n route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000\n definitions=main-2604210072"},"content":"From: Ionut Nechita <ionut.nechita@windriver.com>\n\nAfter reverting commit 05703271c3cd (\"PCI/IOV: Add PCI rescan-remove\nlocking when enabling/disabling SR-IOV\") and moving the lock to\nsriov_numvfs_store(), the path through driver .remove() (e.g. rmmod,\nor manual unbind) that calls pci_disable_sriov() directly remains\nunprotected against concurrent hotplug events. This affects any SR-IOV\ncapable driver that calls pci_disable_sriov() from its .remove()\ncallback (i40e, ice, mlx5, bnxt, etc.).\n\nOn s390, platform-generated hot-unplug events for VFs can race with\nsriov_del_vfs() when a PF driver is being unloaded. The platform event\nhandler takes pci_rescan_remove_lock, but sriov_del_vfs() does not,\nleading to double removal and list corruption.\n\nWe cannot use a plain mutex_lock() here because sriov_del_vfs() may also\nbe called from paths that already hold pci_rescan_remove_lock (e.g.\nremove_store -> pci_stop_and_remove_bus_device_locked, or\nsriov_numvfs_store with the lock taken by the previous patch). Using\nmutex_lock() in those cases would deadlock.\n\nMake pci_lock_rescan_remove() itself reentrant by tracking the current\nowner task and a recursion depth counter, as suggested by Lukas Wunner\nand Benjamin Block, since these recursive locking scenarios exist\nelsewhere in the PCI subsystem:\n - If the lock is already held by the current task (owner == current):\n   increments the depth counter and returns without re-acquiring,\n   avoiding deadlock.\n - If the lock is held by another task: blocks until the lock is\n   released, then records the owner and sets depth to 1.\n - If the lock is not held: acquires the mutex normally.\n\npci_unlock_rescan_remove() decrements the depth counter and releases\nthe mutex (clearing the owner) only when the depth reaches zero.\nA WARN_ON catches mismatched unlock calls from tasks that do not own\nthe lock.\n\nThis avoids relying on mutex_get_owner(), which is not exported to\nmodules and caused link failures for builds that inline this code\noutside of the core kernel image.\n\nThis approach keeps the API unchanged: callers simply pair lock/unlock\ncalls without needing to track any return value or use separate\nreentrant variants.\n\nAdd pci_lock_rescan_remove()/pci_unlock_rescan_remove() calls to\nsriov_add_vfs() and sriov_del_vfs() to protect VF addition and\nremoval against concurrent hotplug events.\n\nRemove the rescan/remove locking from sriov_numvfs_store() that was\nintroduced by commit a5338e365c45 (\"PCI/IOV: Fix race between SR-IOV\nenable/disable and hotplug\"), since the locking is now handled directly\nin sriov_add_vfs() and sriov_del_vfs() where it is actually needed,\nreducing the lock scope.\n\nFixes: 18f9e9d150fc (\"PCI/IOV: Factor out sriov_add_vfs()\")\nFixes: 05703271c3cd (\"PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV\")\nFixes: a5338e365c45 (\"PCI/IOV: Fix race between SR-IOV enable/disable and hotplug\")\nCc: stable@vger.kernel.org\nSuggested-by: Lukas Wunner <lukas@wunner.de>\nSuggested-by: Benjamin Block <bblock@linux.ibm.com>\nSigned-off-by: Ionut Nechita <ionut.nechita@windriver.com>\n---\n drivers/pci/iov.c   |  9 +++++----\n drivers/pci/probe.c | 18 ++++++++++++++++--\n 2 files changed, 21 insertions(+), 6 deletions(-)","diff":"diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c\nindex 91ac4e37ecb9..7ed902539051 100644\n--- a/drivers/pci/iov.c\n+++ b/drivers/pci/iov.c\n@@ -495,9 +495,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,\n \n \tif (num_vfs == 0) {\n \t\t/* disable VFs */\n-\t\tpci_lock_rescan_remove();\n \t\tret = pdev->driver->sriov_configure(pdev, 0);\n-\t\tpci_unlock_rescan_remove();\n \t\tgoto exit;\n \t}\n \n@@ -509,9 +507,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,\n \t\tgoto exit;\n \t}\n \n-\tpci_lock_rescan_remove();\n \tret = pdev->driver->sriov_configure(pdev, num_vfs);\n-\tpci_unlock_rescan_remove();\n \tif (ret < 0)\n \t\tgoto exit;\n \n@@ -633,15 +629,18 @@ static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs)\n \tif (dev->no_vf_scan)\n \t\treturn 0;\n \n+\tpci_lock_rescan_remove();\n \tfor (i = 0; i < num_vfs; i++) {\n \t\trc = pci_iov_add_virtfn(dev, i);\n \t\tif (rc)\n \t\t\tgoto failed;\n \t}\n+\tpci_unlock_rescan_remove();\n \treturn 0;\n failed:\n \twhile (i--)\n \t\tpci_iov_remove_virtfn(dev, i);\n+\tpci_unlock_rescan_remove();\n \n \treturn rc;\n }\n@@ -766,8 +765,10 @@ static void sriov_del_vfs(struct pci_dev *dev)\n \tstruct pci_sriov *iov = dev->sriov;\n \tint i;\n \n+\tpci_lock_rescan_remove();\n \tfor (i = 0; i < iov->num_VFs; i++)\n \t\tpci_iov_remove_virtfn(dev, i);\n+\tpci_unlock_rescan_remove();\n }\n \n static void sriov_disable(struct pci_dev *dev)\ndiff --git a/drivers/pci/probe.c b/drivers/pci/probe.c\nindex b63cd0c310bc..0e62081bc5e5 100644\n--- a/drivers/pci/probe.c\n+++ b/drivers/pci/probe.c\n@@ -3513,16 +3513,30 @@ EXPORT_SYMBOL_GPL(pci_rescan_bus);\n  * routines should always be executed under this mutex.\n  */\n DEFINE_MUTEX(pci_rescan_remove_lock);\n+static struct task_struct *pci_rescan_remove_owner;\n+static unsigned int pci_rescan_remove_depth;\n \n void pci_lock_rescan_remove(void)\n {\n-\tmutex_lock(&pci_rescan_remove_lock);\n+\tif (pci_rescan_remove_owner == current) {\n+\t\tpci_rescan_remove_depth++;\n+\t} else {\n+\t\tmutex_lock(&pci_rescan_remove_lock);\n+\t\tpci_rescan_remove_owner = current;\n+\t\tpci_rescan_remove_depth = 1;\n+\t}\n }\n EXPORT_SYMBOL_GPL(pci_lock_rescan_remove);\n \n void pci_unlock_rescan_remove(void)\n {\n-\tmutex_unlock(&pci_rescan_remove_lock);\n+\tif (WARN_ON(pci_rescan_remove_owner != current))\n+\t\treturn;\n+\n+\tif (--pci_rescan_remove_depth == 0) {\n+\t\tpci_rescan_remove_owner = NULL;\n+\t\tmutex_unlock(&pci_rescan_remove_lock);\n+\t}\n }\n EXPORT_SYMBOL_GPL(pci_unlock_rescan_remove);\n \n","prefixes":["v13","1/2"]}