get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/982296/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 982296,
    "url": "http://patchwork.ozlabs.org/api/patches/982296/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20181011071736.2041-1-sasha.neftin@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": "<20181011071736.2041-1-sasha.neftin@intel.com>",
    "list_archive_url": null,
    "date": "2018-10-11T07:17:36",
    "name": "[v8,11/11] igc: Add watchdog",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0d8201e5fbb379d8bfe1ca2aab6b194c7d6de8f8",
    "submitter": {
        "id": 69860,
        "url": "http://patchwork.ozlabs.org/api/people/69860/?format=api",
        "name": "Sasha Neftin",
        "email": "sasha.neftin@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/20181011071736.2041-1-sasha.neftin@intel.com/mbox/",
    "series": [
        {
            "id": 70170,
            "url": "http://patchwork.ozlabs.org/api/series/70170/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=70170",
            "date": "2018-10-11T07:17:13",
            "name": "[v8,01/11] igc: Add skeletal frame for Intel(R) 2.5G Ethernet Controller support.",
            "version": 8,
            "mbox": "http://patchwork.ozlabs.org/series/70170/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/982296/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/982296/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.137; helo=fraxinus.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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 42W2PC1Xk0z9s8F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 11 Oct 2018 18:18:07 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id BD6E886A79;\n\tThu, 11 Oct 2018 07:18:05 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id vJsghumQnbq4; Thu, 11 Oct 2018 07:18:03 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id A724F85BDF;\n\tThu, 11 Oct 2018 07:18:03 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5EC971C1507\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 11 Oct 2018 07:18:02 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 5C1808705D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 11 Oct 2018 07:18:02 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id aRrn4xa38Pcp for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 11 Oct 2018 07:18:01 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 3C3CD8546D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 11 Oct 2018 07:18:01 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Oct 2018 00:18:01 -0700",
            "from ccdlinuxdev08.iil.intel.com ([143.185.161.150])\n\tby FMSMGA003.fm.intel.com with ESMTP; 11 Oct 2018 00:17:37 -0700"
        ],
        "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.54,367,1534834800\"; d=\"scan'208\";a=\"87472369\"",
        "From": "Sasha Neftin <sasha.neftin@intel.com>",
        "To": "sasha.neftin@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 11 Oct 2018 10:17:36 +0300",
        "Message-Id": "<20181011071736.2041-1-sasha.neftin@intel.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "Subject": "[Intel-wired-lan] [PATCH v8 11/11] igc: Add watchdog",
        "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": "Code completion, remove obsolete code\nAdd watchdog methods\n\nSasha Neftin (v2):\nminor cosmetic changes\n\nSasha Neftin (v3):\nresolve conflict and code optimization\n\nSasha Neftin (v4):\nfix update phy info for a watchdog task\nremove no need media_change type and media_swap method\ncode optimization\naddress comments\nreplace e1000_ prefix with igc_ prefix\n\nSasha Neftin (v5):\nremove unused defines\n\nSasha Neftin (v6):\nno changes\n\nSasha Neftin (v7):\nno changes\n\nSasha Neftin (v8):\nfix whitespaces in comments\n\nSigned-off-by: Sasha Neftin <sasha.neftin@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc.h         |  12 ++\n drivers/net/ethernet/intel/igc/igc_defines.h |  11 ++\n drivers/net/ethernet/intel/igc/igc_hw.h      |   1 +\n drivers/net/ethernet/intel/igc/igc_main.c    | 232 +++++++++++++++++++++++++++\n 4 files changed, 256 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h\nindex 86fa889b4ab6..cdf18a5d9e08 100644\n--- a/drivers/net/ethernet/intel/igc/igc.h\n+++ b/drivers/net/ethernet/intel/igc/igc.h\n@@ -33,6 +33,8 @@ extern char igc_driver_version[];\n #define IGC_FLAG_HAS_MSI\t\tBIT(0)\n #define IGC_FLAG_QUEUE_PAIRS\t\tBIT(4)\n #define IGC_FLAG_NEED_LINK_UPDATE\tBIT(9)\n+#define IGC_FLAG_MEDIA_RESET\t\tBIT(10)\n+#define IGC_FLAG_MAS_ENABLE\t\tBIT(12)\n #define IGC_FLAG_HAS_MSIX\t\tBIT(13)\n #define IGC_FLAG_VLAN_PROMISC\t\tBIT(15)\n \n@@ -290,6 +292,7 @@ struct igc_adapter {\n \n \t/* TX */\n \tu16 tx_work_limit;\n+\tu32 tx_timeout_count;\n \tint num_tx_queues;\n \tstruct igc_ring *tx_ring[IGC_MAX_TX_QUEUES];\n \n@@ -348,6 +351,7 @@ struct igc_adapter {\n \n \tstruct igc_mac_addr *mac_table;\n \n+\tunsigned long link_check_timeout;\n \tstruct igc_info ei;\n };\n \n@@ -417,6 +421,14 @@ static inline unsigned int igc_rx_pg_order(struct igc_ring *ring)\n \treturn 0;\n }\n \n+static inline s32 igc_read_phy_reg(struct igc_hw *hw, u32 offset, u16 *data)\n+{\n+\tif (hw->phy.ops.read_reg)\n+\t\treturn hw->phy.ops.read_reg(hw, offset, data);\n+\n+\treturn 0;\n+}\n+\n #define igc_rx_pg_size(_ring) (PAGE_SIZE << igc_rx_pg_order(_ring))\n \n #define IGC_TXD_DCMD\t(IGC_ADVTXD_DCMD_EOP | IGC_ADVTXD_DCMD_RS)\ndiff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h\nindex 70275a0e85d7..8740754ea1fd 100644\n--- a/drivers/net/ethernet/intel/igc/igc_defines.h\n+++ b/drivers/net/ethernet/intel/igc/igc_defines.h\n@@ -66,6 +66,8 @@\n #define IGC_CTRL_RFCE\t\t0x08000000  /* Receive Flow Control enable */\n #define IGC_CTRL_TFCE\t\t0x10000000  /* Transmit flow control enable */\n \n+#define IGC_CONNSW_AUTOSENSE_EN\t0x1\n+\n /* PBA constants */\n #define IGC_PBA_34K\t\t0x0022\n \n@@ -94,6 +96,10 @@\n #define CR_1000T_HD_CAPS\t0x0100 /* Advertise 1000T HD capability */\n #define CR_1000T_FD_CAPS\t0x0200 /* Advertise 1000T FD capability  */\n \n+/* 1000BASE-T Status Register */\n+#define SR_1000T_REMOTE_RX_STATUS\t0x1000 /* Remote receiver OK */\n+#define SR_1000T_LOCAL_RX_STATUS\t0x2000 /* Local receiver OK */\n+\n /* PHY GPY 211 registers */\n #define STANDARD_AN_REG_MASK\t0x0007 /* MMD */\n #define ANEG_MULTIGBT_AN_CTRL\t0x0020 /* MULTI GBT AN Control Register */\n@@ -210,6 +216,11 @@\n #define IGC_QVECTOR_MASK\t0x7FFC\t\t/* Q-vector mask */\n #define IGC_ITR_VAL_MASK\t0x04\t\t/* ITR value mask */\n \n+/* Interrupt Cause Set */\n+#define IGC_ICS_LSC\t\tIGC_ICR_LSC       /* Link Status Change */\n+#define IGC_ICS_RXDMT0\t\tIGC_ICR_RXDMT0    /* rx desc min. threshold */\n+#define IGC_ICS_DRSTA\t\tIGC_ICR_DRSTA     /* Device Reset Aserted */\n+\n #define IGC_ICR_DOUTSYNC\t0x10000000 /* NIC DMA out of sync */\n #define IGC_EITR_CNT_IGNR\t0x80000000 /* Don't reset counters on write */\n #define IGC_IVAR_VALID\t\t0x80\ndiff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h\nindex 65d1446ff0c3..c50414f48f0d 100644\n--- a/drivers/net/ethernet/intel/igc/igc_hw.h\n+++ b/drivers/net/ethernet/intel/igc/igc_hw.h\n@@ -197,6 +197,7 @@ struct igc_dev_spec_base {\n \tbool clear_semaphore_once;\n \tbool module_plugged;\n \tu8 media_port;\n+\tbool mas_capable;\n };\n \n struct igc_hw {\ndiff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex e1a078e084f0..9d85707e8a81 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -1743,6 +1743,7 @@ static void igc_up(struct igc_adapter *adapter)\n \n \t/* start the watchdog. */\n \thw->mac.get_link_status = 1;\n+\tschedule_work(&adapter->watchdog_task);\n }\n \n /**\n@@ -2297,6 +2298,55 @@ static void igc_free_q_vector(struct igc_adapter *adapter, int v_idx)\n \t\tkfree_rcu(q_vector, rcu);\n }\n \n+/* Need to wait a few seconds after link up to get diagnostic information from\n+ * the phy\n+ */\n+static void igc_update_phy_info(struct timer_list *t)\n+{\n+\tstruct igc_adapter *adapter = from_timer(adapter, t, phy_info_timer);\n+\n+\tigc_get_phy_info(&adapter->hw);\n+}\n+\n+/**\n+ * igc_has_link - check shared code for link and determine up/down\n+ * @adapter: pointer to driver private info\n+ */\n+static bool igc_has_link(struct igc_adapter *adapter)\n+{\n+\tstruct igc_hw *hw = &adapter->hw;\n+\tbool link_active = false;\n+\n+\t/* get_link_status is set on LSC (link status) interrupt or\n+\t * rx sequence error interrupt.  get_link_status will stay\n+\t * false until the igc_check_for_link establishes link\n+\t * for copper adapters ONLY\n+\t */\n+\tswitch (hw->phy.media_type) {\n+\tcase igc_media_type_copper:\n+\t\tif (!hw->mac.get_link_status)\n+\t\t\treturn true;\n+\t\thw->mac.ops.check_for_link(hw);\n+\t\tlink_active = !hw->mac.get_link_status;\n+\t\tbreak;\n+\tdefault:\n+\tcase igc_media_type_unknown:\n+\t\tbreak;\n+\t}\n+\n+\tif (hw->mac.type == igc_i225 &&\n+\t    hw->phy.id == I225_I_PHY_ID) {\n+\t\tif (!netif_carrier_ok(adapter->netdev)) {\n+\t\t\tadapter->flags &= ~IGC_FLAG_NEED_LINK_UPDATE;\n+\t\t} else if (!(adapter->flags & IGC_FLAG_NEED_LINK_UPDATE)) {\n+\t\t\tadapter->flags |= IGC_FLAG_NEED_LINK_UPDATE;\n+\t\t\tadapter->link_check_timeout = jiffies;\n+\t\t}\n+\t}\n+\n+\treturn link_active;\n+}\n+\n /**\n  * igc_watchdog - Timer Call-back\n  * @data: pointer to adapter cast into an unsigned long\n@@ -2304,6 +2354,183 @@ static void igc_free_q_vector(struct igc_adapter *adapter, int v_idx)\n static void igc_watchdog(struct timer_list *t)\n {\n \tstruct igc_adapter *adapter = from_timer(adapter, t, watchdog_timer);\n+\t/* Do the rest outside of interrupt context */\n+\tschedule_work(&adapter->watchdog_task);\n+}\n+\n+static void igc_watchdog_task(struct work_struct *work)\n+{\n+\tstruct igc_adapter *adapter = container_of(work,\n+\t\t\t\t\t\t   struct igc_adapter,\n+\t\t\t\t\t\t   watchdog_task);\n+\tstruct net_device *netdev = adapter->netdev;\n+\tstruct igc_hw *hw = &adapter->hw;\n+\tstruct igc_phy_info *phy = &hw->phy;\n+\tu16 phy_data, retry_count = 20;\n+\tu32 connsw;\n+\tu32 link;\n+\tint i;\n+\n+\tlink = igc_has_link(adapter);\n+\n+\tif (adapter->flags & IGC_FLAG_NEED_LINK_UPDATE) {\n+\t\tif (time_after(jiffies, (adapter->link_check_timeout + HZ)))\n+\t\t\tadapter->flags &= ~IGC_FLAG_NEED_LINK_UPDATE;\n+\t\telse\n+\t\t\tlink = false;\n+\t}\n+\n+\t/* Force link down if we have fiber to swap to */\n+\tif (adapter->flags & IGC_FLAG_MAS_ENABLE) {\n+\t\tif (hw->phy.media_type == igc_media_type_copper) {\n+\t\t\tconnsw = rd32(IGC_CONNSW);\n+\t\t\tif (!(connsw & IGC_CONNSW_AUTOSENSE_EN))\n+\t\t\t\tlink = 0;\n+\t\t}\n+\t}\n+\tif (link) {\n+\t\tif (!netif_carrier_ok(netdev)) {\n+\t\t\tu32 ctrl;\n+\n+\t\t\thw->mac.ops.get_speed_and_duplex(hw,\n+\t\t\t\t\t\t\t &adapter->link_speed,\n+\t\t\t\t\t\t\t &adapter->link_duplex);\n+\n+\t\t\tctrl = rd32(IGC_CTRL);\n+\t\t\t/* Link status message must follow this format */\n+\t\t\tnetdev_info(netdev,\n+\t\t\t\t    \"igc: %s NIC Link is Up %d Mbps %s Duplex, Flow Control: %s\\n\",\n+\t\t\t\t    netdev->name,\n+\t\t\t\t    adapter->link_speed,\n+\t\t\t\t    adapter->link_duplex == FULL_DUPLEX ?\n+\t\t\t\t    \"Full\" : \"Half\",\n+\t\t\t\t    (ctrl & IGC_CTRL_TFCE) &&\n+\t\t\t\t    (ctrl & IGC_CTRL_RFCE) ? \"RX/TX\" :\n+\t\t\t\t    (ctrl & IGC_CTRL_RFCE) ?  \"RX\" :\n+\t\t\t\t    (ctrl & IGC_CTRL_TFCE) ?  \"TX\" : \"None\");\n+\n+\t\t\t/* check if SmartSpeed worked */\n+\t\t\tigc_check_downshift(hw);\n+\t\t\tif (phy->speed_downgraded)\n+\t\t\t\tnetdev_warn(netdev, \"Link Speed was downgraded by SmartSpeed\\n\");\n+\n+\t\t\t/* adjust timeout factor according to speed/duplex */\n+\t\t\tadapter->tx_timeout_factor = 1;\n+\t\t\tswitch (adapter->link_speed) {\n+\t\t\tcase SPEED_10:\n+\t\t\t\tadapter->tx_timeout_factor = 14;\n+\t\t\t\tbreak;\n+\t\t\tcase SPEED_100:\n+\t\t\t\t/* maybe add some timeout factor ? */\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\tif (adapter->link_speed != SPEED_1000)\n+\t\t\t\tgoto no_wait;\n+\n+\t\t\t/* wait for Remote receiver status OK */\n+retry_read_status:\n+\t\t\tif (!igc_read_phy_reg(hw, PHY_1000T_STATUS,\n+\t\t\t\t\t      &phy_data)) {\n+\t\t\t\tif (!(phy_data & SR_1000T_REMOTE_RX_STATUS) &&\n+\t\t\t\t    retry_count) {\n+\t\t\t\t\tmsleep(100);\n+\t\t\t\t\tretry_count--;\n+\t\t\t\t\tgoto retry_read_status;\n+\t\t\t\t} else if (!retry_count) {\n+\t\t\t\t\tdev_err(&adapter->pdev->dev, \"exceed max 2 second\\n\");\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tdev_err(&adapter->pdev->dev, \"read 1000Base-T Status Reg\\n\");\n+\t\t\t}\n+no_wait:\n+\t\t\tnetif_carrier_on(netdev);\n+\n+\t\t\t/* link state has changed, schedule phy info update */\n+\t\t\tif (!test_bit(__IGC_DOWN, &adapter->state))\n+\t\t\t\tmod_timer(&adapter->phy_info_timer,\n+\t\t\t\t\t  round_jiffies(jiffies + 2 * HZ));\n+\t\t}\n+\t} else {\n+\t\tif (netif_carrier_ok(netdev)) {\n+\t\t\tadapter->link_speed = 0;\n+\t\t\tadapter->link_duplex = 0;\n+\n+\t\t\t/* Links status message must follow this format */\n+\t\t\tnetdev_info(netdev, \"igc: %s NIC Link is Down\\n\",\n+\t\t\t\t    netdev->name);\n+\t\t\tnetif_carrier_off(netdev);\n+\n+\t\t\t/* link state has changed, schedule phy info update */\n+\t\t\tif (!test_bit(__IGC_DOWN, &adapter->state))\n+\t\t\t\tmod_timer(&adapter->phy_info_timer,\n+\t\t\t\t\t  round_jiffies(jiffies + 2 * HZ));\n+\n+\t\t\t/* link is down, time to check for alternate media */\n+\t\t\tif (adapter->flags & IGC_FLAG_MAS_ENABLE) {\n+\t\t\t\tif (adapter->flags & IGC_FLAG_MEDIA_RESET) {\n+\t\t\t\t\tschedule_work(&adapter->reset_task);\n+\t\t\t\t\t/* return immediately */\n+\t\t\t\t\treturn;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t/* also check for alternate media here */\n+\t\t} else if (!netif_carrier_ok(netdev) &&\n+\t\t\t   (adapter->flags & IGC_FLAG_MAS_ENABLE)) {\n+\t\t\tif (adapter->flags & IGC_FLAG_MEDIA_RESET) {\n+\t\t\t\tschedule_work(&adapter->reset_task);\n+\t\t\t\t/* return immediately */\n+\t\t\t\treturn;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tspin_lock(&adapter->stats64_lock);\n+\tigc_update_stats(adapter);\n+\tspin_unlock(&adapter->stats64_lock);\n+\n+\tfor (i = 0; i < adapter->num_tx_queues; i++) {\n+\t\tstruct igc_ring *tx_ring = adapter->tx_ring[i];\n+\n+\t\tif (!netif_carrier_ok(netdev)) {\n+\t\t\t/* We've lost link, so the controller stops DMA,\n+\t\t\t * but we've got queued Tx work that's never going\n+\t\t\t * to get done, so reset controller to flush Tx.\n+\t\t\t * (Do the reset outside of interrupt context).\n+\t\t\t */\n+\t\t\tif (igc_desc_unused(tx_ring) + 1 < tx_ring->count) {\n+\t\t\t\tadapter->tx_timeout_count++;\n+\t\t\t\tschedule_work(&adapter->reset_task);\n+\t\t\t\t/* return immediately since reset is imminent */\n+\t\t\t\treturn;\n+\t\t\t}\n+\t\t}\n+\n+\t\t/* Force detection of hung controller every watchdog period */\n+\t\tset_bit(IGC_RING_FLAG_TX_DETECT_HANG, &tx_ring->flags);\n+\t}\n+\n+\t/* Cause software interrupt to ensure Rx ring is cleaned */\n+\tif (adapter->flags & IGC_FLAG_HAS_MSIX) {\n+\t\tu32 eics = 0;\n+\n+\t\tfor (i = 0; i < adapter->num_q_vectors; i++)\n+\t\t\teics |= adapter->q_vector[i]->eims_value;\n+\t\twr32(IGC_EICS, eics);\n+\t} else {\n+\t\twr32(IGC_ICS, IGC_ICS_RXDMT0);\n+\t}\n+\n+\t/* Reset the timer */\n+\tif (!test_bit(__IGC_DOWN, &adapter->state)) {\n+\t\tif (adapter->flags & IGC_FLAG_NEED_LINK_UPDATE)\n+\t\t\tmod_timer(&adapter->watchdog_timer,\n+\t\t\t\t  round_jiffies(jiffies +  HZ));\n+\t\telse\n+\t\t\tmod_timer(&adapter->watchdog_timer,\n+\t\t\t\t  round_jiffies(jiffies + 2 * HZ));\n+\t}\n }\n \n /**\n@@ -3152,6 +3379,7 @@ static int __igc_open(struct net_device *netdev, bool resuming)\n \n \t/* start the watchdog. */\n \thw->mac.get_link_status = 1;\n+\tschedule_work(&adapter->watchdog_task);\n \n \treturn IGC_SUCCESS;\n \n@@ -3427,8 +3655,10 @@ static int igc_probe(struct pci_dev *pdev,\n \twr32(IGC_TXPBS, I225_TXPBSIZE_DEFAULT);\n \n \ttimer_setup(&adapter->watchdog_timer, igc_watchdog, 0);\n+\ttimer_setup(&adapter->phy_info_timer, igc_update_phy_info, 0);\n \n \tINIT_WORK(&adapter->reset_task, igc_reset_task);\n+\tINIT_WORK(&adapter->watchdog_task, igc_watchdog_task);\n \n \t/* Initialize link properties that are user-changeable */\n \tadapter->fc_autoneg = true;\n@@ -3499,8 +3729,10 @@ static void igc_remove(struct pci_dev *pdev)\n \tset_bit(__IGC_DOWN, &adapter->state);\n \n \tdel_timer_sync(&adapter->watchdog_timer);\n+\tdel_timer_sync(&adapter->phy_info_timer);\n \n \tcancel_work_sync(&adapter->reset_task);\n+\tcancel_work_sync(&adapter->watchdog_task);\n \n \t/* Release control of h/w to f/w.  If f/w is AMT enabled, this\n \t * would have already happened in close and is redundant.\n",
    "prefixes": [
        "v8",
        "11/11"
    ]
}