{"id":2225552,"url":"http://patchwork.ozlabs.org/api/patches/2225552/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/dd7e59d18ac031af42a65dc0207dc6d9f5780e09.1776755661.git.ionut.nechita@windriver.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/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":"<dd7e59d18ac031af42a65dc0207dc6d9f5780e09.1776755661.git.ionut.nechita@windriver.com>","list_archive_url":null,"date":"2026-04-21T07:19:31","name":"[v12,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":"e03dd71109a493d6d484b3657ee25e7e9507066a","submitter":{"id":92607,"url":"http://patchwork.ozlabs.org/api/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/dd7e59d18ac031af42a65dc0207dc6d9f5780e09.1776755661.git.ionut.nechita@windriver.com/mbox/","series":[{"id":500747,"url":"http://patchwork.ozlabs.org/api/series/500747/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=500747","date":"2026-04-21T07:19:30","name":"PCI/IOV: Fix SR-IOV locking races and AB-BA deadlock","version":12,"mbox":"http://patchwork.ozlabs.org/series/500747/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2225552/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2225552/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-52820-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=RgLfgfxO;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-52820-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=\"RgLfgfxO\"","smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=205.220.166.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 sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::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 4g0DcD0sJfz1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 17:33:32 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 40C7730A9270\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 07:23:37 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 8387028C869;\n\tTue, 21 Apr 2026 07:21:01 +0000 (UTC)","from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com\n [205.220.166.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 8B98D3876AF;\n\tTue, 21 Apr 2026 07:20:59 +0000 (UTC)","from pps.filterd (m0250809.ppops.net [127.0.0.1])\n\tby mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63L4loJ5830856;\n\tTue, 21 Apr 2026 00:20:15 -0700","from bn1pr04cu002.outbound.protection.outlook.com\n (mail-eastus2azon11010059.outbound.protection.outlook.com [52.101.56.59])\n\tby mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4dm9fctsc2-1\n\t(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n\tTue, 21 Apr 2026 00:20:14 -0700 (PDT)","from SJ2PR11MB7546.namprd11.prod.outlook.com (2603:10b6:a03:4cc::8)\n by MN2PR11MB4695.namprd11.prod.outlook.com (2603:10b6:208:260::13) 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:20:12 +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:20:12 +0000"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776756061; cv=fail;\n b=N8jk2WWVKcFZb17Po9Eam7fFgYJp71wWY+i2gBaxB8dXkcnZ3O/tHRgixjf6GrVf0WW83KCO1286FmgKIx2zS4F9aauie/Cj9zoGWobSzwIDSGCoe2ukzEJceM9xyAE3ipd7tbjyy1uAJtpvUv1/VMvvz25bEB+qBeI3dy71bVQ=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=KWaAb/TFvSu72urDhtTW8QXbgYPrqYShDw39dHvX8TNo+Ejd1cGNgAsTp1Pebs/1to3Z0wZwZzmHma5hNrC19QobUGhdN0OJeNKYRR0+MwOTQqHlIAC83yZxdjqvSu2okq03roaLfd4XhiblfpfDzYF8zxOhBdlTvd8FPlwFnOva1OhFEDjryH0REakHA+Z4HLEea6nZGcPKUC8SMw6HcLCEmd1c0kKI/L8JXEqET79hxONNeclfR4t1W+XLdpSvWf2dw9/YmZQnvL1/O5PE/U5njvJGAOx23EE9EKKLtO+TeOXg92p76ETUHg+tFA9tlCYsy2I8S+OobOIN4ti0XQ=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776756061; c=relaxed/simple;\n\tbh=UzHaIcUE3PflFfuBtmUfuNIH5aozBT1kA8m0yJjFFNM=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=F0Ube+q32au2Awcl/e5nwt8Y1/E0V2rxoVzEgLYzXhTg7K8LoejyW7dWA24pYLmirOjyqVSx6XlmnenjHOTxKKa6zga56mRK9fGNngNnF1Bxpwf9PCut2BYJ7rM9A6E0astulU6ZO1ku0j0S4D9eI5OFPTfAP5mFPNEtDI/UQQM=","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=MEbKbes+QfIr46SRFYWl/XvGFmtln2tEt8AomejqZFc=;\n b=YiC7dkRofpMNT/2xSaDPr9cjOc4m6HFOjQ6TSFES0R7rtEY1nMxX8rEHPdZTKdSMRwnfGfi+gJk7wAoiZ09tY6Ub/ESaL2byr5WdzTRwMQLsmXkyHdeXgZh7pJKDvmjYLwp0k/B1Qx21u6S86Ftb+/nCHcbov4ncqx/YMR6/4bfhFZoLTIbG2+ROUYQJ0r1r3dGvMBUc0uaP+ItAigv3JkDUWpj2NJV6+L35vAueal33Pmeu77/HscLD2VZUoeEMs1PuvvJ4Gt8G1kDaeMkG52nWvajtG+d8rxNPj4DSpqXtj/VQoMSS3Kw+egfSn2SluCHZGtUdY3sqk9R7Q7ODEQ=="],"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=RgLfgfxO; arc=fail smtp.client-ip=205.220.166.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=MEbKbes+QfIr46SRFYWl/XvGFmtln2tEt8AomejqZFc=; b=\n\tRgLfgfxOFHAF/Ta6CPojLFfrRkJWCHeMjrWpb/G7CfLna9Ru0vqlbBq0oudmNTBn\n\t90QDAnjaijU1lTsCIZGPwLiTmD5Ppgeur8FSrXOx8gLla8riospy/Ek+0s6IwDUf\n\tzEUiZsVDVbJ72BFy3cpLt3XpYOLxYB5Oth+V9iW8wG4wscSHLyRtvg/r4gw/rWWC\n\t9+OHvCO40ANQqlgYAnLpCN3qPKfONune7pB6OzC42xqpBfxYelcOf7+lSa/9xNtE\n\tM02FLtg8/g2CMMWI/ePRUcNh644hOeRftO1i/0ss2/wUaftKvTR61QzY/e6gMipg\n\tyoWZswsRP4QNJGmDVira/Q==","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 v12 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:19:31 +0300","Message-ID":"\n <dd7e59d18ac031af42a65dc0207dc6d9f5780e09.1776755661.git.ionut.nechita@windriver.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<cover.1776755661.git.ionut.nechita@windriver.com>","References":"<cover.1776755661.git.ionut.nechita@windriver.com>","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-ClientProxiedBy":"VIXP296CA0001.AUTP296.PROD.OUTLOOK.COM\n (2603:10a6:800:2a9::16) 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_|MN2PR11MB4695:EE_","X-MS-Office365-Filtering-Correlation-Id":"2578b0dd-92bd-4baa-2c4b-08de9f766d70","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|366016|376014|7416014|52116014|10070799003|1800799024|56012099003|22082099003|18002099003;","X-Microsoft-Antispam-Message-Info":"\n\tHLOxPJevo/QRXAkOBj9RKj9+xGH0rlH5GJln3wRA6SZWA3DleLtDZ3hR+6I7+0q+dRHaVWr6UicYzb61R9oqY0RQzn6kPUuXtOteOAMQJ6dTzCj8UHeytE7Ysf2FQ5hZCK1wOxSzGk33N6Umiv6bQ2OmVDjH5rZO9Ks3ctddER0KEtt/+efiJrGHllMo9/BlvkJNbwIWETK17/Z0/gNUhfYqhY1Zs1xRysPqlb02LIaGSlnI4b42wqeOyO7fwKNDXL16NKdPdBzlz8DiSQRr4hMgBHrvabaCmou0SLv7YuR5sIuPZj2BQsl0GK3ukaotdxwfLsUIphtQFLM9nZQcEvP46/JJ/qDFwUNi1PGcA7GtKMXzJPVQMGvA92FjNDsPe6OaRY5hZDrGR3k4YfE7OU0ykoKg0/HrIZ1GFXbYkwcE+vOxcd9U+RSTgB1oko90CX9AjIRLvaIr8fchujXYrRWP/6wbpVuMPXkgvPntzz5bc2WwZR68fu81DfzXV9vr52ypYcCb9I9KKxGK+NYEUnaXr1icubHMSFRNkqwEw9HE3m4oMztDxk9N9a2gRnrXxcW6iZu7m8Uyu3NoCPDDOwsmP4J/7BqdXB+X6Pjfl7vltfos+pX+1AtEDN+BsdGqwW/EluOUldFmMW54TSYCw1lJ2qyDvgKxPgj6gU1jy6tIXArF5HVU0DGj/dOd1ncyG/o8iSN3Ddws+VSaucMiLB0X2hG0TSC3dfla3twmlok=","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)(366016)(376014)(7416014)(52116014)(10070799003)(1800799024)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"2","X-MS-Exchange-AntiSpam-MessageData-0":"\n oZqv5ouaMiWMFd6Zisq7ZTym7sorB7RXiOPy5rtO3TTo6a5duMm34/CnUDKg24mCOt9n6cWJw7ae+OJToN1R9b0KamPqM5RTmpsyLoDCO2to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change-CrossTenant-Network-Message-Id":"\n 2578b0dd-92bd-4baa-2c4b-08de9f766d70","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:20:12.6715\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 ibhXX3ng4LizQxc+A3RmjUwOkI4klfSX/cWBixECOZFt6F4/ACqeO03Dv4E6PI1rnILYcPk+KApIOoOfYu8DGFLgsDSSiUJ6ur6ub1+79Do=","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"MN2PR11MB4695","X-Proofpoint-ORIG-GUID":"lJbeOlWLzqKYpJCPrRdtMDYayVQvs8TQ","X-Proofpoint-GUID":"lJbeOlWLzqKYpJCPrRdtMDYayVQvs8TQ","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDIxMDA3MCBTYWx0ZWRfX/jdj2wp1iDEN\n CqB7pyuYr77ECF9G5ELbkmXXiWqdUH5LM9/WLCJ8ViHKvhjfZQBBVC0A05P2Hc/0FFe65B/FXxc\n S9ctyFcTyWrdYtXvh491tk+C5FGd5QnShgCjAiricMjyUKQLhPrYePaRylLFQ40QPAna4dp/RsU\n r53BRhQ8J9Bc99df8/cMK0YTXP4aLbOCwK693E8K9nwObLWOiC5k69s3KS/tOBVQMZIr0t5RGyG\n G56JZUmN8t8yXakREApA18XcXmFN8+m6o/YABGzmudzoS23Ip14CAvAQ2QoDHyGhWv2TP9UD/hN\n TLu4IiA3HsQNb472Tte07N15Soh//4mZvVygJZxZTTdL6t4cmcMWmHa2eLAGZg96Bj0gac6DhW/\n IvV5KbMM5trPIW/ZYlKqkPg9ZKo/SdF2Z3puRY+dSwMlS4w3i9ORtTfaTrAIT3b3QPdZY1fU3mR\n BywAHgR+EpD+4W6fp0Q==","X-Authority-Analysis":"v=2.4 cv=WKZPmHsR c=1 sm=1 tr=0 ts=69e7252e cx=c_pps\n a=V2btASzwI3AgjbPAPCrjFw==: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=iKiJcTA2PjBS6x5JeXcw: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 clxscore=1015 suspectscore=0 bulkscore=0 impostorscore=0 phishscore=0\n spamscore=0 adultscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604210070"},"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 using mutex_get_owner()\nand a reentrant depth counter, as suggested by Lukas Wunner and\nBenjamin Block, since these recursive locking scenarios exist elsewhere\nin the PCI subsystem:\n - If the lock is already held by the current task (checked via\n   mutex_get_owner()): increments the reentrant counter and returns\n   without re-acquiring, avoiding deadlock.\n - If the lock is held by another task: blocks until the lock is\n   released, providing complete serialization.\n - If the lock is not held: acquires the mutex normally.\n\npci_unlock_rescan_remove() decrements the reentrant counter if it is\nnon-zero, otherwise releases the mutex.\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>\nReviewed-by: Benjamin Block <bblock@linux.ibm.com>\nTested-by: Benjamin Block <bblock@linux.ibm.com>\nReviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>\nTested-by: Niklas Schnelle <schnelle@linux.ibm.com> # s390\nSigned-off-by: Ionut Nechita <ionut.nechita@windriver.com>\n---\n drivers/pci/iov.c   |  9 +++++----\n drivers/pci/probe.c | 11 +++++++++--\n 2 files changed, 14 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..ec45783230dc 100644\n--- a/drivers/pci/probe.c\n+++ b/drivers/pci/probe.c\n@@ -3513,16 +3513,23 @@ 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 size_t pci_rescan_remove_reentrant_count;\n \n void pci_lock_rescan_remove(void)\n {\n-\tmutex_lock(&pci_rescan_remove_lock);\n+\tif (mutex_get_owner(&pci_rescan_remove_lock) == (unsigned long)current)\n+\t\tpci_rescan_remove_reentrant_count++;\n+\telse\n+\t\tmutex_lock(&pci_rescan_remove_lock);\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 (pci_rescan_remove_reentrant_count > 0)\n+\t\tpci_rescan_remove_reentrant_count--;\n+\telse\n+\t\tmutex_unlock(&pci_rescan_remove_lock);\n }\n EXPORT_SYMBOL_GPL(pci_unlock_rescan_remove);\n \n","prefixes":["v12","1/2"]}