Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1212431/?format=api
{ "id": 1212431, "url": "http://patchwork.ozlabs.org/api/patches/1212431/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191218141656.12416-1-baijiaju1990@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": "<20191218141656.12416-1-baijiaju1990@gmail.com>", "list_archive_url": null, "date": "2019-12-18T14:16:56", "name": "net: intel: e1000e: fix possible sleep-in-atomic-context bugs in e1000e_get_hw_semaphore()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "781901aa14ff734c6e16f934cafa6ed2a3be640a", "submitter": { "id": 73020, "url": "http://patchwork.ozlabs.org/api/people/73020/?format=api", "name": "Jia-Ju Bai", "email": "baijiaju1990@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/20191218141656.12416-1-baijiaju1990@gmail.com/mbox/", "series": [ { "id": 149352, "url": "http://patchwork.ozlabs.org/api/series/149352/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=149352", "date": "2019-12-18T14:16:56", "name": "net: intel: e1000e: fix possible sleep-in-atomic-context bugs in e1000e_get_hw_semaphore()", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/149352/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1212431/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1212431/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; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.137;\n\thelo=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=\"AUgHnCwj\"; 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 47dHBw5bk5z9sSL\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 19 Dec 2019 01:17:11 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 693E0859D2;\n\tWed, 18 Dec 2019 14:17:09 +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 0fhP528xro04; Wed, 18 Dec 2019 14:17:08 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D2C7885A78;\n\tWed, 18 Dec 2019 14:17:08 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id F0EFF1BF299\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 18 Dec 2019 14:17:06 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id EC0B72002A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 18 Dec 2019 14:17:06 +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 GGimuV3EGsxF for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 18 Dec 2019 14:17:05 +0000 (UTC)", "from mail-pj1-f68.google.com (mail-pj1-f68.google.com\n\t[209.85.216.68])\n\tby silver.osuosl.org (Postfix) with ESMTPS id E0ED120010\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 18 Dec 2019 14:17:05 +0000 (UTC)", "by mail-pj1-f68.google.com with SMTP id j11so944036pjs.1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 18 Dec 2019 06:17:05 -0800 (PST)", "from oslab.tsinghua.edu.cn ([166.111.139.172])\n\tby smtp.gmail.com with ESMTPSA id\n\tt187sm3546560pfd.21.2019.12.18.06.17.01\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 18 Dec 2019 06:17:05 -0800 (PST)" ], "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;\n\tbh=L3jQPTQ2R5MiyMCuFQ28/QWm5v0842TnhDYDEhmSL3A=;\n\tb=AUgHnCwjrq2NwEEG1Av211jYafr70uh5ebuUs9nuRl2qxREry4BoHzgTAYFsMv3wmB\n\ta5YHGLTtY98yx+j9Q8b0+FfGt3JAt9UXBE5Tc2ZKcoONX9VI2nvpvdLs3RQVZ0ZWg3D/\n\twGNTH8LtR+5ExwolcnWmnJPdNKSBdOlHYInW34Z4F1Q+/IjyVPyQbqT6/6epI1U9qcjK\n\thIq0wWqyQAIsz3YtV0XUhJMTjyxbmzkECW3oVzbsKmYy5ylphCqEF7EEeRZ5ip1KDtCF\n\t7fKH461scRZnfR6yLog37fd6vf7hZU9n927npHCGxC1sOUrPpxn197u0alXAG8w6IXUR\n\ttr8A==", "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;\n\tbh=L3jQPTQ2R5MiyMCuFQ28/QWm5v0842TnhDYDEhmSL3A=;\n\tb=Q8DC4VO4HRUT5Gz14NZtGhja2vo8qG/ZVXnnLZzh4pKt/IsrkysMvb6gm/eQaSodvy\n\teehVwBJd9rTW7fffQ8Nr7eYmuxm26M3tmMkPaHV8eKiqwLyz16G0QFRmZbbk7nLMAfwR\n\t+DBEkeRBhJhp3Jgqq+nCHEaJ53d22/51UrGbQPOsVb6inbZm9s9ITbXpTFGHwc8L9Duc\n\tqOHcZl4aTHiLi/3zu2GrWQBj3ddnKxQSIHzfoIQxGzeRInjIdFzyOt67V/hmjC4wPstr\n\ty/aUiZKLw5CtqC14W2V1sMSDwYxlutkQ4Jbiv2eV7sBDwP0Uv4Ntwt+Gf6nkyMW1o8oE\n\t1aWw==", "X-Gm-Message-State": "APjAAAVIbTTmywod6oWaZUl9mzsqxHiwJQHrOJCz2tkGIJUIFXv11RsQ\n\t2WQJs4l3nuVYvaGK3gMfhPA=", "X-Google-Smtp-Source": "APXvYqxrumjb/MCyv+nqkhnIWzKh4Ue6ATLhMTvMUn7j3d3USRqbMhKU5djbDU374OD2VrPmFbBudQ==", "X-Received": "by 2002:a17:90a:a386:: with SMTP id\n\tx6mr3205472pjp.116.1576678625582; \n\tWed, 18 Dec 2019 06:17:05 -0800 (PST)", "From": "Jia-Ju Bai <baijiaju1990@gmail.com>", "To": "jeffrey.t.kirsher@intel.com,\n\tdavem@davemloft.net", "Date": "Wed, 18 Dec 2019 22:16:56 +0800", "Message-Id": "<20191218141656.12416-1-baijiaju1990@gmail.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[Intel-wired-lan] [PATCH] net: intel: e1000e: fix possible\n\tsleep-in-atomic-context bugs in e1000e_get_hw_semaphore()", "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>", "Cc": "netdev@vger.kernel.org, Jia-Ju Bai <baijiaju1990@gmail.com>,\n\tintel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org", "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": "The driver may sleep while holding a spinlock.\nThe function call path (from bottom to top) in Linux 4.19 is:\n\ndrivers/net/ethernet/intel/e1000e/mac.c, 1366: \n\tusleep_range in e1000e_get_hw_semaphore\ndrivers/net/ethernet/intel/e1000e/80003es2lan.c, 322:\n\te1000e_get_hw_semaphore in e1000_release_swfw_sync_80003es2lan\ndrivers/net/ethernet/intel/e1000e/80003es2lan.c, 197:\n\te1000_release_swfw_sync_80003es2lan in e1000_release_phy_80003es2lan\ndrivers/net/ethernet/intel/e1000e/netdev.c, 4883: \n\t(FUNC_PTR) e1000_release_phy_80003es2lan in e1000e_update_phy_stats\ndrivers/net/ethernet/intel/e1000e/netdev.c, 4917:\n\te1000e_update_phy_stats in e1000e_update_stats\ndrivers/net/ethernet/intel/e1000e/netdev.c, 5945: \n\te1000e_update_stats in e1000e_get_stats64\ndrivers/net/ethernet/intel/e1000e/netdev.c, 5944: \n\tspin_lock in e1000e_get_stats64\n\ndrivers/net/ethernet/intel/e1000e/mac.c, 1384: \n\tusleep_range in e1000e_get_hw_semaphore\ndrivers/net/ethernet/intel/e1000e/80003es2lan.c, 322:\n\te1000e_get_hw_semaphore in e1000_release_swfw_sync_80003es2lan\ndrivers/net/ethernet/intel/e1000e/80003es2lan.c, 197:\n\te1000_release_swfw_sync_80003es2lan in e1000_release_phy_80003es2lan\ndrivers/net/ethernet/intel/e1000e/netdev.c, 4883: \n\t(FUNC_PTR) e1000_release_phy_80003es2lan in e1000e_update_phy_stats\ndrivers/net/ethernet/intel/e1000e/netdev.c, 4917:\n\te1000e_update_phy_stats in e1000e_update_stats\ndrivers/net/ethernet/intel/e1000e/netdev.c, 5945: \n\te1000e_update_stats in e1000e_get_stats64\ndrivers/net/ethernet/intel/e1000e/netdev.c, 5944: \n\tspin_lock in e1000e_get_stats64\n\n(FUNC_PTR) means a function pointer is called.\n\nTo fix these bugs, usleep_range() is replaced with udelay().\n\nThese bugs are found by a static analysis tool STCheck written by myself.\n\nSigned-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>\n---\n drivers/net/ethernet/intel/e1000e/mac.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c\nindex e531976f8a67..51512a73fdd0 100644\n--- a/drivers/net/ethernet/intel/e1000e/mac.c\n+++ b/drivers/net/ethernet/intel/e1000e/mac.c\n@@ -1363,7 +1363,7 @@ s32 e1000e_get_hw_semaphore(struct e1000_hw *hw)\n \t\tif (!(swsm & E1000_SWSM_SMBI))\n \t\t\tbreak;\n \n-\t\tusleep_range(50, 100);\n+\t\tudelay(100);\n \t\ti++;\n \t}\n \n@@ -1381,7 +1381,7 @@ s32 e1000e_get_hw_semaphore(struct e1000_hw *hw)\n \t\tif (er32(SWSM) & E1000_SWSM_SWESMBI)\n \t\t\tbreak;\n \n-\t\tusleep_range(50, 100);\n+\t\tudelay(100);\n \t}\n \n \tif (i == timeout) {\n", "prefixes": [] }