Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/815034/?format=api
{ "id": 815034, "url": "http://patchwork.ozlabs.org/api/patches/815034/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170918220225.3767-2-Nisar.Sayed@microchip.com/", "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": "<20170918220225.3767-2-Nisar.Sayed@microchip.com>", "list_archive_url": null, "date": "2017-09-18T22:02:23", "name": "[v4,net,1/3] lan78xx: Fix for eeprom read/write when device auto suspend", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "ed60ff2b78e118c144c589882751cfd7151375b7", "submitter": { "id": 71648, "url": "http://patchwork.ozlabs.org/api/people/71648/?format=api", "name": "Nisar Sayed", "email": "Nisar.Sayed@microchip.com" }, "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/20170918220225.3767-2-Nisar.Sayed@microchip.com/mbox/", "series": [ { "id": 3678, "url": "http://patchwork.ozlabs.org/api/series/3678/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=3678", "date": "2017-09-18T22:02:22", "name": "lan78xx: This series of patches are for lan78xx driver.", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/3678/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/815034/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/815034/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>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwsDV0BLWz9s72\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 02:39:53 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932763AbdIRQjv (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 12:39:51 -0400", "from esa5.microchip.iphmx.com ([216.71.150.166]:5780 \"EHLO\n\tesa5.microchip.iphmx.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932746AbdIRQju (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 18 Sep 2017 12:39:50 -0400", "from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t18 Sep 2017 09:39:50 -0700", "from ungdev1-OptiPlex-990.microchip.com (10.10.76.4) by\n\tchn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server\n\tid 14.3.352.0; Mon, 18 Sep 2017 09:39:49 -0700" ], "X-IronPort-AV": "E=Sophos;i=\"5.42,413,1500966000\"; d=\"scan'208\";a=\"4796757\"", "From": "Nisar Sayed <Nisar.Sayed@microchip.com>", "To": "<davem@davemloft.net>", "CC": "<UNGLinuxDriver@microchip.com>, <netdev@vger.kernel.org>", "Subject": "[PATCH v4 net 1/3] lan78xx: Fix for eeprom read/write when device\n\tauto suspend", "Date": "Tue, 19 Sep 2017 03:32:23 +0530", "Message-ID": "<20170918220225.3767-2-Nisar.Sayed@microchip.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20170918220225.3767-1-Nisar.Sayed@microchip.com>", "References": "<20170918220225.3767-1-Nisar.Sayed@microchip.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Fix for eeprom read/write when device auto suspend\n\nFixes: 55d7de9de6c3 (\"Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver\")\nSigned-off-by: Nisar Sayed <Nisar.Sayed@microchip.com>\n---\n drivers/net/usb/lan78xx.c | 24 ++++++++++++++++++++----\n 1 file changed, 20 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c\nindex b99a7fb09f8e..fcf85ae37435 100644\n--- a/drivers/net/usb/lan78xx.c\n+++ b/drivers/net/usb/lan78xx.c\n@@ -1265,30 +1265,46 @@ static int lan78xx_ethtool_get_eeprom(struct net_device *netdev,\n \t\t\t\t struct ethtool_eeprom *ee, u8 *data)\n {\n \tstruct lan78xx_net *dev = netdev_priv(netdev);\n+\tint ret;\n+\n+\tret = usb_autopm_get_interface(dev->intf);\n+\tif (ret)\n+\t\treturn ret;\n \n \tee->magic = LAN78XX_EEPROM_MAGIC;\n \n-\treturn lan78xx_read_raw_eeprom(dev, ee->offset, ee->len, data);\n+\tret = lan78xx_read_raw_eeprom(dev, ee->offset, ee->len, data);\n+\n+\tusb_autopm_put_interface(dev->intf);\n+\n+\treturn ret;\n }\n \n static int lan78xx_ethtool_set_eeprom(struct net_device *netdev,\n \t\t\t\t struct ethtool_eeprom *ee, u8 *data)\n {\n \tstruct lan78xx_net *dev = netdev_priv(netdev);\n+\tint ret;\n+\n+\tret = usb_autopm_get_interface(dev->intf);\n+\tif (ret)\n+\t\treturn ret;\n \n \t/* Allow entire eeprom update only */\n \tif ((ee->magic == LAN78XX_EEPROM_MAGIC) &&\n \t (ee->offset == 0) &&\n \t (ee->len == 512) &&\n \t (data[0] == EEPROM_INDICATOR))\n-\t\treturn lan78xx_write_raw_eeprom(dev, ee->offset, ee->len, data);\n+\t\tret = lan78xx_write_raw_eeprom(dev, ee->offset, ee->len, data);\n \telse if ((ee->magic == LAN78XX_OTP_MAGIC) &&\n \t\t (ee->offset == 0) &&\n \t\t (ee->len == 512) &&\n \t\t (data[0] == OTP_INDICATOR_1))\n-\t\treturn lan78xx_write_raw_otp(dev, ee->offset, ee->len, data);\n+\t\tret = lan78xx_write_raw_otp(dev, ee->offset, ee->len, data);\n \n-\treturn -EINVAL;\n+\tusb_autopm_put_interface(dev->intf);\n+\n+\treturn ret;\n }\n \n static void lan78xx_get_strings(struct net_device *netdev, u32 stringset,\n", "prefixes": [ "v4", "net", "1/3" ] }