get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812239,
    "url": "http://patchwork.ozlabs.org/api/patches/812239/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170911074226.2020-1-jiri@resnulli.us/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170911074226.2020-1-jiri@resnulli.us>",
    "list_archive_url": null,
    "date": "2017-09-11T07:42:26",
    "name": "[net] mlxsw: spectrum: Fix EEPROM access in case of SFP/SFP+",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "81080c799063623d87a283ffd22dbde8eebbf24c",
    "submitter": {
        "id": 15321,
        "url": "http://patchwork.ozlabs.org/api/people/15321/?format=api",
        "name": "Jiri Pirko",
        "email": "jiri@resnulli.us"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170911074226.2020-1-jiri@resnulli.us/mbox/",
    "series": [
        {
            "id": 2448,
            "url": "http://patchwork.ozlabs.org/api/series/2448/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=2448",
            "date": "2017-09-11T07:42:26",
            "name": "[net] mlxsw: spectrum: Fix EEPROM access in case of SFP/SFP+",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2448/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/812239/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812239/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=resnulli-us.20150623.gappssmtp.com\n\theader.i=@resnulli-us.20150623.gappssmtp.com\n\theader.b=\"O3HAGlqJ\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xrKdj6ftkz9s7F\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 11 Sep 2017 17:42:33 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751031AbdIKHmb (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 11 Sep 2017 03:42:31 -0400",
            "from mail-wm0-f67.google.com ([74.125.82.67]:34557 \"EHLO\n\tmail-wm0-f67.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750937AbdIKHma (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 11 Sep 2017 03:42:30 -0400",
            "by mail-wm0-f67.google.com with SMTP id l19so6168299wmi.1\n\tfor <netdev@vger.kernel.org>; Mon, 11 Sep 2017 00:42:29 -0700 (PDT)",
            "from localhost (jirka.pirko.cz. [84.16.102.26])\n\tby smtp.gmail.com with ESMTPSA id\n\tn71sm3833233wmg.20.2017.09.11.00.42.27\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 11 Sep 2017 00:42:27 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=resnulli-us.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id;\n\tbh=5KdO36ui9bG3RSjHD5L3lFWta+n5UKgjh9wT/T57UGM=;\n\tb=O3HAGlqJgKHrIuZg7xZ8t69bzmUpb9d9V1ffwylc2vk/Ab5GMKlda6Dv788CmWwxcL\n\tb3L6xOtLz37g/AJk/Qs9BtzB9xmaGeRT9OIzN2afHTFutO8dmAqVJIPZfVIuHQpVduQq\n\t7UOk03YdRCi2f1JOj5D+dXmJYJA53hzssRgQTh0vvV3OuTvPqpsp8rP/sWZHylLA0Hkc\n\tcwE6P2pQSXvBt7xOg4lZOch7OmbPXbK2Anu/ushFZLXtrpASu+Qa2aH7dXpMIl06S5wb\n\tY0ptCN06QbIt/7JjA/GuPFioCBP6FZU9Ak3tCaDD7VXbXuokxNR4EAkDtXjlu3dZU2u6\n\trO7Q==",
        "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=5KdO36ui9bG3RSjHD5L3lFWta+n5UKgjh9wT/T57UGM=;\n\tb=tdzVvS26OI7tebyi/WHETDaGIxH2xcxFN+L6559OX/KFUWNLG2xoQQeA1GC63bPL1X\n\t+9Oxnhn6tvUKZf6nAaOl4wHsF+KpuSFiDkHDCTzdroR4lUuvh8sxjJreWv+JHpdpr/Vx\n\tP5uaR5t3jOU3vAh10FEOjcZs+qnxo1ediPFqoCu8pk8asO4zasDg23QaK2N+ahsj/eLH\n\tpvcwF3wFe988ggwKeJKnNRuMFIPfh4nuNUN3RkhX2iXU7qcVWdvKyl5R9zeSA1FLnqTv\n\tPDJCxWJI0opr4F19TH3zxjJV5WU92sWihHz03xRe6Nf2i3Rz23/hJn9up5znvpTzw3V/\n\tNlmw==",
        "X-Gm-Message-State": "AHPjjUiyhZse/2DVw5LykRMblFbXWn0+EdwkXQ1d7wsj51aIk7M9AZRy\n\t0ZCMwekuTHiZH8Cc5khiumJs0rXj",
        "X-Google-Smtp-Source": "AOwi7QB2c7OZuAI8XkNMciyme44wdWaEteEtmduISLyfjHREHjA8SU1belCQrbUXYP7855F7aiDmQQ==",
        "X-Received": "by 10.28.0.207 with SMTP id 198mr6516715wma.92.1505115748446;\n\tMon, 11 Sep 2017 00:42:28 -0700 (PDT)",
        "From": "Jiri Pirko <jiri@resnulli.us>",
        "To": "netdev@vger.kernel.org",
        "Cc": "davem@davemloft.net, arkadis@mellanox.com, idosch@mellanox.com,\n\tflokli@flokli.de, mlxsw@mellanox.com",
        "Subject": "[patch net] mlxsw: spectrum: Fix EEPROM access in case of SFP/SFP+",
        "Date": "Mon, 11 Sep 2017 09:42:26 +0200",
        "Message-Id": "<20170911074226.2020-1-jiri@resnulli.us>",
        "X-Mailer": "git-send-email 2.9.3",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Arkadi Sharshevsky <arkadis@mellanox.com>\n\nThe current code does not handle correctly the access to the upper page\nin case of SFP/SFP+ EEPROM. In that case the offset should be local\nand the I2C address should be changed.\n\nFixes: 2ea109039cd3 (\"mlxsw: spectrum: Add support for access cable info via ethtool\")\nReported-by: Florian Klink <flokli@flokli.de>\nSigned-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>\nReviewed-by: Ido Schimmel <idosch@mellanox.com>\nSigned-off-by: Jiri Pirko <jiri@mellanox.com>\n---\nDave, could you please queue this up to STABLE as well? Thanks!\n---\n drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 19 +++++++++++++++++--\n 1 file changed, 17 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c\nindex ed7cd6c..e080459 100644\n--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c\n+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c\n@@ -2545,7 +2545,9 @@ static int mlxsw_sp_flash_device(struct net_device *dev,\n \treturn err;\n }\n \n-#define MLXSW_SP_QSFP_I2C_ADDR 0x50\n+#define MLXSW_SP_I2C_ADDR_LOW 0x50\n+#define MLXSW_SP_I2C_ADDR_HIGH 0x51\n+#define MLXSW_SP_EEPROM_PAGE_LENGTH 256\n \n static int mlxsw_sp_query_module_eeprom(struct mlxsw_sp_port *mlxsw_sp_port,\n \t\t\t\t\tu16 offset, u16 size, void *data,\n@@ -2554,12 +2556,25 @@ static int mlxsw_sp_query_module_eeprom(struct mlxsw_sp_port *mlxsw_sp_port,\n \tstruct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;\n \tchar eeprom_tmp[MLXSW_SP_REG_MCIA_EEPROM_SIZE];\n \tchar mcia_pl[MLXSW_REG_MCIA_LEN];\n+\tu16 i2c_addr;\n \tint status;\n \tint err;\n \n \tsize = min_t(u16, size, MLXSW_SP_REG_MCIA_EEPROM_SIZE);\n+\n+\tif (offset < MLXSW_SP_EEPROM_PAGE_LENGTH &&\n+\t    offset + size > MLXSW_SP_EEPROM_PAGE_LENGTH)\n+\t\t/* Cross pages read, read until offset 256 in low page */\n+\t\tsize = MLXSW_SP_EEPROM_PAGE_LENGTH - offset;\n+\n+\ti2c_addr = MLXSW_SP_I2C_ADDR_LOW;\n+\tif (offset >= MLXSW_SP_EEPROM_PAGE_LENGTH) {\n+\t\ti2c_addr = MLXSW_SP_I2C_ADDR_HIGH;\n+\t\toffset -= MLXSW_SP_EEPROM_PAGE_LENGTH;\n+\t}\n+\n \tmlxsw_reg_mcia_pack(mcia_pl, mlxsw_sp_port->mapping.module,\n-\t\t\t    0, 0, offset, size, MLXSW_SP_QSFP_I2C_ADDR);\n+\t\t\t    0, 0, offset, size, i2c_addr);\n \n \terr = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mcia), mcia_pl);\n \tif (err)\n",
    "prefixes": [
        "net"
    ]
}