Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1118367/?format=api
{ "id": 1118367, "url": "http://patchwork.ozlabs.org/api/patches/1118367/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190618220846.19486-1-detlev.casanova@gmail.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": "<20190618220846.19486-1-detlev.casanova@gmail.com>", "list_archive_url": null, "date": "2019-06-18T22:08:46", "name": "[v2] e1000e: Make watchdog use delayed work", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "6a856b98cd2a797543260ec827d81420ef303717", "submitter": { "id": 76863, "url": "http://patchwork.ozlabs.org/api/people/76863/?format=api", "name": "Detlev Casanova", "email": "detlev.casanova@gmail.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/20190618220846.19486-1-detlev.casanova@gmail.com/mbox/", "series": [ { "id": 114672, "url": "http://patchwork.ozlabs.org/api/series/114672/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=114672", "date": "2019-06-18T22:08:46", "name": "[v2] e1000e: Make watchdog use delayed work", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/114672/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1118367/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1118367/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=gmail.com", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"CXSwSzE5\"; dkim-atps=neutral" ], "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 45T2Kx74Gkz9s9y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 19 Jun 2019 08:09:09 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D989E85ABB;\n\tTue, 18 Jun 2019 22:09:07 +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 q8pYBTmg1SWX; Tue, 18 Jun 2019 22:09:06 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 9B51385A7D;\n\tTue, 18 Jun 2019 22:09:06 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 282B01BF300\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jun 2019 22:09:05 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 23032816F4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jun 2019 22:09:05 +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 F0OCBZho6EaU for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jun 2019 22:09:03 +0000 (UTC)", "from mail-qk1-f194.google.com (mail-qk1-f194.google.com\n\t[209.85.222.194])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 87D7B815F7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jun 2019 22:09:02 +0000 (UTC)", "by mail-qk1-f194.google.com with SMTP id x18so9626896qkn.13\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jun 2019 15:09:02 -0700 (PDT)", "from localhost.localdomain\n\t(mtrlpq02hsy-lp140-01-174-93-144-21.dsl.bell.ca. [174.93.144.21])\n\tby smtp.gmail.com with ESMTPSA id\n\t41sm11912767qtp.32.2019.06.18.15.09.00\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tTue, 18 Jun 2019 15:09:00 -0700 (PDT)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=cJhXDMxlF4zheXAyGu3M3eT8etAp0t6lqkCYLG9eTSw=;\n\tb=CXSwSzE51QWj1ILTdavUUdyYP6c4dh8l3QvL7B3g8uOCApTR6sH8sOoBVhsk4iv/DQ\n\tbPZ8eHn0JGlb6n/uQjDOa2kCLmHO1TBHobdkQLUmLw96ZmSkkcGN0N2PkPhWo2mBzA8q\n\tPqQWcSY5ifW+THF7Ldb/w5H+s+wlfgUqKiMFFcPht5P/iu0P4+jNPG7yiRvGkcqyM71Q\n\tO70Z9qefifoLXxhXkfDbkbguuacRR1mIAo51BlFGFExnioxXH+6IfPoQ0wMak8BQnhBl\n\t4/b3W4G5sdCGu7wjwqMbPL3nXRRF14AWAecpm927lNfcVpp4XFzlxQ9L+Hmge+AQ5GbK\n\ta8nw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=cJhXDMxlF4zheXAyGu3M3eT8etAp0t6lqkCYLG9eTSw=;\n\tb=N547k254VZ1AGvnmM1gbWDk4V82KigcogqeozpZq+DVmTH+YLvM9qy5Jc5s5SCdVkg\n\tsQAa3XHNMYts5nQfAdJgeC8q19k4mTGwsvN6bvrlt7TyevBDsiIEwwwlmWPNo9aaZ+lo\n\t4d5T+LCKhmGUDsl+JHnptDN62lD7DOLyuFO7Rjqh1eyJFJLmCan88Tq0CrQaQbCPNrXO\n\t1kB6NifK5fBa2rhLzeMFJ5jKEK246M+3RzbHbxsy62Ht37gFH32RfeeNXyTL/ntC+gw5\n\t3sMgAYEVHfXoNJcyKgQP3cTMeJ0PYxmSxhrC8eBkDCgiUjW0ht44xO1H6Xlto3aYua4R\n\t86+w==", "X-Gm-Message-State": "APjAAAXOjjg5RJrNiQFpcVJIy9faAweZZscfhW6r3f50ik4GbvOxCpd2\n\tI81dx+Xd7JgAAaNxMugllbU=", "X-Google-Smtp-Source": "APXvYqzc1T0VGAVbk/RXJTV/GOSaLsqraz6xSZH/YcEwB4vSAx0bQB+JEm91YRYaehTRr3zI758p5g==", "X-Received": "by 2002:a37:9c16:: with SMTP id\n\tf22mr96843097qke.261.1560895741514; \n\tTue, 18 Jun 2019 15:09:01 -0700 (PDT)", "From": "Detlev Casanova <detlev.casanova@gmail.com>", "To": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tintel-wired-lan@lists.osuosl.org, \n\tnetdev@vger.kernel.org, linux-kernel@vger.kernel.org", "Date": "Tue, 18 Jun 2019 18:08:46 -0400", "Message-Id": "<20190618220846.19486-1-detlev.casanova@gmail.com>", "X-Mailer": "git-send-email 2.22.0", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH v2] e1000e: Make watchdog use delayed work", "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>", "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": "Use delayed work instead of timers to run the watchdog of the e1000e\ndriver.\n\nSimplify the code with one less middle function.\n\nSigned-off-by: Detlev Casanova <detlev.casanova@gmail.com>\n---\n drivers/net/ethernet/intel/e1000e/e1000.h | 3 +-\n drivers/net/ethernet/intel/e1000e/netdev.c | 54 ++++++++++++----------\n 2 files changed, 30 insertions(+), 27 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h\nindex be13227f1697..942ab74030ca 100644\n--- a/drivers/net/ethernet/intel/e1000e/e1000.h\n+++ b/drivers/net/ethernet/intel/e1000e/e1000.h\n@@ -186,12 +186,11 @@ struct e1000_phy_regs {\n \n /* board specific private data structure */\n struct e1000_adapter {\n-\tstruct timer_list watchdog_timer;\n \tstruct timer_list phy_info_timer;\n \tstruct timer_list blink_timer;\n \n \tstruct work_struct reset_task;\n-\tstruct work_struct watchdog_task;\n+\tstruct delayed_work watchdog_task;\n \n \tconst struct e1000_info *ei;\n \ndiff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex 0e09bede42a2..22a5d594115f 100644\n--- a/drivers/net/ethernet/intel/e1000e/netdev.c\n+++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n@@ -39,6 +39,8 @@ static int debug = -1;\n module_param(debug, int, 0);\n MODULE_PARM_DESC(debug, \"Debug level (0=none,...,16=all)\");\n \n+static struct workqueue_struct *e1000_workqueue;\n+\n static const struct e1000_info *e1000_info_tbl[] = {\n \t[board_82571]\t\t= &e1000_82571_info,\n \t[board_82572]\t\t= &e1000_82572_info,\n@@ -1780,7 +1782,8 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data)\n \t\t}\n \t\t/* guard against interrupt when we're going down */\n \t\tif (!test_bit(__E1000_DOWN, &adapter->state))\n-\t\t\tmod_timer(&adapter->watchdog_timer, jiffies + 1);\n+\t\t\tqueue_delayed_work(e1000_workqueue,\n+\t\t\t\t\t &adapter->watchdog_task, 1);\n \t}\n \n \t/* Reset on uncorrectable ECC error */\n@@ -1860,7 +1863,8 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data)\n \t\t}\n \t\t/* guard against interrupt when we're going down */\n \t\tif (!test_bit(__E1000_DOWN, &adapter->state))\n-\t\t\tmod_timer(&adapter->watchdog_timer, jiffies + 1);\n+\t\t\tqueue_delayed_work(e1000_workqueue,\n+\t\t\t\t\t &adapter->watchdog_task, 1);\n \t}\n \n \t/* Reset on uncorrectable ECC error */\n@@ -1905,7 +1909,8 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data)\n \t\thw->mac.get_link_status = true;\n \t\t/* guard against interrupt when we're going down */\n \t\tif (!test_bit(__E1000_DOWN, &adapter->state))\n-\t\t\tmod_timer(&adapter->watchdog_timer, jiffies + 1);\n+\t\t\tqueue_delayed_work(e1000_workqueue,\n+\t\t\t\t\t &adapter->watchdog_task, 1);\n \t}\n \n \tif (!test_bit(__E1000_DOWN, &adapter->state))\n@@ -4278,7 +4283,6 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset)\n \n \tnapi_synchronize(&adapter->napi);\n \n-\tdel_timer_sync(&adapter->watchdog_timer);\n \tdel_timer_sync(&adapter->phy_info_timer);\n \n \tspin_lock(&adapter->stats64_lock);\n@@ -5150,25 +5154,11 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)\n \t}\n }\n \n-/**\n- * e1000_watchdog - Timer Call-back\n- * @data: pointer to adapter cast into an unsigned long\n- **/\n-static void e1000_watchdog(struct timer_list *t)\n-{\n-\tstruct e1000_adapter *adapter = from_timer(adapter, t, watchdog_timer);\n-\n-\t/* Do the rest outside of interrupt context */\n-\tschedule_work(&adapter->watchdog_task);\n-\n-\t/* TODO: make this use queue_delayed_work() */\n-}\n-\n static void e1000_watchdog_task(struct work_struct *work)\n {\n \tstruct e1000_adapter *adapter = container_of(work,\n \t\t\t\t\t\t struct e1000_adapter,\n-\t\t\t\t\t\t watchdog_task);\n+\t\t\t\t\t\t watchdog_task.work);\n \tstruct net_device *netdev = adapter->netdev;\n \tstruct e1000_mac_info *mac = &adapter->hw.mac;\n \tstruct e1000_phy_info *phy = &adapter->hw.phy;\n@@ -5395,8 +5385,8 @@ static void e1000_watchdog_task(struct work_struct *work)\n \n \t/* Reset the timer */\n \tif (!test_bit(__E1000_DOWN, &adapter->state))\n-\t\tmod_timer(&adapter->watchdog_timer,\n-\t\t\t round_jiffies(jiffies + 2 * HZ));\n+\t\tqueue_delayed_work(e1000_workqueue, &adapter->watchdog_task,\n+\t\t\t\t round_jiffies(2 * HZ));\n }\n \n #define E1000_TX_FLAGS_CSUM\t\t0x00000001\n@@ -7251,11 +7241,20 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \t\tgoto err_eeprom;\n \t}\n \n-\ttimer_setup(&adapter->watchdog_timer, e1000_watchdog, 0);\n+\te1000_workqueue = alloc_workqueue(\"%s\", WQ_MEM_RECLAIM, 0,\n+\t\t\t\t\t e1000e_driver_name);\n+\n+\tif (!e1000_workqueue) {\n+\t\terr = -ENOMEM;\n+\t\tgoto err_workqueue;\n+\t}\n+\n+\tINIT_DELAYED_WORK(&adapter->watchdog_task, e1000_watchdog_task);\n+\tqueue_delayed_work(e1000_workqueue, &adapter->watchdog_task, 0);\n+\n \ttimer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0);\n \n \tINIT_WORK(&adapter->reset_task, e1000_reset_task);\n-\tINIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);\n \tINIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);\n \tINIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);\n \tINIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);\n@@ -7349,6 +7348,9 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \treturn 0;\n \n err_register:\n+\tflush_workqueue(e1000_workqueue);\n+\tdestroy_workqueue(e1000_workqueue);\n+err_workqueue:\n \tif (!(adapter->flags & FLAG_HAS_AMT))\n \t\te1000e_release_hw_control(adapter);\n err_eeprom:\n@@ -7395,15 +7397,17 @@ static void e1000_remove(struct pci_dev *pdev)\n \t */\n \tif (!down)\n \t\tset_bit(__E1000_DOWN, &adapter->state);\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 \tcancel_work_sync(&adapter->downshift_task);\n \tcancel_work_sync(&adapter->update_phy_task);\n \tcancel_work_sync(&adapter->print_hang_task);\n \n+\tcancel_delayed_work(&adapter->watchdog_task);\n+\tflush_workqueue(e1000_workqueue);\n+\tdestroy_workqueue(e1000_workqueue);\n+\n \tif (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {\n \t\tcancel_work_sync(&adapter->tx_hwtstamp_work);\n \t\tif (adapter->tx_hwtstamp_skb) {\n", "prefixes": [ "v2" ] }