get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 988201,
    "url": "http://patchwork.ozlabs.org/api/patches/988201/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20181023123739.12489-1-mlichvar@redhat.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": "<20181023123739.12489-1-mlichvar@redhat.com>",
    "list_archive_url": null,
    "date": "2018-10-23T12:37:39",
    "name": "[v1] e1000e: allow non-monotonic SYSTIM readings",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c73ba5de7045c698aeecca0ff92731e4edfc3095",
    "submitter": {
        "id": 17040,
        "url": "http://patchwork.ozlabs.org/api/people/17040/?format=api",
        "name": "Miroslav Lichvar",
        "email": "mlichvar@redhat.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/20181023123739.12489-1-mlichvar@redhat.com/mbox/",
    "series": [
        {
            "id": 72231,
            "url": "http://patchwork.ozlabs.org/api/series/72231/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=72231",
            "date": "2018-10-23T12:37:39",
            "name": "[v1] e1000e: allow non-monotonic SYSTIM readings",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/72231/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/988201/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/988201/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=redhat.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 42fXwY2fkbz9sNK\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 23 Oct 2018 23:37:47 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5671A88880;\n\tTue, 23 Oct 2018 12:37:45 +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 qrMk20kY7ljH; Tue, 23 Oct 2018 12:37:44 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id B8C2088872;\n\tTue, 23 Oct 2018 12:37:44 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 1113F1BF39E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 23 Oct 2018 12:37:43 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 0E1FC8740C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 23 Oct 2018 12:37:43 +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 LuvxwPZm600Q for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 23 Oct 2018 12:37:42 +0000 (UTC)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 661C38740E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 23 Oct 2018 12:37:42 +0000 (UTC)",
            "from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id A304430B933D;\n\tTue, 23 Oct 2018 12:37:41 +0000 (UTC)",
            "from holly.tpb.lab.eng.brq.redhat.com\n\t(holly.tpb.lab.eng.brq.redhat.com [10.43.134.11])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 9D7BD6031B;\n\tTue, 23 Oct 2018 12:37:40 +0000 (UTC)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": [
            "domain auto-whitelisted by SQLgrey-1.7.6",
            "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.49]); Tue, 23 Oct 2018 12:37:41 +0000 (UTC)"
        ],
        "From": "Miroslav Lichvar <mlichvar@redhat.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 23 Oct 2018 14:37:39 +0200",
        "Message-Id": "<20181023123739.12489-1-mlichvar@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.11",
        "Subject": "[Intel-wired-lan] [PATCH v1] e1000e: allow non-monotonic SYSTIM\n\treadings",
        "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": "Richard Cochran <richardcochran@gmail.com>",
        "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": "It seems with some NICs supported by the e1000e driver a SYSTIM reading\nmay occasionally be few microseconds before the previous reading and if\nenabled also pass e1000e_sanitize_systim() without reaching the maximum\nnumber of rereads, even if the function is modified to check three\nconsecutive readings (i.e. it doesn't look like a double read error).\nThis causes an underflow in the timecounter and the PHC time jumps hours\nahead.\n\nThis was observed on 82574, I217 and I219. The fastest way to reproduce\nit is to run a program that continuously calls the PTP_SYS_OFFSET ioctl\non the PHC.\n\nModify e1000e_phc_gettime() to use timecounter_cyc2time() instead of\ntimecounter_read() in order to allow non-monotonic SYSTIM readings and\nprevent the PHC from jumping.\n\nCc: Jacob Keller <jacob.e.keller@intel.com>\nCc: Richard Cochran <richardcochran@gmail.com>\nSigned-off-by: Miroslav Lichvar <mlichvar@redhat.com>\n---\n\nNotes:\n    RFC->v1:\n    - Removed unnecessary call of PTP gettime64() in\n      e1000e_systim_overflow_work()\n\n drivers/net/ethernet/intel/e1000e/ptp.c | 13 ++++++++++---\n 1 file changed, 10 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c\nindex 37c76945ad9b..e1f821edbc21 100644\n--- a/drivers/net/ethernet/intel/e1000e/ptp.c\n+++ b/drivers/net/ethernet/intel/e1000e/ptp.c\n@@ -173,10 +173,14 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)\n \tstruct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,\n \t\t\t\t\t\t     ptp_clock_info);\n \tunsigned long flags;\n-\tu64 ns;\n+\tu64 cycles, ns;\n \n \tspin_lock_irqsave(&adapter->systim_lock, flags);\n-\tns = timecounter_read(&adapter->tc);\n+\n+\t/* Use timecounter_cyc2time() to allow non-monotonic SYSTIM readings */\n+\tcycles = adapter->cc.read(&adapter->cc);\n+\tns = timecounter_cyc2time(&adapter->tc, cycles);\n+\n \tspin_unlock_irqrestore(&adapter->systim_lock, flags);\n \n \t*ts = ns_to_timespec64(ns);\n@@ -232,9 +236,12 @@ static void e1000e_systim_overflow_work(struct work_struct *work)\n \t\t\t\t\t\t     systim_overflow_work.work);\n \tstruct e1000_hw *hw = &adapter->hw;\n \tstruct timespec64 ts;\n+\tu64 ns;\n \n-\tadapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts);\n+\t/* Update the timecounter */\n+\tns = timecounter_read(&adapter->tc);\n \n+\tts = ns_to_timespec64(ns);\n \te_dbg(\"SYSTIM overflow check at %lld.%09lu\\n\",\n \t      (long long) ts.tv_sec, ts.tv_nsec);\n \n",
    "prefixes": [
        "v1"
    ]
}