Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/971352/?format=api
{ "id": 971352, "url": "http://patchwork.ozlabs.org/api/patches/971352/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20180918235702.26573-6-keith.busch@intel.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/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, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20180918235702.26573-6-keith.busch@intel.com>", "list_archive_url": null, "date": "2018-09-18T23:56:57", "name": "[PATCHv3,05/10] PCI/ERR: Handle fatal error recovery", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "56392551390e627e01f4507b9b73a8f56c8399ef", "submitter": { "id": 19950, "url": "http://patchwork.ozlabs.org/api/people/19950/?format=api", "name": "Keith Busch", "email": "keith.busch@intel.com" }, "delegate": { "id": 6763, "url": "http://patchwork.ozlabs.org/api/users/6763/?format=api", "username": "bhelgaas", "first_name": "Bjorn", "last_name": "Helgaas", "email": "bhelgaas@google.com" }, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20180918235702.26573-6-keith.busch@intel.com/mbox/", "series": [ { "id": 66288, "url": "http://patchwork.ozlabs.org/api/series/66288/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=66288", "date": "2018-09-18T23:56:52", "name": "PCI error handling", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/66288/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/971352/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/971352/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-pci-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-pci-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 42FKck6gk3z9sCS\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 19 Sep 2018 09:55:34 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1730674AbeISFad (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 19 Sep 2018 01:30:33 -0400", "from mga02.intel.com ([134.134.136.20]:47633 \"EHLO mga02.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1730670AbeISFad (ORCPT <rfc822;linux-pci@vger.kernel.org>);\n\tWed, 19 Sep 2018 01:30:33 -0400", "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t18 Sep 2018 16:55:32 -0700", "from unknown (HELO localhost.lm.intel.com) ([10.232.112.44])\n\tby orsmga008.jf.intel.com with ESMTP; 18 Sep 2018 16:55:31 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.53,391,1531810800\"; d=\"scan'208\";a=\"74357527\"", "From": "Keith Busch <keith.busch@intel.com>", "To": "Linux PCI <linux-pci@vger.kernel.org>,\n\tBjorn Helgaas <bhelgaas@google.com>", "Cc": "Benjamin Herrenschmidt <benh@kernel.crashing.org>,\n\tSinan Kaya <okaya@kernel.org>,\n\tThomas Tai <thomas.tai@oracle.com>, poza@codeaurora.org,\n\tLukas Wunner <lukas@wunner.de>, Christoph Hellwig <hch@lst.de>,\n\tMika Westerberg <mika.westerberg@linux.intel.com>,\n\tKeith Busch <keith.busch@intel.com>", "Subject": "[PATCHv3 05/10] PCI/ERR: Handle fatal error recovery", "Date": "Tue, 18 Sep 2018 17:56:57 -0600", "Message-Id": "<20180918235702.26573-6-keith.busch@intel.com>", "X-Mailer": "git-send-email 2.13.6", "In-Reply-To": "<20180918235702.26573-1-keith.busch@intel.com>", "References": "<20180918235702.26573-1-keith.busch@intel.com>", "Sender": "linux-pci-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-pci.vger.kernel.org>", "X-Mailing-List": "linux-pci@vger.kernel.org" }, "content": "We don't need to be paranoid about the topology changing while handling an\nerror. If the device has changed in a hotplug capable slot, we can rely\non the presence detection handling to react to a changing topology. This\npatch restores the fatal error handling behavior that existed before\nmerging DPC with AER with 7e9084b3674 (\"PCI/AER: Handle ERR_FATAL with\nremoval and re-enumeration of devices\").\n\nSigned-off-by: Keith Busch <keith.busch@intel.com>\n---\n drivers/pci/pci.h | 4 +--\n drivers/pci/pcie/aer.c | 12 +++++---\n drivers/pci/pcie/dpc.c | 4 +--\n drivers/pci/pcie/err.c | 75 ++++----------------------------------------------\n 4 files changed, 18 insertions(+), 77 deletions(-)", "diff": "diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h\nindex 21bfa30db18d..5a96978d3403 100644\n--- a/drivers/pci/pci.h\n+++ b/drivers/pci/pci.h\n@@ -425,8 +425,8 @@ static inline int pci_dev_specific_disable_acs_redir(struct pci_dev *dev)\n #endif\n \n /* PCI error reporting and recovery */\n-void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service);\n-void pcie_do_nonfatal_recovery(struct pci_dev *dev);\n+void pcie_do_recovery(struct pci_dev *dev, enum pci_channel_state state,\n+\t\t u32 service);\n \n bool pcie_wait_for_link(struct pci_dev *pdev, bool active);\n #ifdef CONFIG_PCIEASPM\ndiff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c\nindex b4d14acee66d..6b59a23568f8 100644\n--- a/drivers/pci/pcie/aer.c\n+++ b/drivers/pci/pcie/aer.c\n@@ -1010,9 +1010,11 @@ static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info)\n \t\t\t\t\tinfo->status);\n \t\tpci_aer_clear_device_status(dev);\n \t} else if (info->severity == AER_NONFATAL)\n-\t\tpcie_do_nonfatal_recovery(dev);\n+\t\tpcie_do_recovery(dev, pci_channel_io_normal,\n+\t\t\t\t PCIE_PORT_SERVICE_AER);\n \telse if (info->severity == AER_FATAL)\n-\t\tpcie_do_fatal_recovery(dev, PCIE_PORT_SERVICE_AER);\n+\t\tpcie_do_recovery(dev, pci_channel_io_frozen,\n+\t\t\t\t PCIE_PORT_SERVICE_AER);\n \tpci_dev_put(dev);\n }\n \n@@ -1048,9 +1050,11 @@ static void aer_recover_work_func(struct work_struct *work)\n \t\t}\n \t\tcper_print_aer(pdev, entry.severity, entry.regs);\n \t\tif (entry.severity == AER_NONFATAL)\n-\t\t\tpcie_do_nonfatal_recovery(pdev);\n+\t\t\tpcie_do_recovery(pdev, pci_channel_io_normal,\n+\t\t\t\t\t PCIE_PORT_SERVICE_AER);\n \t\telse if (entry.severity == AER_FATAL)\n-\t\t\tpcie_do_fatal_recovery(pdev, PCIE_PORT_SERVICE_AER);\n+\t\t\tpcie_do_recovery(pdev, pci_channel_io_frozen,\n+\t\t\t\t\t PCIE_PORT_SERVICE_AER);\n \t\tpci_dev_put(pdev);\n \t}\n }\ndiff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c\nindex aacfb50eccfc..1ed07db8ea7d 100644\n--- a/drivers/pci/pcie/dpc.c\n+++ b/drivers/pci/pcie/dpc.c\n@@ -169,7 +169,7 @@ static irqreturn_t dpc_handler(int irq, void *context)\n \n \treason = (status & PCI_EXP_DPC_STATUS_TRIGGER_RSN) >> 1;\n \text_reason = (status & PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT) >> 5;\n-\tdev_warn(dev, \"DPC %s detected, remove downstream devices\\n\",\n+\tdev_warn(dev, \"DPC %s detected\\n\",\n \t\t (reason == 0) ? \"unmasked uncorrectable error\" :\n \t\t (reason == 1) ? \"ERR_NONFATAL\" :\n \t\t (reason == 2) ? \"ERR_FATAL\" :\n@@ -186,7 +186,7 @@ static irqreturn_t dpc_handler(int irq, void *context)\n \t}\n \n \t/* We configure DPC so it only triggers on ERR_FATAL */\n-\tpcie_do_fatal_recovery(pdev, PCIE_PORT_SERVICE_DPC);\n+\tpcie_do_recovery(pdev, pci_channel_io_frozen, PCIE_PORT_SERVICE_DPC);\n \n \treturn IRQ_HANDLED;\n }\ndiff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c\nindex 62ab665f0f03..644f3f725ef0 100644\n--- a/drivers/pci/pcie/err.c\n+++ b/drivers/pci/pcie/err.c\n@@ -271,83 +271,20 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev,\n \treturn result_data.result;\n }\n \n-/**\n- * pcie_do_fatal_recovery - handle fatal error recovery process\n- * @dev: pointer to a pci_dev data structure of agent detecting an error\n- *\n- * Invoked when an error is fatal. Once being invoked, removes the devices\n- * beneath this AER agent, followed by reset link e.g. secondary bus reset\n- * followed by re-enumeration of devices.\n- */\n-void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service)\n-{\n-\tstruct pci_dev *udev;\n-\tstruct pci_bus *parent;\n-\tstruct pci_dev *pdev, *temp;\n-\tpci_ers_result_t result;\n-\n-\tif (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)\n-\t\tudev = dev;\n-\telse\n-\t\tudev = dev->bus->self;\n-\n-\tparent = udev->subordinate;\n-\tpci_walk_bus(parent, pci_dev_set_disconnected, NULL);\n-\n-\tpci_lock_rescan_remove();\n-\tpci_dev_get(dev);\n-\tlist_for_each_entry_safe_reverse(pdev, temp, &parent->devices,\n-\t\t\t\t\t bus_list) {\n-\t\tpci_stop_and_remove_bus_device(pdev);\n-\t}\n-\n-\tresult = reset_link(udev, service);\n-\n-\tif ((service == PCIE_PORT_SERVICE_AER) &&\n-\t (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)) {\n-\t\t/*\n-\t\t * If the error is reported by a bridge, we think this error\n-\t\t * is related to the downstream link of the bridge, so we\n-\t\t * do error recovery on all subordinates of the bridge instead\n-\t\t * of the bridge and clear the error status of the bridge.\n-\t\t */\n-\t\tpci_aer_clear_fatal_status(dev);\n-\t\tpci_aer_clear_device_status(dev);\n-\t}\n-\n-\tif (result == PCI_ERS_RESULT_RECOVERED) {\n-\t\tif (pcie_wait_for_link(udev, true))\n-\t\t\tpci_rescan_bus(udev->bus);\n-\t\tpci_info(dev, \"Device recovery from fatal error successful\\n\");\n-\t} else {\n-\t\tpci_uevent_ers(dev, PCI_ERS_RESULT_DISCONNECT);\n-\t\tpci_info(dev, \"Device recovery from fatal error failed\\n\");\n-\t}\n-\n-\tpci_dev_put(dev);\n-\tpci_unlock_rescan_remove();\n-}\n-\n-/**\n- * pcie_do_nonfatal_recovery - handle nonfatal error recovery process\n- * @dev: pointer to a pci_dev data structure of agent detecting an error\n- *\n- * Invoked when an error is nonfatal/fatal. Once being invoked, broadcast\n- * error detected message to all downstream drivers within a hierarchy in\n- * question and return the returned code.\n- */\n-void pcie_do_nonfatal_recovery(struct pci_dev *dev)\n+void pcie_do_recovery(struct pci_dev *dev, enum pci_channel_state state,\n+\t\t u32 service)\n {\n \tpci_ers_result_t status;\n-\tenum pci_channel_state state;\n-\n-\tstate = pci_channel_io_normal;\n \n \tstatus = broadcast_error_message(dev,\n \t\t\tstate,\n \t\t\t\"error_detected\",\n \t\t\treport_error_detected);\n \n+\tif (state == pci_channel_io_frozen &&\n+\t reset_link(dev, service) != PCI_ERS_RESULT_RECOVERED)\n+\t\tgoto failed;\n+\n \tif (status == PCI_ERS_RESULT_CAN_RECOVER)\n \t\tstatus = broadcast_error_message(dev,\n \t\t\t\tstate,\n", "prefixes": [ "PATCHv3", "05/10" ] }