Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2197370/?format=api
{ "id": 2197370, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2197370/?format=api", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/1.0/projects/28/?format=api", "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 }, "msgid": "<20260217182257.1582-4-alifm@linux.ibm.com>", "date": "2026-02-17T18:22:51", "name": "[v9,3/9] PCI: Avoid saving config space state in reset path", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "7778cfaf1184e097fa1a6d4a25e142797ab6a725", "submitter": { "id": 73785, "url": "http://patchwork.ozlabs.org/api/1.0/people/73785/?format=api", "name": "Farhan Ali", "email": "alifm@linux.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260217182257.1582-4-alifm@linux.ibm.com/mbox/", "series": [ { "id": 492470, "url": "http://patchwork.ozlabs.org/api/1.0/series/492470/?format=api", "date": "2026-02-17T18:22:49", "name": "Error recovery for vfio-pci devices on s390x", "version": 9, "mbox": "http://patchwork.ozlabs.org/series/492470/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2197370/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-pci+bounces-47497-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=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=ekwOwdag;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-47497-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com\n header.b=\"ekwOwdag\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=148.163.156.1", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.ibm.com" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 4fFp336wHtz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Feb 2026 05:25:03 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 29BF730668BD\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 17 Feb 2026 18:23:20 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 0E36E372B3B;\n\tTue, 17 Feb 2026 18:23:18 +0000 (UTC)", "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n [148.163.156.1])\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 E87C7374167;\n\tTue, 17 Feb 2026 18:23:12 +0000 (UTC)", "from pps.filterd (m0356517.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 61HG5F6L2616022;\n\tTue, 17 Feb 2026 18:23:05 GMT", "from ppma23.wdc07v.mail.ibm.com\n (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj6unjwu-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tTue, 17 Feb 2026 18:23:04 +0000 (GMT)", "from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1])\n\tby ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 61HFpo7W017792;\n\tTue, 17 Feb 2026 18:23:03 GMT", "from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69])\n\tby ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4ccb28c3x8-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tTue, 17 Feb 2026 18:23:03 +0000", "from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com\n [10.241.53.104])\n\tby smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 61HIN1rS31261314\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n\tTue, 17 Feb 2026 18:23:02 GMT", "from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id C28AF58065;\n\tTue, 17 Feb 2026 18:23:01 +0000 (GMT)", "from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id E0F4058052;\n\tTue, 17 Feb 2026 18:23:00 +0000 (GMT)", "from IBM-D32RQW3.ibm.com (unknown [9.61.242.249])\n\tby smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP;\n\tTue, 17 Feb 2026 18:23:00 +0000 (GMT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771352597; cv=none;\n b=uBZOrWSZRk9cyeDIdVjLx0sEM90SYRL6P05Ulz+IPKRvnPyxNddudZCo5gjNBjfBvzY7mfd7B75kD8U+3SxvFrXxugMRliesqlA3MsUpfj9Jk+qtRvJCTXdqlGrcnV/QOGq7mJW5HjTjRzUju7JgYT4FU06fJdxq3w05GyaUiEs=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771352597; c=relaxed/simple;\n\tbh=Dl44cojdkrbOgz7OGnWK4SZITJpO4H3rbatvSyA7VZc=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Jrqtc/o4C7HeNenazwMt9d4TZx/ftnY1mnYWrtqVyrvyII5UxsCTrSQInIYOtqILo8lfQFZeFFVlWuD065NUmZ3bSwDV+Y3aZFj6OoBRVza88rOJZR5T+AfxB6r3JJKio0o7FCoQiMsBbsfeM37LEokK8VH7qxPfMEHW10f/TNU=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com;\n spf=pass smtp.mailfrom=linux.ibm.com;\n dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com\n header.b=ekwOwdag; arc=none smtp.client-ip=148.163.156.1", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n\t:content-transfer-encoding:date:from:in-reply-to:message-id\n\t:mime-version:references:subject:to; s=pp1; bh=ijoU0uqIQ0OGxfqCL\n\t84PUTuv0JTag63LZuisjraDBW4=; b=ekwOwdagL6umvfLZNjH4m0oSQBqs6/ad9\n\tSztPcqBaLwvnW6Aqi+3kPe7zULTrnkFDZA6rS4IXQTFupLV2xTcVfYQiHqcH3WZK\n\tYDNj7tXRYZ2sMCZxQoPpFUIxKeEP6XJiREIt87dOBMFFwHD1XrqatSoUS2UbhnJU\n\tEjx7bwndwZ1ucyrz2EAi0EeDZP3GSuLK0MIu1FieKQVjU5pFSdT5Kq3QUpXW9bZQ\n\tVJNAoM89PvoSrqIWy2QqEIP4hPz1mfXgAummMI8021mNzuSfKUq8vyJhv+DyMFn+\n\t028mkEIYma563RP6kXHOi910LEfg8PL6xfDflXjA8njTDQqoo2VLg==", "From": "Farhan Ali <alifm@linux.ibm.com>", "To": "linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-pci@vger.kernel.org", "Cc": "helgaas@kernel.org, lukas@wunner.de, alex@shazbot.org, clg@redhat.com,\n stable@vger.kernel.org, alifm@linux.ibm.com, schnelle@linux.ibm.com,\n mjrosato@linux.ibm.com, Bjorn Helgaas <bhelgaas@google.com>", "Subject": "[PATCH v9 3/9] PCI: Avoid saving config space state in reset path", "Date": "Tue, 17 Feb 2026 10:22:51 -0800", "Message-ID": "<20260217182257.1582-4-alifm@linux.ibm.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260217182257.1582-1-alifm@linux.ibm.com>", "References": "<20260217182257.1582-1-alifm@linux.ibm.com>", "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", "Content-Transfer-Encoding": "8bit", "X-TM-AS-GCONF": "00", "X-Proofpoint-Reinject": "loops=2 maxloops=12", "X-Authority-Analysis": "v=2.4 cv=E+/AZKdl c=1 sm=1 tr=0 ts=6994b209 cx=c_pps\n a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17\n a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22\n a=GgsMoib0sEa3-_RKJdDe:22 a=1XWaLZrsAAAA:8 a=VnNF1IyMAAAA:8\n a=hbZPLYCdMM6bdNz2SwkA:9", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMjE3MDE0OCBTYWx0ZWRfXzu7tBop/26/O\n dyqM8W/yAqq7n5M+YJiqVG3G7AjzQ0FW7HQRL6hg06UIpNGdJiMTRaFR6EhScAcIB6cyBdcI3cw\n 91tHjYemFlZ1XOkGXiW07Vf8F8jOhklEjISmJsZUEYxRpzhr5RGMt0+smCPrrCC9XrXON4CbAq3\n jEw6pVOhp04ZHaCN7mbi2WxQzh0K76OvRY2qn4erPOa+denS0chfATSPsADXVqyRbMqI6Msqg+8\n A23qyhHk1uRQLrXY0njkEVtyuZnjOQ9+Z3ApzLIZNonXG8nbn567PlOUrUSXEoygYqffUL0hXE8\n HI8OLD4bUdbv/gk7UVBcFcLKH374CTZiaC8BZmR3mzykdbk5d9d9MM42GI7gUObphozpiFv+Kg8\n hSgPD1bZMDGX2C5/Enomhvxx3Hw7tSXJKUaKeP8sIxnGvNrKZQGjm/DT98hHCXmWnJcX34hYFim\n WI2WSPYIzaw1JhN1wuQ==", "X-Proofpoint-ORIG-GUID": "xERkUY4qU36jSMR8DLK3le5_fVuTp6nC", "X-Proofpoint-GUID": "g75EdxLNhCONvZs-rE4XixChsgVPXg9H", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-02-17_03,2026-02-16_04,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 bulkscore=0\n suspectscore=0 spamscore=0 clxscore=1015 impostorscore=0 adultscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602170148" }, "content": "The current reset process saves the device's config space state before\nreset and restores it afterward. However errors may occur unexpectedly and\nit may then be impossible to save config space because the device may be\ninaccessible (e.g. DPC) or config space may be corrupted. This results in\nsaving corrupted values that get written back to the device during state\nrestoration.\n\nSince commit a2f1e22390ac (\"PCI/ERR: Ensure error recoverability at all times\"),\nwe now save the state of device at enumeration. On every restore we should\neither use the enumeration saved state or driver's intentional saved state,\nnever a state saved at the unpredictable time of an error recovery reset.\n\nSuggested-by: Bjorn Helgaas <bhelgaas@google.com>\nSigned-off-by: Farhan Ali <alifm@linux.ibm.com>\n---\n drivers/pci/pci.c | 32 +++++++++++++++-----------------\n 1 file changed, 15 insertions(+), 17 deletions(-)", "diff": "diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c\nindex 3090c727b76f..2242b97e7d46 100644\n--- a/drivers/pci/pci.c\n+++ b/drivers/pci/pci.c\n@@ -5012,7 +5012,7 @@ void pci_dev_unlock(struct pci_dev *dev)\n }\n EXPORT_SYMBOL_GPL(pci_dev_unlock);\n \n-static void pci_dev_save_and_disable(struct pci_dev *dev)\n+static void pci_dev_disable(struct pci_dev *dev)\n {\n \tconst struct pci_error_handlers *err_handler =\n \t\t\tdev->driver ? dev->driver->err_handler : NULL;\n@@ -5029,13 +5029,11 @@ static void pci_dev_save_and_disable(struct pci_dev *dev)\n \t\tpci_warn(dev, \"resetting\");\n \n \t/*\n-\t * Wake-up device prior to save. PM registers default to D0 after\n-\t * reset and a simple register restore doesn't reliably return\n-\t * to a non-D0 state anyway.\n+\t * PM registers default to D0 after reset and a simple register\n+\t * restore doesn't reliably return to a non-D0 state.\n \t */\n \tpci_set_power_state(dev, PCI_D0);\n \n-\tpci_save_state(dev);\n \t/*\n \t * Disable the device by clearing the Command register, except for\n \t * INTx-disable which is set. This not only disables MMIO and I/O port\n@@ -5199,7 +5197,7 @@ int pci_reset_function(struct pci_dev *dev)\n \t\tpci_dev_lock(bridge);\n \n \tpci_dev_lock(dev);\n-\tpci_dev_save_and_disable(dev);\n+\tpci_dev_disable(dev);\n \n \trc = __pci_reset_function_locked(dev);\n \n@@ -5241,7 +5239,7 @@ int pci_reset_function_locked(struct pci_dev *dev)\n \tif (!pci_reset_supported(dev))\n \t\treturn -ENOTTY;\n \n-\tpci_dev_save_and_disable(dev);\n+\tpci_dev_disable(dev);\n \n \trc = __pci_reset_function_locked(dev);\n \n@@ -5267,7 +5265,7 @@ int pci_try_reset_function(struct pci_dev *dev)\n \tif (!pci_dev_trylock(dev))\n \t\treturn -EAGAIN;\n \n-\tpci_dev_save_and_disable(dev);\n+\tpci_dev_disable(dev);\n \trc = __pci_reset_function_locked(dev);\n \tpci_dev_restore(dev);\n \tpci_dev_unlock(dev);\n@@ -5441,17 +5439,17 @@ static int pci_slot_trylock(struct pci_slot *slot)\n }\n \n /*\n- * Save and disable devices from the top of the tree down while holding\n+ * Disable devices from the top of the tree down while holding\n * the @dev mutex lock for the entire tree.\n */\n-static void pci_bus_save_and_disable_locked(struct pci_bus *bus)\n+static void pci_bus_disable_locked(struct pci_bus *bus)\n {\n \tstruct pci_dev *dev;\n \n \tlist_for_each_entry(dev, &bus->devices, bus_list) {\n-\t\tpci_dev_save_and_disable(dev);\n+\t\tpci_dev_disable(dev);\n \t\tif (dev->subordinate)\n-\t\t\tpci_bus_save_and_disable_locked(dev->subordinate);\n+\t\t\tpci_bus_disable_locked(dev->subordinate);\n \t}\n }\n \n@@ -5477,16 +5475,16 @@ static void pci_bus_restore_locked(struct pci_bus *bus)\n * Save and disable devices from the top of the tree down while holding\n * the @dev mutex lock for the entire tree.\n */\n-static void pci_slot_save_and_disable_locked(struct pci_slot *slot)\n+static void pci_slot_disable_locked(struct pci_slot *slot)\n {\n \tstruct pci_dev *dev;\n \n \tlist_for_each_entry(dev, &slot->bus->devices, bus_list) {\n \t\tif (!dev->slot || dev->slot != slot)\n \t\t\tcontinue;\n-\t\tpci_dev_save_and_disable(dev);\n+\t\tpci_dev_disable(dev);\n \t\tif (dev->subordinate)\n-\t\t\tpci_bus_save_and_disable_locked(dev->subordinate);\n+\t\t\tpci_bus_disable_locked(dev->subordinate);\n \t}\n }\n \n@@ -5566,7 +5564,7 @@ static int __pci_reset_slot(struct pci_slot *slot)\n \t\treturn rc;\n \n \tif (pci_slot_trylock(slot)) {\n-\t\tpci_slot_save_and_disable_locked(slot);\n+\t\tpci_slot_disable_locked(slot);\n \t\tmight_sleep();\n \t\trc = pci_reset_hotplug_slot(slot->hotplug, PCI_RESET_DO_RESET);\n \t\tpci_slot_restore_locked(slot);\n@@ -5660,7 +5658,7 @@ int __pci_reset_bus(struct pci_bus *bus)\n \t\treturn rc;\n \n \tif (pci_bus_trylock(bus)) {\n-\t\tpci_bus_save_and_disable_locked(bus);\n+\t\tpci_bus_disable_locked(bus);\n \t\tmight_sleep();\n \t\trc = pci_bridge_secondary_bus_reset(bus->self);\n \t\tpci_bus_restore_locked(bus);\n", "prefixes": [ "v9", "3/9" ] }