Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1041532/?format=api
{ "id": 1041532, "url": "http://patchwork.ozlabs.org/api/patches/1041532/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190213185115.25877-16-anirudh.venkataramanan@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20190213185115.25877-16-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-02-13T18:51:15", "name": "[S14,15/15] ice: Implement pci_error_handler ops", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c1ea6404b65718fb959b6e989b8883ea63a9fa8c", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190213185115.25877-16-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 91786, "url": "http://patchwork.ozlabs.org/api/series/91786/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=91786", "date": "2019-02-13T18:51:02", "name": "Implementation updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/91786/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1041532/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1041532/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4407wW5TDSz9sN8\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Feb 2019 05:54:03 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5B74B820A1;\n\tWed, 13 Feb 2019 18:54:02 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id ZSX6gXNLAtSf; Wed, 13 Feb 2019 18:54:00 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 836C1815BC;\n\tWed, 13 Feb 2019 18:54:00 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 90C411BF997\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:24 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 38F1722D10\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:21 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id FS89PKomLRvX for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:19 +0000 (UTC)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 6DA8E227FA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:18 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Feb 2019 10:51:18 -0800", "from shasta.jf.intel.com ([10.166.241.11])\n\tby orsmga001.jf.intel.com with ESMTP; 13 Feb 2019 10:51:16 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.58,366,1544515200\"; d=\"scan'208\";a=\"138354249\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 13 Feb 2019 10:51:15 -0800", "Message-Id": "<20190213185115.25877-16-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.5", "In-Reply-To": "<20190213185115.25877-1-anirudh.venkataramanan@intel.com>", "References": "<20190213185115.25877-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH S14 15/15] ice: Implement\n\tpci_error_handler ops", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "From: Brett Creeley <brett.creeley@intel.com>\n\nThis patch implements the following pci_error_handler ops:\n\t.error_detected = ice_pci_err_detected\n\t.slot_reset = ice_pci_err_slot_reset\n\t.reset_notify = ice_pci_err_reset_notify\n\t.reset_prepare = ice_pci_err_reset_prepare\n\t.reset_done = ice_pci_err_reset_done\n\t.resume = ice_pci_err_resume\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> cleaned up commit message]\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> fixed build failures]\n---\n drivers/net/ethernet/intel/ice/ice_main.c | 151 ++++++++++++++++++++++++++++++\n 1 file changed, 151 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 6e069e84d486..dad17d8c8b61 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -1004,6 +1004,18 @@ static void ice_service_task_stop(struct ice_pf *pf)\n \tclear_bit(__ICE_SERVICE_SCHED, pf->state);\n }\n \n+/**\n+ * ice_service_task_restart - restart service task and schedule works\n+ * @pf: board private structure\n+ *\n+ * This function is needed for suspend and resume works (e.g WoL scenario)\n+ */\n+static void ice_service_task_restart(struct ice_pf *pf)\n+{\n+\tclear_bit(__ICE_SERVICE_DIS, pf->state);\n+\tice_service_task_schedule(pf);\n+}\n+\n /**\n * ice_service_timer - timer callback to schedule service task\n * @t: pointer to timer_list\n@@ -2395,6 +2407,136 @@ static void ice_remove(struct pci_dev *pdev)\n \tpci_disable_pcie_error_reporting(pdev);\n }\n \n+/**\n+ * ice_pci_err_detected - warning that PCI error has been detected\n+ * @pdev: PCI device information struct\n+ * @err: the type of PCI error\n+ *\n+ * Called to warn that something happened on the PCI bus and the error handling\n+ * is in progress. Allows the driver to gracefully prepare/handle PCI errors.\n+ */\n+static pci_ers_result_t\n+ice_pci_err_detected(struct pci_dev *pdev, enum pci_channel_state err)\n+{\n+\tstruct ice_pf *pf = pci_get_drvdata(pdev);\n+\n+\tif (!pf) {\n+\t\tdev_err(&pdev->dev, \"%s: unrecoverable device error %d\\n\",\n+\t\t\t__func__, err);\n+\t\treturn PCI_ERS_RESULT_DISCONNECT;\n+\t}\n+\n+\tif (!test_bit(__ICE_SUSPENDED, pf->state)) {\n+\t\tice_service_task_stop(pf);\n+\n+\t\tif (!test_bit(__ICE_PREPARED_FOR_RESET, pf->state)) {\n+\t\t\tset_bit(__ICE_PFR_REQ, pf->state);\n+\t\t\tice_prepare_for_reset(pf);\n+\t\t}\n+\t}\n+\n+\treturn PCI_ERS_RESULT_NEED_RESET;\n+}\n+\n+/**\n+ * ice_pci_err_slot_reset - a PCI slot reset has just happened\n+ * @pdev: PCI device information struct\n+ *\n+ * Called to determine if the driver can recover from the PCI slot reset by\n+ * using a register read to determine if the device is recoverable.\n+ */\n+static pci_ers_result_t ice_pci_err_slot_reset(struct pci_dev *pdev)\n+{\n+\tstruct ice_pf *pf = pci_get_drvdata(pdev);\n+\tpci_ers_result_t result;\n+\tint err;\n+\tu32 reg;\n+\n+\terr = pci_enable_device_mem(pdev);\n+\tif (err) {\n+\t\tdev_err(&pdev->dev,\n+\t\t\t\"Cannot re-enable PCI device after reset, error %d\\n\",\n+\t\t\terr);\n+\t\tresult = PCI_ERS_RESULT_DISCONNECT;\n+\t} else {\n+\t\tpci_set_master(pdev);\n+\t\tpci_restore_state(pdev);\n+\t\tpci_save_state(pdev);\n+\t\tpci_wake_from_d3(pdev, false);\n+\n+\t\t/* Check for life */\n+\t\treg = rd32(&pf->hw, GLGEN_RTRIG);\n+\t\tif (!reg)\n+\t\t\tresult = PCI_ERS_RESULT_RECOVERED;\n+\t\telse\n+\t\t\tresult = PCI_ERS_RESULT_DISCONNECT;\n+\t}\n+\n+\terr = pci_cleanup_aer_uncorrect_error_status(pdev);\n+\tif (err)\n+\t\tdev_dbg(&pdev->dev,\n+\t\t\t\"pci_cleanup_aer_uncorrect_error_status failed, error %d\\n\",\n+\t\t\terr);\n+\t\t/* non-fatal, continue */\n+\n+\treturn result;\n+}\n+\n+/**\n+ * ice_pci_err_resume - restart operations after PCI error recovery\n+ * @pdev: PCI device information struct\n+ *\n+ * Called to allow the driver to bring things back up after PCI error and/or\n+ * reset recovery have finished\n+ */\n+static void ice_pci_err_resume(struct pci_dev *pdev)\n+{\n+\tstruct ice_pf *pf = pci_get_drvdata(pdev);\n+\n+\tif (!pf) {\n+\t\tdev_err(&pdev->dev,\n+\t\t\t\"%s failed, device is unrecoverable\\n\", __func__);\n+\t\treturn;\n+\t}\n+\n+\tif (test_bit(__ICE_SUSPENDED, pf->state)) {\n+\t\tdev_dbg(&pdev->dev, \"%s failed to resume normal operations!\\n\",\n+\t\t\t__func__);\n+\t\treturn;\n+\t}\n+\n+\tice_do_reset(pf, ICE_RESET_PFR);\n+\tice_service_task_restart(pf);\n+\tmod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));\n+}\n+\n+/**\n+ * ice_pci_err_reset_prepare - prepare device driver for pci reset\n+ * @pdev: PCI device information struct\n+ */\n+static void ice_pci_err_reset_prepare(struct pci_dev *pdev)\n+{\n+\tstruct ice_pf *pf = pci_get_drvdata(pdev);\n+\n+\tif (!test_bit(__ICE_SUSPENDED, pf->state)) {\n+\t\tice_service_task_stop(pf);\n+\n+\t\tif (!test_bit(__ICE_PREPARED_FOR_RESET, pf->state)) {\n+\t\t\tset_bit(__ICE_PFR_REQ, pf->state);\n+\t\t\tice_prepare_for_reset(pf);\n+\t\t}\n+\t}\n+}\n+\n+/**\n+ * ice_pci_err_reset_done - PCI reset done, device driver reset can begin\n+ * @pdev: PCI device information struct\n+ */\n+static void ice_pci_err_reset_done(struct pci_dev *pdev)\n+{\n+\tice_pci_err_resume(pdev);\n+}\n+\n /* ice_pci_tbl - PCI Device ID Table\n *\n * Wildcard entries (PCI_ANY_ID) should come last\n@@ -2412,12 +2554,21 @@ static const struct pci_device_id ice_pci_tbl[] = {\n };\n MODULE_DEVICE_TABLE(pci, ice_pci_tbl);\n \n+static const struct pci_error_handlers ice_pci_err_handler = {\n+\t.error_detected = ice_pci_err_detected,\n+\t.slot_reset = ice_pci_err_slot_reset,\n+\t.reset_prepare = ice_pci_err_reset_prepare,\n+\t.reset_done = ice_pci_err_reset_done,\n+\t.resume = ice_pci_err_resume\n+};\n+\n static struct pci_driver ice_driver = {\n \t.name = KBUILD_MODNAME,\n \t.id_table = ice_pci_tbl,\n \t.probe = ice_probe,\n \t.remove = ice_remove,\n \t.sriov_configure = ice_sriov_configure,\n+\t.err_handler = &ice_pci_err_handler\n };\n \n /**\n", "prefixes": [ "S14", "15/15" ] }