{"id":2226057,"url":"http://patchwork.ozlabs.org/api/patches/2226057/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/87f609ef2eb1308daff16fa943ee204f5bdc40ea.1776839248.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":"<87f609ef2eb1308daff16fa943ee204f5bdc40ea.1776839248.git.ionut.nechita@windriver.com>","list_archive_url":null,"date":"2026-04-22T06:32:42","name":"[v14,2/2] PCI: Fix AB-BA deadlock between device_lock and pci_rescan_remove_lock in remove_store","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f02d328612670fc004b87f615aa7d84f4ff767f6","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/87f609ef2eb1308daff16fa943ee204f5bdc40ea.1776839248.git.ionut.nechita@windriver.com/mbox/","series":[{"id":500927,"url":"http://patchwork.ozlabs.org/api/series/500927/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=500927","date":"2026-04-22T06:32:40","name":"PCI/IOV: Fix SR-IOV locking races and AB-BA deadlock","version":14,"mbox":"http://patchwork.ozlabs.org/series/500927/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226057/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226057/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-52923-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=ncJKUFO6;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-52923-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=\"ncJKUFO6\"","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=fail smtp.mailfrom=windriver.com"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\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 4g0qL63G7Wz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 16:38:22 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 3A09F306F32D\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 06:34:50 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6B3AB30F95F;\n\tWed, 22 Apr 2026 06:34:46 +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 E60F73101B8;\n\tWed, 22 Apr 2026 06:34:40 +0000 (UTC)","from pps.filterd (m0250812.ppops.net [127.0.0.1])\n\tby mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63M5gD6q943792;\n\tWed, 22 Apr 2026 06:34:05 GMT","from ph7pr06cu001.outbound.protection.outlook.com\n (mail-westus3azon11010051.outbound.protection.outlook.com [52.101.201.51])\n\tby mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4dpenv8hep-1\n\t(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n\tWed, 22 Apr 2026 06:34:04 +0000 (GMT)","from SN7PR11MB7540.namprd11.prod.outlook.com (2603:10b6:806:340::7)\n by SJ0PR11MB5197.namprd11.prod.outlook.com (2603:10b6:a03:2d1::24) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.16; Wed, 22 Apr\n 2026 06:34:02 +0000","from SN7PR11MB7540.namprd11.prod.outlook.com\n ([fe80::2edd:5c6d:169c:389b]) by SN7PR11MB7540.namprd11.prod.outlook.com\n ([fe80::2edd:5c6d:169c:389b%6]) with mapi id 15.20.9846.016; Wed, 22 Apr 2026\n 06:34:02 +0000"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776839686; cv=fail;\n b=blDTOsLhPCLXEVNVj3ePAHpNrCau9NfzwB99TOKkZWmpD1LgtL+i+MyiQa0kTUbyx2tqJS5X9s5QpiuTBVyuGc2+ZcwKzdWlIjxygpzU+LYpmIRzmk9Qc/FgQKciMDbiq3NeYfoE5GEgCZHtDWj6oZe8Fz+BJffrBDdz8Yu0W3U=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=MW++Ox3gcMUZNvBPGfMhFujwz/XXty5jeCf3zEbUBNXfwAgSynZiOIAZ+oBxUtRRLmOJ1+WD8UPcR22lTwCqMI8Ojzl1gddQ1UK62JwqnjE/ATYU3TTyP9FMCttroKQPphO/Gqk2/FO1DstNckkDOTE7zcKL2MoA6uiP1h3vtxfTu0CsU3B10V1UzDs/EJ1nMEJDGnS2rey3Tg7N+UmNwQ4GMa8VkWN0tPGkIrSbHvqtGaZ/lzkEF64NErzXWc/31Yj5DzFY9RslgR5bJElfRY5zIorCOO1tVZUvHdaITBJsmekXIQMqv8l4aDsMB2ZRHJWYl15kk6GfkcaHiKUisw=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776839686; c=relaxed/simple;\n\tbh=vrJgq2ubLedxXwnejb8xqvFNi+iBVzJof5NUXTpqQ60=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=uMq0NsgGJ3+YAGOkTDFlJ6ax64vOpyLfEA00g9gpI/xmH60CaMfG7phY9AeslWiV07xtXfcPdP5Z4QVndO0TbBtDnrWjoxs2DTiVe1o006bhjnCvsPQd7QTSXnmAKei6w258SCPEeuzPm3XjVbM7x1RcxH+0cesKbWS1YxjdzXM=","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=edruRNhOFxoTqLpoRttq5X20SXLnytn48rYp1IqcNcs=;\n b=h+wHBdlN+D30Gxg0a8c3OohMykJ3cjti4y5O8XVx3A0wNvFTa9294adbqoLrCvfw4XikwbhKRdAI2dgohhkkIXQiP7N8z8j6mMkiDWXNQJVi+y80SJRTL1B0shHmd6TTsNS3ShJPDKjiT6ppHsll6d8x08daQKGogGgaCdazcc6AQ58pK5xg5j5mlHRPMieChk90uIyNGEa8T8VsUEGtSmHu9kWWee1x2Jm+kfJJBCd8X6pD8fKuhk6iEFNz4S48szPzT3X/6p9/RldaBinDth4fQbXTpI4IjIYmCrDqiIezn3R76RCj3op1mDUz6fwgzgjYDssjp7FbKLDXSK3dRg=="],"ARC-Authentication-Results":["i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=windriver.com;\n spf=fail smtp.mailfrom=windriver.com;\n dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com\n header.b=ncJKUFO6; 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=edruRNhOFxoTqLpoRttq5X20SXLnytn48rYp1IqcNcs=; b=\n\tncJKUFO6DchRS46poZs7L2jRYyXoTgo42V9slULzqi5b/ebO6BocjuhiYxjju5nl\n\t3ZMcUrADFGfbpYyzEMponkOxp4JDT1g671Q/2kXIOOkaiAnyIDOixq1iEWfMxmJ2\n\tCTnXZqpX75VEeagnWpoy0CNE/SFza9fW5Ztkl3YwbNkoY5R5XLf13evLjk8D+ybP\n\taBxssiczL4uwdNkgua+Bz57e02hOPPhf4gh5dUvf/PgAz4KDpJ/bxzN0OQiWncfi\n\tGzXBEQUmDB6d8B7JRl2t31IBNXim2AmdyJdpPWt8MHhG0A1Vn8k8EN24971Cmq1a\n\t5nOVuXlnu6NsxeQqQNUEEQ==","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 v14 2/2] PCI: Fix AB-BA deadlock between device_lock and\n pci_rescan_remove_lock in remove_store","Date":"Wed, 22 Apr 2026 09:32:42 +0300","Message-ID":"\n <87f609ef2eb1308daff16fa943ee204f5bdc40ea.1776839248.git.ionut.nechita@windriver.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<cover.1776839248.git.ionut.nechita@windriver.com>","References":"<cover.1776839248.git.ionut.nechita@windriver.com>","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-ClientProxiedBy":"VIYP296CA0004.AUTP296.PROD.OUTLOOK.COM\n (2603:10a6:800:29d::15) To PH0PR11MB7541.namprd11.prod.outlook.com\n (2603:10b6:510:26d::16)","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":"SN7PR11MB7540:EE_|SJ0PR11MB5197:EE_","X-MS-Office365-Filtering-Correlation-Id":"0fb5f609-14a1-484c-c507-08dea03923f4","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|1800799024|366016|10070799003|7416014|376014|52116014|22082099003|56012099003|18002099003;","X-Microsoft-Antispam-Message-Info":"\n\tDLS1E3T0dqlGW1YNkU3ezEZmo3oLx1pp2dKZkNyVm8owdCwciB93HS1nUdC8kP3dt5zsiNWZl3QnfUkMYUaXSKIeWDsHX6wMTZasWeHp+DrrjtkNp2xWiJrb+hD6Prc4TE3IjTmsSUtvm5BniNbw/xlyiZP2lUNlex4Dx0853SbUSoJm71MZc/KOeNKYdPxFYfwGALuww9altyjQ67m5cnxJNFRw7oRvNHvj97qGQ3T8KWecYKwky0CI39D8cEJrcXNAdyYQwD5T1CphIxnr0Ohn9FBPplj/g1VicN/tgpt9XV6leG0wvbvp/DAsSyk9nm1F2v7eUm5apCSYgY+TLMchbcm+k0Ov9tFVaure/qS6TGhskb+YZ5EmhKCZDEDsA7EFF8m/xYo/CBO43OyCwhtg5PzCZW93W0yTXPzFVLZR4X8hIFseQfwfyWjrcSo5uGOqTtzhfAaDHl4cyQIyTLrpgNU53oCKVtx852ry1LT1KoVfF0IqDChvHTUmAWbGFe2cIsJoBnMFde8QaIMqeqZhvB5yI84hHaPtWrIeoI1zmNkbbA0Xqs43+Nkudpx/ZbtUQp1M/JKptkdHuXqEpmUJilU1rO/i1TcwQ6UDnDfnEDGtx+jklOtFwOf9fyFnSmHxnqTR1LXkADDXhuH/m7ECSGhWW4wFhFP90aMQ/sXnKJXrqw32swIMWF6ZVHID","X-Forefront-Antispam-Report":"\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR11MB7540.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(10070799003)(7416014)(376014)(52116014)(22082099003)(56012099003)(18002099003);DIR:OUT;SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"2","X-MS-Exchange-AntiSpam-MessageData-0":"\n D9pmhzNb+EX/FMQcU1vzc8p4Qj90dd39awkj64zaxUDMWwuJLOlLHuejk5cKGrvD76ZHpi/qxPkV8kmFJHgBLDzBqjpjt+P/mYjPCEq+TpS7KZaJT988LCqzASWxrFrvV+q85clO8tLdga/31GyftWjYOG2GECXaFEz523xcCMvMYmF99+rbpOGTe+6QJ14IP/ILGw8iqrms8fPZub2nXh8nEmLh+1RD0G+ohNJCFsE5oCIhDL+iRBaC0UKhl+WWKYTx2b+AXZk7HkYdaMZ8m1mv1N9ih1QWQGR2JOXTGrir+CFzlPWj39RZ5GrHZVzqWA599bq1ukHqqQrq5H3FXNW0N2rpAhPleiZ0EFft1jcwQXbaaU39k3OeOLy7DLWVtQv5M6sJiCDpsNR0ZsMI31c4Mkixh2tiXexb74HsQorviN0Jl0bXH1PwJqLnSrThL8+Dnsqm5QEw3LvqPGmF+IAM6HxCJZpWn4gPSvQC/yRw1bCPLGq77Phb2CHyDlFlq/Rw3k1gkmoQewF1hh6pBqj83lTloS2dgFHq9UlddVLuxfEJ6X/kU8PrcBu1NODuY/jjay3ff1jp2NKTKrOZpfwS3Gl/a2i2o2eI8g7Vi+PatjBEClK2XCm/+RW2XhxW/kRcmQB9FMfXA7mm3wdsqssUfIlk7bG41vvnp3aAF5k5iDYRDm5RA8RQHRYQS96/q+Ut9YH/b6Yqr6lKZfWaRSmh6R0nVhNfsMwfbQ/Sj3yBkL0YscT7KEFMXsHYI+ar0ddwDOWgpsSkBMY2cYiv/qiqAYOwhAGBFK5T4yZFywhBkvOZ9Z702Qb43s07X8Kou5+NKsYzIA/q5kuinwSyFnJVGHugrUb7oo92bZmCju0Qn91/5hDpZQjMSmPbxotGbNh0mDILQApvwMtNjtujdQlLNqiLsVxAkH07/JQM2NWH0hHDv55QefxTx4IT/6+dC/poH65ZCl8ZbZTaafotapRXC8tG4bjWy7c3jtHg9xSIiB8yrqzkmNcvsLtdU+xmJU1SH/828BL6c/Pzcv3erK+aHwUicKDknMauLD2lyHxGsXwsf4uTg+DGIeFLyoGTlSHkhQ1nwuoHrXL5U1m6eGkQsULLqQufVoWyYosAbecArmus509deUBT1mms72BNU4vYRkRI6tKQ93/DOUNLd/QVUx4GShKY62Zsb9YfH59CmO895nFAh4MMz6mT+YDVeA4VxCbXQ7VICaJ2Fpj4W9MIdmkpzUUfwlzlKml9IcR55F4STDbzX9uFjrjzPL1rTmpq9m3XG4OLb1Ci+4+k8jfT4pTjf1rzaP93fzd6brtF11OOat7OYSJ6JMK0BJfPnWZwp6EUAYGSZ88cweogTpMPQww0F7Rvfao8mEZNbfR8J5Ffsdl19mC0cxfl4jNLILyy6g2gReQeI6HhGTIb9Sn/IHuhRmYVkob/PJdc2YhzBFIIzs2Tx13clJgW4AWMB6Y64XPk92G/B6AvHdYh4DNndLmD8KauDWb5VpvBVyPp1qZAV2HknphUzj3wchbi/uVN+pM3KwW2PF82Nw4yvuMDXXEnJsmZEd6WEgcBRfuJSiJUF0LLbiL6rkmDfJCA0eEB22spgzjayHTkvZIOmJted/5j6NES5yF3YGsC+Fd4HPjNR4l0aTKL+UIjht7XQarNaQs0HDdSMgUSgUxXuoy86AqJg82RVK3CjOgyo28mOWlJNDN5bwhh7PI61Eqx6QwAQ0iICes/7QYjP8u/dN/CGfYmqebQFAcDVyFiSV4eVeQIlrRPP3p2I0EMMfAnIXu7LNNv","X-MS-Exchange-AntiSpam-MessageData-1":"fPHmlt3z1dmgm50nuShZqrNoYuPB7p8Btr4=","X-Exchange-RoutingPolicyChecked":"\n\tkn6wYRH0jAYTXCtHhAuNnPoa8Eee+qLqvClCXupoYe8YkcLEVwYomar5RBTE1NLDwEaLms4NJHawLQ5zVPTjLGQz/wgJkz17mMt6rJP6MpNOUtLfvyHF/RYxAPVqjPb6F9ziXJ2cM97ECpVT5aVQ26f0s1tj/n1zn6rSpzOM9VENh/leIZXYisvLbAL8Y3YKIRx4PpoVl85LnDyg2l6hOq1fYt2KMiv6xoHFBoLryD+mE/jKpnObNnu3FCkn1jy6zfTeP5e47Jwwmv+wT/SCTFPL1uzxHqD2Wh1ycYzyJPOFR+EegLFdlh8+NKihnkLi0InpFJD6IzCavlXwCA+sWw==","X-OriginatorOrg":"windriver.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 0fb5f609-14a1-484c-c507-08dea03923f4","X-MS-Exchange-CrossTenant-AuthSource":"PH0PR11MB7541.namprd11.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"22 Apr 2026 06:34:01.8982\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 uCbofIRii7vYnwfI+m2xP0phhJCoSijVdLLViTi1YxDZW+XXvcLTOUD8ZqHA+PcHRJS6fypV4WUVPUUj3ITs3D8sUnElzUohJ0czTMefKGg=","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"SJ0PR11MB5197","X-Proofpoint-ORIG-GUID":"izl7XkIqjWzYp0mKzIarLw-qOGboySbs","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDIyMDA1OSBTYWx0ZWRfX+IFAwoYD046C\n Uw/B+NlEFflkJuPjPvXsp+95WLtKic8pzdxH2zCetkcyrAkT8mHi69zZFEbIcBaoP/Z3R+XrMjh\n gVbEq4OiH/HoLpu2Z/+fByx9vPEkyxuozaWhScPhcFVtzHb71EGs3mt3NCVswS8stQfXEDTVbVX\n k9Ys6RKETgFnAWOWkCEYxw5z+Git7YNjLJHTBW2wxT1bR4+aGEwldNzU2w2G2JRSUgpJQmee9u2\n TU8mUvv73vp1MTgKjOgixv9jJstYnvUsAYkRDKVltqTQg2mXx5JyT4i4Vb3Y5LwGRqb75vix+et\n 1HH9KBG8fhEw8YLkMOssU+5vF9eqoSEgdeXi+Nk8+VfzpKJ8gBl4BCkov4RcKmiyYt4hfHPhhJi\n noSrTT9EKtx62RZjRW5UyHh7j5sbNqtYq1M9a6iwnqLfQzDRPXDUhy7qO21cVzBu85znv2i4Dh4\n ngMCQiv+NnQxefmxcoA==","X-Authority-Analysis":"v=2.4 cv=B9yJFutM c=1 sm=1 tr=0 ts=69e86bdc cx=c_pps\n a=f0OpuPnQRmDrWRgsA3vZMw==: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=fTW__CHxibyLmBMfj2wP:22 a=VwQbUJbxAAAA:8\n a=_jlGtV7tAAAA:8 a=p2eoyRXnAAAA:8 a=t7CeM3EgAAAA:8 a=VnNF1IyMAAAA:8\n a=mm2UkWPFonPHBTd3Hn4A:9 a=nlm17XC03S6CtCLSeiRr:22 a=KSHYvF9M28j0gckGFaEs:22\n a=FdTzh2GWekK77mhwV6Dw:22","X-Proofpoint-GUID":"izl7XkIqjWzYp0mKzIarLw-qOGboySbs","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_03,2026-04-21_02,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n clxscore=1015 malwarescore=0 lowpriorityscore=0 impostorscore=0\n suspectscore=0 phishscore=0 bulkscore=0 priorityscore=1501 adultscore=0\n spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound\n adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000\n definitions=main-2604220059"},"content":"From: Ionut Nechita <ionut.nechita@windriver.com>\n\nremove_store() calls pci_stop_and_remove_bus_device_locked() which\ntakes pci_rescan_remove_lock first, then device_lock during driver\nrelease.  Meanwhile, unbind_store() takes device_lock first (via\ndevice_driver_detach), and the driver's .remove() callback may call\npci_disable_sriov() -> sriov_del_vfs() -> pci_lock_rescan_remove().\n\nThis creates an AB-BA deadlock:\n\n  CPU0 (remove_store)               CPU1 (unbind_store)\n  --------------------              --------------------\n  pci_lock_rescan_remove()\n                                    device_lock()\n                                    driver .remove()\n                                      sriov_del_vfs()\n                                        pci_lock_rescan_remove()  <-- WAITS\n  pci_stop_bus_device()\n    device_release_driver()\n      device_lock()                                               <-- WAITS\n\nFix this by first marking the device as dead using kill_device() to\nprevent any new driver from binding, then calling device_release_driver()\nbefore pci_stop_and_remove_bus_device_locked().\n\nMarking the device dead closes the race window between unbinding and\nremoval where a new driver could theoretically bind: once the dead flag\nis set, the device core will refuse any new driver probe.\n\nAfter device_release_driver() returns, the driver is already unbound,\nso the subsequent device_release_driver() call inside\npci_stop_and_remove_bus_device_locked() becomes a no-op.\n\nFixes: a5338e365c45 (\"PCI/IOV: Fix race between SR-IOV enable/disable and hotplug\")\nReported-by: Guenter Roeck <linux@roeck-us.net>\nCloses: https://lore.kernel.org/linux-pci/0ca9e675-478c-411d-be32-e2d81439288f@roeck-us.net/\nReported-by: Benjamin Block <bblock@linux.ibm.com>\nCloses: https://lore.kernel.org/linux-pci/20260317090149.GA3835708@chlorum.ategam.org/\nSuggested-by: Benjamin Block <bblock@linux.ibm.com>\nCc: stable@vger.kernel.org\nReviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>\nReviewed-by: Benjamin Block <bblock@linux.ibm.com>\nTested-by: Benjamin Block <bblock@linux.ibm.com>\nSigned-off-by: Ionut Nechita <ionut.nechita@windriver.com>\n---\n drivers/pci/pci-sysfs.c | 30 +++++++++++++++++++++++++++++-\n 1 file changed, 29 insertions(+), 1 deletion(-)","diff":"diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c\nindex d37860841260..1426328e9f05 100644\n--- a/drivers/pci/pci-sysfs.c\n+++ b/drivers/pci/pci-sysfs.c\n@@ -521,8 +521,36 @@ static ssize_t remove_store(struct device *dev, struct device_attribute *attr,\n \tif (kstrtoul(buf, 0, &val) < 0)\n \t\treturn -EINVAL;\n \n-\tif (val && device_remove_file_self(dev, attr))\n+\tif (val && device_remove_file_self(dev, attr)) {\n+\t\t/*\n+\t\t * Mark the device as dead so that no new driver can bind\n+\t\t * between the unbind and the removal below.  Once the\n+\t\t * dead flag is set, the device core will refuse any new\n+\t\t * driver probe.\n+\t\t */\n+\t\tdevice_lock(dev);\n+\t\tkill_device(dev);\n+\t\tdevice_unlock(dev);\n+\n+\t\t/*\n+\t\t * Unbind the driver before removing the device to avoid\n+\t\t * an AB-BA deadlock between device_lock and\n+\t\t * pci_rescan_remove_lock.  Without this, remove_store\n+\t\t * takes pci_rescan_remove_lock first (via\n+\t\t * pci_stop_and_remove_bus_device_locked) and then\n+\t\t * device_lock during driver release, while a concurrent\n+\t\t * unbind_store (or sriov_numvfs_store) takes device_lock\n+\t\t * first and then pci_rescan_remove_lock (via\n+\t\t * sriov_del_vfs), creating a circular dependency.\n+\t\t *\n+\t\t * By unbinding first, the driver's .remove() callback\n+\t\t * (including any SR-IOV VF cleanup) completes before\n+\t\t * pci_rescan_remove_lock is acquired, ensuring both\n+\t\t * paths take locks in the same order.\n+\t\t */\n+\t\tdevice_release_driver(dev);\n \t\tpci_stop_and_remove_bus_device_locked(to_pci_dev(dev));\n+\t}\n \treturn count;\n }\n static DEVICE_ATTR_IGNORE_LOCKDEP(remove, 0220, NULL,\n","prefixes":["v14","2/2"]}