{"id":810884,"url":"http://patchwork.ozlabs.org/api/1.2/patches/810884/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170907075152.4522-1-luca@coelho.fi/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","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":"<20170907075152.4522-1-luca@coelho.fi>","list_archive_url":null,"date":"2017-09-07T07:51:52","name":"iwlwifi: mvm: only send LEDS_CMD when the FW supports it","commit_ref":null,"pull_url":null,"state":"awaiting-upstream","archived":true,"hash":"2a0b11b67cb21b81b56188a14c62e48557a5e1e0","submitter":{"id":17042,"url":"http://patchwork.ozlabs.org/api/1.2/people/17042/?format=json","name":"Luca Coelho","email":"luca@coelho.fi"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20170907075152.4522-1-luca@coelho.fi/mbox/","series":[{"id":1935,"url":"http://patchwork.ozlabs.org/api/1.2/series/1935/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=1935","date":"2017-09-07T07:51:52","name":"iwlwifi: mvm: only send LEDS_CMD when the FW supports it","version":1,"mbox":"http://patchwork.ozlabs.org/series/1935/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/810884/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/810884/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 3xnt320p2Vz9s82\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 17:52:30 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754522AbdIGHwO (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 7 Sep 2017 03:52:14 -0400","from paleale.coelho.fi ([176.9.41.70]:48608 \"EHLO\n\tfarmhouse.coelho.fi\" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org\n\twith ESMTP id S1754344AbdIGHwN (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 7 Sep 2017 03:52:13 -0400","from a91-156-4-241.elisa-laajakaista.fi ([91.156.4.241]\n\thelo=localhost.localdomain) by farmhouse.coelho.fi with esmtpsa\n\t(TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89)\n\t(envelope-from <luca@coelho.fi>)\n\tid 1dprbV-0002aL-Cz; Thu, 07 Sep 2017 10:52:03 +0300"],"From":"Luca Coelho <luca@coelho.fi>","To":"torvalds@linux-foundation.org","Cc":"linux-wireless@vger.kernel.org, johannes@sipsolutions.net,\n\tlinux-kernel@vger.kernel.org, akpm@linux-foundation.org,\n\tkvalo@codeaurora.org, netdev@vger.kernel.org, davem@davemloft.net,\n\temmanuel.grumbach@intel.com, Luca Coelho <luciano.coelho@intel.com>","Date":"Thu,  7 Sep 2017 10:51:52 +0300","Message-Id":"<20170907075152.4522-1-luca@coelho.fi>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<CA+55aFxjHSW7v4Ttu7mGPkxdGpR-WtVoxDT5qtwxUC-Dge5a5A@mail.gmail.com>","References":"<CA+55aFxjHSW7v4Ttu7mGPkxdGpR-WtVoxDT5qtwxUC-Dge5a5A@mail.gmail.com>","X-SA-Exim-Connect-IP":"91.156.4.241","X-SA-Exim-Mail-From":"luca@coelho.fi","Subject":"[PATCH] iwlwifi: mvm: only send LEDS_CMD when the FW supports it","X-SA-Exim-Version":"4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000)","X-SA-Exim-Scanned":"No (on farmhouse.coelho.fi); Unknown failure","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"From: Luca Coelho <luciano.coelho@intel.com>\n\nThe LEDS_CMD command is only supported in some newer FW versions\n(e.g. iwlwifi-8000C-31.ucode), so we can't send it to older versions\n(such as iwlwifi-8000C-27.ucode).\n\nTo fix this, check for a new bit in the FW capabilities TLV that tells\nwhen the command is supported.\n\nNote that the current version of -31.ucode in linux-firmware.git\n(31.532993.0) does not have this capability bit set, so the LED won't\nwork, even though this version should support it.  But we will update\nthis firmware soon, so it won't be a problem anymore.\n\nFixes: 7089ae634c50 (\"iwlwifi: mvm: use firmware LED command where applicable\")\nReported-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: Luca Coelho <luciano.coelho@intel.com>\n---\n drivers/net/wireless/intel/iwlwifi/fw/file.h | 1 +\n drivers/net/wireless/intel/iwlwifi/mvm/led.c | 3 ++-\n 2 files changed, 3 insertions(+), 1 deletion(-)","diff":"diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h\nindex 887f6d8fc8a7..279248cd9cfb 100644\n--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h\n+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h\n@@ -378,6 +378,7 @@ enum iwl_ucode_tlv_capa {\n \tIWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG\t= (__force iwl_ucode_tlv_capa_t)80,\n \tIWL_UCODE_TLV_CAPA_LQM_SUPPORT\t\t\t= (__force iwl_ucode_tlv_capa_t)81,\n \tIWL_UCODE_TLV_CAPA_TX_POWER_ACK\t\t\t= (__force iwl_ucode_tlv_capa_t)84,\n+\tIWL_UCODE_TLV_CAPA_LED_CMD_SUPPORT\t\t= (__force iwl_ucode_tlv_capa_t)86,\n \tIWL_UCODE_TLV_CAPA_MLME_OFFLOAD\t\t\t= (__force iwl_ucode_tlv_capa_t)96,\n \n \tNUM_IWL_UCODE_TLV_CAPA\ndiff --git a/drivers/net/wireless/intel/iwlwifi/mvm/led.c b/drivers/net/wireless/intel/iwlwifi/mvm/led.c\nindex 005e2e7278a5..b27269504a62 100644\n--- a/drivers/net/wireless/intel/iwlwifi/mvm/led.c\n+++ b/drivers/net/wireless/intel/iwlwifi/mvm/led.c\n@@ -92,7 +92,8 @@ static void iwl_mvm_send_led_fw_cmd(struct iwl_mvm *mvm, bool on)\n \n static void iwl_mvm_led_set(struct iwl_mvm *mvm, bool on)\n {\n-\tif (mvm->cfg->device_family >= IWL_DEVICE_FAMILY_8000) {\n+\tif (fw_has_capa(&mvm->fw->ucode_capa,\n+\t\t\tIWL_UCODE_TLV_CAPA_LED_CMD_SUPPORT)) {\n \t\tiwl_mvm_send_led_fw_cmd(mvm, on);\n \t\treturn;\n \t}\n","prefixes":[]}