From patchwork Thu Dec 4 22:05:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 417937 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 394D51400D2; Fri, 5 Dec 2014 09:06:20 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XweXR-0006q3-2e; Thu, 04 Dec 2014 22:06:17 +0000 Received: from mail-oi0-f43.google.com ([209.85.218.43]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XweXG-0006nX-Ff for kernel-team@lists.ubuntu.com; Thu, 04 Dec 2014 22:06:06 +0000 Received: by mail-oi0-f43.google.com with SMTP id a3so13151733oib.30 for ; Thu, 04 Dec 2014 14:06:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=wAgo6hJ9jFIiAGKGJ5b34VRZxstcp0rhBKcbsZuZon8=; b=Px6B3kDTKxswiYOqwvOTclyqKGMsybhM4cC1WDhFEEzwG/xMPTRe61yD/cUkSDUCDX 5a4YNlf9KUe1Dws9bd+LFe6Zok8UXMVtrt2NjjbXlvRUSjo7B6+Zf2fbHO9uqeALFw+x 9BuMaNZg76fs4yr6LIZeY9fIKEfVJxZ3gU57zKuLlKTSjOc9mmebMIsG6XdRgNX5Yrr/ KLjzIcPcA0X51gqINXBbt1kXO7ebTpTLKsEyKPcNaBP9TYwfbDHdF/wVmsq7Rmvs3ENZ lYNG9pLER/VS7L+bCu7W2zbQ5eZ1PaUcFVm8cg3nMHoEfzNF2vpHwX2rbmJX0VTgQlDQ JyPQ== X-Gm-Message-State: ALoCoQl1KCWrMfpk/63Kt0cK/S7X4ljBPM0ZbFz9CsXCRbFdYVHu/xjay+b2CvgfecoAsoKDhpa/ X-Received: by 10.60.94.73 with SMTP id da9mr8527520oeb.10.1417730765966; Thu, 04 Dec 2014 14:06:05 -0800 (PST) Received: from localhost (199-87-125-144.dyn.kc.surewest.net. [199.87.125.144]) by mx.google.com with ESMTPSA id rh7sm6966708oeb.0.2014.12.04.14.06.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Dec 2014 14:06:05 -0800 (PST) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/7][utopic SRU] iwlwifi: mvm: don't collect logs in the interrupt thread Date: Thu, 4 Dec 2014 16:05:40 -0600 Message-Id: <1417730742-38020-6-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417730742-38020-1-git-send-email-seth.forshee@canonical.com> References: <1417730742-38020-1-git-send-email-seth.forshee@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Emmanuel Grumbach commit 78dae98fab85f4cd2d38cfc3474dea6e87e7b53a upstream. Instead of reading all the data in the context of the interrupt thread, collect the data in the restart flow before the actual restart takes place so that the device still has all the information. Remove iwl_mvm_fw_error_sram_dump and move its content to iwl_mvm_fw_error_dump. Signed-off-by: Emmanuel Grumbach BugLink: http://bugs.launchpad.net/bugs/1399440 Signed-off-by: Seth Forshee --- drivers/net/wireless/iwlwifi/mvm/mvm.h | 3 --- drivers/net/wireless/iwlwifi/mvm/ops.c | 31 ++++++++++++------------------- drivers/net/wireless/iwlwifi/mvm/utils.c | 22 ---------------------- 3 files changed, 12 insertions(+), 44 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index fcc6c29..e084fc6 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h @@ -586,8 +586,6 @@ struct iwl_mvm { /* -1 for always, 0 for never, >0 for that many times */ s8 restart_fw; void *fw_error_dump; - void *fw_error_sram; - u32 fw_error_sram_len; u32 *fw_error_rxf; u32 fw_error_rxf_len; @@ -721,7 +719,6 @@ u8 iwl_mvm_mac80211_idx_to_hwrate(int rate_idx); void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm); #ifdef CONFIG_IWLWIFI_DEBUGFS void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm); -void iwl_mvm_fw_error_sram_dump(struct iwl_mvm *mvm); void iwl_mvm_fw_error_rxf_dump(struct iwl_mvm *mvm); #endif u8 first_antenna(u8 mask); diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c index 19aea4a..02e5b36 100644 --- a/drivers/net/wireless/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/iwlwifi/mvm/ops.c @@ -550,7 +550,6 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode) kfree(mvm->scan_cmd); vfree(mvm->fw_error_dump); - kfree(mvm->fw_error_sram); kfree(mvm->fw_error_rxf); kfree(mvm->mcast_filter_cmd); mvm->mcast_filter_cmd = NULL; @@ -828,6 +827,8 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) struct iwl_fw_error_dump_file *dump_file; struct iwl_fw_error_dump_data *dump_data; struct iwl_fw_error_dump_info *dump_info; + const struct fw_img *img; + u32 sram_len, sram_ofs; u32 file_len; u32 trans_len; @@ -836,9 +837,13 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) if (mvm->fw_error_dump) return; + img = &mvm->fw->img[mvm->cur_ucode]; + sram_ofs = img->sec[IWL_UCODE_SECTION_DATA].offset; + sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; + file_len = sizeof(*dump_file) + sizeof(*dump_data) * 3 + - mvm->fw_error_sram_len + + sram_len + mvm->fw_error_rxf_len + sizeof(*dump_info); @@ -870,6 +875,8 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) strncpy(dump_info->bus_human_readable, mvm->dev->bus->name, sizeof(dump_info->bus_human_readable)); + iwl_mvm_fw_error_rxf_dump(mvm); + dump_data = iwl_fw_error_next_data(dump_data); dump_data->type = cpu_to_le32(IWL_FW_ERROR_DUMP_RXF); dump_data->len = cpu_to_le32(mvm->fw_error_rxf_len); @@ -877,23 +884,14 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) dump_data = iwl_fw_error_next_data(dump_data); dump_data->type = cpu_to_le32(IWL_FW_ERROR_DUMP_SRAM); - dump_data->len = cpu_to_le32(mvm->fw_error_sram_len); - - /* - * No need for lock since at the stage the FW isn't loaded. So it - * can't assert - we are the only one who can possibly be accessing - * mvm->fw_error_sram right now. - */ - memcpy(dump_data->data, mvm->fw_error_sram, mvm->fw_error_sram_len); + dump_data->len = cpu_to_le32(sram_len); + iwl_trans_read_mem_bytes(mvm->trans, sram_ofs, dump_data->data, + sram_len); kfree(mvm->fw_error_rxf); mvm->fw_error_rxf = NULL; mvm->fw_error_rxf_len = 0; - kfree(mvm->fw_error_sram); - mvm->fw_error_sram = NULL; - mvm->fw_error_sram_len = 0; - if (trans_len) { void *buf = iwl_fw_error_next_data(dump_data); u32 real_trans_len = iwl_trans_dump_data(mvm->trans, buf, @@ -911,11 +909,6 @@ static void iwl_mvm_nic_error(struct iwl_op_mode *op_mode) iwl_mvm_dump_nic_error_log(mvm); -#ifdef CONFIG_IWLWIFI_DEBUGFS - iwl_mvm_fw_error_sram_dump(mvm); - iwl_mvm_fw_error_rxf_dump(mvm); -#endif - iwl_mvm_nic_restart(mvm); } diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c index aa9fc77..15db97c 100644 --- a/drivers/net/wireless/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/iwlwifi/mvm/utils.c @@ -520,28 +520,6 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm) } #ifdef CONFIG_IWLWIFI_DEBUGFS -void iwl_mvm_fw_error_sram_dump(struct iwl_mvm *mvm) -{ - const struct fw_img *img; - u32 ofs, sram_len; - void *sram; - - if (!mvm->ucode_loaded || mvm->fw_error_sram || mvm->fw_error_dump) - return; - - img = &mvm->fw->img[mvm->cur_ucode]; - ofs = img->sec[IWL_UCODE_SECTION_DATA].offset; - sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; - - sram = kzalloc(sram_len, GFP_ATOMIC); - if (!sram) - return; - - iwl_trans_read_mem_bytes(mvm->trans, ofs, sram, sram_len); - mvm->fw_error_sram = sram; - mvm->fw_error_sram_len = sram_len; -} - void iwl_mvm_fw_error_rxf_dump(struct iwl_mvm *mvm) { int i, reg_val;