Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/584391/?format=api
{ "id": 584391, "url": "http://patchwork.ozlabs.org/api/patches/584391/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1455754344-6372-3-git-send-email-avinash.dayanand@intel.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": "<1455754344-6372-3-git-send-email-avinash.dayanand@intel.com>", "list_archive_url": null, "date": "2016-02-18T00:12:12", "name": "[next,S29,02/14] i40e: Fix led blink capability for 10GBaseT PHY", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "cdca193714b1ce6015fb7f1ab5c5e6af994bfd58", "submitter": { "id": 67689, "url": "http://patchwork.ozlabs.org/api/people/67689/?format=api", "name": "Dayanand, Avinash", "email": "avinash.dayanand@intel.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/1455754344-6372-3-git-send-email-avinash.dayanand@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/584391/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/584391/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.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" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id B4A6C140297\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 18 Feb 2016 11:12:33 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 12D39953AD;\n\tThu, 18 Feb 2016 00:12:33 +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 b9KoTGKudogJ; Thu, 18 Feb 2016 00:12:30 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 62BB3954D3;\n\tThu, 18 Feb 2016 00:12:29 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6D4101C1714\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Feb 2016 00:12:27 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 69A6433A62\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Feb 2016 00:12:27 +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 e4lRsAIOIbKA for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Feb 2016 00:12:25 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby silver.osuosl.org (Postfix) with ESMTP id B35DE339BB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Feb 2016 00:12:25 +0000 (UTC)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP; 17 Feb 2016 16:12:26 -0800", "from jahay1-mobl2.amr.corp.intel.com (HELO\n\tlocalhost.localdomain.localdomain) ([134.134.3.116])\n\tby fmsmga002.fm.intel.com with ESMTP; 17 Feb 2016 16:12:25 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.22,463,1449561600\"; d=\"scan'208\";a=\"918067169\"", "From": "Avinash Dayanand <avinash.dayanand@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 17 Feb 2016 16:12:12 -0800", "Message-Id": "<1455754344-6372-3-git-send-email-avinash.dayanand@intel.com>", "X-Mailer": "git-send-email 2.1.0", "In-Reply-To": "<1455754344-6372-1-git-send-email-avinash.dayanand@intel.com>", "References": "<1455754344-6372-1-git-send-email-avinash.dayanand@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S29 02/14] i40e: Fix led blink\n\tcapability for 10GBaseT PHY", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "From: Carolyn Wyborny <carolyn.wyborny@intel.com>\n\nThis patch fixes a problem where the ethtool identify adapter\nfunctionality did not work for some copper PHY's. Without this\npatch, the blink led functionality fails on some parts. This\npatch adds PHY write code to blink led's on parts where this\nfunctionality is contained in the PHY rather than the MAC.\n\nSigned-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>\nChange-ID: Iee7b3453f61d5ffd0b3d03f720ee4f17f919fcc2\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 3 +++\n drivers/net/ethernet/intel/i40e/i40e_common.c | 26 +++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 36 +++++++++++++++++++++-----\n drivers/net/ethernet/intel/i40e/i40e_main.c | 4 +++\n 4 files changed, 63 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex a0ca94d..e7fcb81 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -111,6 +111,7 @@\n #define I40E_OEM_VER_PATCH_MASK 0xff\n #define I40E_OEM_VER_BUILD_SHIFT 8\n #define I40E_OEM_VER_SHIFT 24\n+#define I40E_PHY_DEBUG_PORT BIT(4)\n \n /* The values in here are decimal coded as hex as is the case in the NVM map*/\n #define I40E_CURRENT_NVM_VERSION_HI 0x2\n@@ -355,6 +356,7 @@ struct i40e_pf {\n #define I40E_FLAG_NO_DCB_SUPPORT\t\tBIT_ULL(45)\n #define I40E_FLAG_USE_SET_LLDP_MIB\t\tBIT_ULL(46)\n #define I40E_FLAG_STOP_FW_LLDP\t\t\tBIT_ULL(47)\n+#define I40E_FLAG_HAVE_10GBASET_PHY\t\tBIT_ULL(48)\n #define I40E_FLAG_PF_MAC\t\t\tBIT_ULL(50)\n \n \t/* tracks features that get auto disabled by errors */\n@@ -440,6 +442,7 @@ struct i40e_pf {\n \n \tu32 ioremap_len;\n \tu32 fd_inv;\n+\tu16 phy_led_val;\n };\n \n struct i40e_mac_filter {\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex 447729f..d417193 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -1888,6 +1888,32 @@ i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw,\n }\n \n /**\n+ * i40e_aq_set_phy_debug\n+ * @hw: pointer to the hw struct\n+ * @cmd_flags: debug command flags\n+ * @cmd_details: pointer to command details structure or NULL\n+ *\n+ * Reset the external PHY.\n+ **/\n+enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,\n+\t\t\t\t\tstruct i40e_asq_cmd_details *cmd_details)\n+{\n+\tstruct i40e_aq_desc desc;\n+\tstruct i40e_aqc_set_phy_debug *cmd =\n+\t\t(struct i40e_aqc_set_phy_debug *)&desc.params.raw;\n+\tenum i40e_status_code status;\n+\n+\ti40e_fill_default_direct_cmd_desc(&desc,\n+\t\t\t\t\t i40e_aqc_opc_set_phy_debug);\n+\n+\tcmd->command_flags = cmd_flags;\n+\n+\tstatus = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);\n+\n+\treturn status;\n+}\n+\n+/**\n * i40e_aq_add_vsi\n * @hw: pointer to the hw struct\n * @vsi_ctx: pointer to a vsi context struct\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 58a23d9..86765d4 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -1826,28 +1826,52 @@ static int i40e_set_phys_id(struct net_device *netdev,\n \t\t\t enum ethtool_phys_id_state state)\n {\n \tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n+\ti40e_status ret = 0;\n \tstruct i40e_pf *pf = np->vsi->back;\n \tstruct i40e_hw *hw = &pf->hw;\n \tint blink_freq = 2;\n+\tu16 temp_status;\n \n \tswitch (state) {\n \tcase ETHTOOL_ID_ACTIVE:\n-\t\tpf->led_status = i40e_led_get(hw);\n+\t\tif (!(pf->flags & I40E_FLAG_HAVE_10GBASET_PHY)) {\n+\t\t\tpf->led_status = i40e_led_get(hw);\n+\t\t} else {\n+\t\t\ti40e_aq_set_phy_debug(hw, I40E_PHY_DEBUG_PORT, NULL);\n+\t\t\tret = i40e_led_get_phy(hw, &temp_status,\n+\t\t\t\t\t &pf->phy_led_val);\n+\t\t\tpf->led_status = temp_status;\n+\t\t}\n \t\treturn blink_freq;\n \tcase ETHTOOL_ID_ON:\n-\t\ti40e_led_set(hw, 0xF, false);\n+\t\tif (!(pf->flags & I40E_FLAG_HAVE_10GBASET_PHY))\n+\t\t\ti40e_led_set(hw, 0xf, false);\n+\t\telse\n+\t\t\tret = i40e_led_set_phy(hw, true, pf->led_status, 0);\n \t\tbreak;\n \tcase ETHTOOL_ID_OFF:\n-\t\ti40e_led_set(hw, 0x0, false);\n+\t\tif (!(pf->flags & I40E_FLAG_HAVE_10GBASET_PHY))\n+\t\t\ti40e_led_set(hw, 0x0, false);\n+\t\telse\n+\t\t\tret = i40e_led_set_phy(hw, false, pf->led_status, 0);\n \t\tbreak;\n \tcase ETHTOOL_ID_INACTIVE:\n-\t\ti40e_led_set(hw, pf->led_status, false);\n+\t\tif (!(pf->flags & I40E_FLAG_HAVE_10GBASET_PHY)) {\n+\t\t\ti40e_led_set(hw, false, pf->led_status);\n+\t\t} else {\n+\t\t\tret = i40e_led_set_phy(hw, false, pf->led_status,\n+\t\t\t\t\t (pf->phy_led_val |\n+\t\t\t\t\t I40E_PHY_LED_MODE_ORIG));\n+\t\t\ti40e_aq_set_phy_debug(hw, 0, NULL);\n+\t\t}\n \t\tbreak;\n \tdefault:\n \t\tbreak;\n \t}\n-\n-\treturn 0;\n+\t\tif (ret)\n+\t\t\treturn -ENOENT;\n+\t\telse\n+\t\t\treturn 0;\n }\n \n /* NOTE: i40e hardware uses a conversion factor of 2 for Interrupt\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex fcef5cb..8919dc7 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -11126,6 +11126,10 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \ti40e_add_filter_to_drop_tx_flow_control_frames(&pf->hw,\n \t\t\t\t\t\t pf->main_vsi_seid);\n \n+\tif ((pf->hw.device_id == I40E_DEV_ID_10G_BASE_T) ||\n+\t (pf->hw.device_id == I40E_DEV_ID_10G_BASE_T4))\n+\t\tpf->flags |= I40E_FLAG_HAVE_10GBASET_PHY;\n+\n \t/* print a string summarizing features */\n \ti40e_print_features(pf);\n \n", "prefixes": [ "next", "S29", "02/14" ] }