aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-08-01iwlwifi: refactor firmware debug codeJohannes Berg1-1031/+0
Split out the firmware debug code to be more general, so that it can be used by different subdrivers. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: track current firmware image in common codeJohannes Berg1-3/+3
Track the current firmware image in the common code instead of in the opmode so that later patches can access it there in a common way. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: refactor shared mem parsingJohannes Berg1-9/+9
Refactor the shared memory command parsing into common code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: refactor out paging codeJohannes Berg1-6/+6
Refactor the paging code from mvm to be used by different opmodes. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-23iwlwifi: mvm: reset the fw_dump_desc pointer after ASSERTEmmanuel Grumbach1-4/+2
When we get an ASSERT, the fw_dump_desc pointer points to iwl_mvm_dump_desc_assert which can't be freed since it is a global. We still need to NULL'ify the pointer when we call iwl_mvm_free_fw_dump_desc otherwise we will hit int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm, const struct iwl_mvm_dump_desc *desc, const struct iwl_fw_dbg_trigger_tlv *trigger) { <snip> if (WARN_ON(mvm->fw_dump_desc)) iwl_mvm_free_fw_dump_desc(mvm); Fixes: b6eaa45aa18b ("iwlwifi: mvm: add the cause of the firmware dump in the dump") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-23iwlwifi: mvm: disable dbg data collect when fw isn't aliveLiad Kaufman1-0/+4
If FW isn't alive, trying to collect debug data will result in errors both in driver and in the collected data, so just warn and leave the collecting function in this case. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-12Merge tag 'iwlwifi-next-for-kalle-2017-06-06' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-nextKalle Valo1-34/+18
First batch of iwlwifi driver patches 4.13 * Loads of FW API documentation improvements (for tools and htmldoc); * Continued work for the new A000 family; * Bumped the maximum supported FW API to 31; * Improve the differentiation between 8000, 9000 and A000 families; * A lot of fixes and cleanups here and there; kvalo: There were conflicts iwl_mvm_stop_device() and iwl_mvm_tcool_set_cur_state(). The former was easy but latter needed more thought. Apparently the mutex was taken too late, so I fixed so that the mutex is taken first and then check for iwl_mvm_firmware_running().
2017-06-05iwlwifi: mvm: use schedule_delayed_work()Johannes Berg1-1/+1
There's no need to refer to system_wq directly, use the provided wrapper schedule_delayed_work(). Made with the following spatch: @@ expression E,F; @@ -queue_delayed_work(system_wq, E, F); +schedule_delayed_work(E, F); Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: mvm: disable prph collection in a000 hwLiad Kaufman1-10/+13
Apart from the current list of PRPH that can't be collected in A000 HW, the rest of the debug dump data the driver collects is valid, so there is no need to disable collection only because of this. Disable PRPH collecting in A000 HW, and allow collecting the rest of the debug data. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: remove references to 8000 B-step devicesSara Sharon1-21/+0
We don't have any 8000 B-step right now, and there is no firmware loading code for them anyway. Further more, 9000 B-step devices will hit those code paths. Remove code that was introduced only for 8000 B-step. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: mvm: fix firmware debug restart recordingEmmanuel Grumbach1-11/+1
When we want to stop the recording of the firmware debug and restart it later without reloading the firmware we don't need to resend the configuration that comes with host commands. Sending those commands confused the hardware and led to an NMI 0x66. Change the flow as following: * read the relevant registers (DBGC_IN_SAMPLE, DBGC_OUT_CTRL) * clear those registers * wait for the hardware to complete its write to the buffer * get the data * restore the value of those registers (to restart the recording) For early start (where the configuration is already compiled in the firmware), we don't need to set those registers after the firmware has been loaded, but only when we want to restart the recording without having restarted the firmware. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-02iwlwifi: mvm: remove wrt support of page dumps in gen2Liad Kaufman1-2/+4
In gen2, page dumping should be done in transport layer, since the addresses needed for the paging mechanism reside there. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-19iwlwifi: mvm: support change to a000 smem APISara Sharon1-121/+166
API was changed once more to support 2 LMACs. Adapt to change while preserving current functionality. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-02-03iwlwifi: mvm: synchronize firmware DMA paging memorySara Sharon1-0/+4
When driver needs to access the contents of a streaming DMA buffer without unmapping it it should call dma_sync_single_for_cpu(). Once the call has been made, the CPU "owns" the DMA buffer and can work with it as needed. Before the device accesses the buffer, however, ownership should be transferred back to it with dma_sync_single_for_device(). Both calls weren't performed by the driver, resulting with odd paging errors on some platforms. Fix it. Fixes: a6c4fb4441f4 ("iwlwifi: mvm: Add FW paging mechanism for the UMAC on PCI") Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26iwlwifi: mvm: properly check for transport data in dumpJohannes Berg1-5/+6
When copying from vmalloc'ed memory to the SG list, don't crash if the transport didn't provide any data. Fixes: 7e62a699aafb ("iwlwifi: mvm: use dev_coredumpsg()") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26iwlwifi: allow memory debug TLV to specify the memory typeJohannes Berg1-12/+53
Due to some new features and changes, the firmware file will now specify what type of memory to dump, in upper 8 bits of the type field of the TLV. Parse it (types we don't understand are errors) and teach the code to dump periphery memory. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-23iwlwifi: mvm: make iwl_dump_prph() voidJohannes Berg1-10/+6
The return value is never used, so make the function void. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-23iwlwifi: mvm: accept arbitrary memory dump TLVsJohannes Berg1-26/+21
There's no reason to be validating the memory dump types, or checking them for duplication, or anything, since we really just pass them through from the TLV to the dump. Thus, change the way we handle memory dump TLVs to let the driver just blindly use anything specified there, dumping it into the memory dump output file. This makes the system extensible without driver changes. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-10-26iwlwifi: mvm: use dev_coredumpsg()Aviya Erenfeld1-45/+55
iwlmvm currently uses dev_coredumpm() to collect multiple buffers, but this has the downside of pinning the module until the coredump expires, if the data isn't read by any userspace. Avoid this by using the new dev_coredumpsg() method. We still copy the data from the old way of generating it, but neither hold on to vmalloc'ed data for a long time, nor do we pin the module now. Signed-off-by: Aviya Erenfeld <aviya.erenfeld@intel.com> [rewrite commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-17Merge tag 'iwlwifi-next-for-kalle-2016-09-15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-nextKalle Valo1-3/+1
* work for new hardware support continues * dynamic queue allocation stabilization * improvements in the MSIx code * multiqueue support work continues * new firmware version support * general cleanups and improvements
2016-09-15iwlwifi: mvm: support new shared memory config APISara Sharon1-1/+1
In a000 devices we have 15 fifos, so in the shared memory config the number of tx fifos in the array was changed accordingly. As it is in the middle of the struct, the parsing code needs to be duplicated. To minimize the duplication, do not save variables we never actually use. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-15iwlwifi: mvm: remove dump of locked registersSara Sharon1-2/+0
Firmware may lock those registers for access. This results in 9000 devices with a bus stall and an endless loop of 0x5a5a5a. Don't dump those registers. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-08-29iwlwifi: mvm: don't use ret when not initialisedEmmanuel Grumbach1-1/+2
fw-dbg code return ret but that variable was either 0 or not initialised. Return 0 always. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Fixes: 6a95126763fb ("iwlwifi: mvm: send dbg config hcmds to fw if set in tlv") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-08Merge tag 'iwlwifi-next-for-kalle-2016-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-nextKalle Valo1-1/+2
* work on DQA continued * SAR BIOS implementation * some work on debugging capabilities * added support for GCMP encryption * data path rework in preparation for new HW * some cleanup to remove transport dependency on mac80211 * support for MSIx in preparation for new HW * lots of work in preparation for HW support (9000 and a000 series) * general cleanups * general bugfixes
2016-07-06iwlwifi: mvm: write the correct internal TXF indexGolan Ben-Ami1-1/+2
The TX fifos are arranged consecutively in the SMEM, beginning with the regular fifos, and tailed by the internal fifos. In the current code, while trying to read the internal fifos, we read the fifos beginning with the index zero. By doing this we actually re-read the regular fifos. In order to read the internal fifos, start the reading index from the number of regular fifos configured by the fw. Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com> Fixes: 39654cb3a6a2 ("iwlwifi: don't access a nonexistent register upon assert") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-05-20Merge tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-coreLinus Torvalds1-2/+2
Pull driver core updates from Greg KH: "Here's the "big" driver core update for 4.7-rc1. Mostly just debugfs changes, the long-known and messy races with removing debugfs files should be fixed thanks to the great work of Nicolai Stange. We also have some isa updates in here (the x86 maintainers told me to take it through this tree), a new warning when we run out of dynamic char major numbers, and a few other assorted changes, details in the shortlog. All have been in linux-next for some time with no reported issues" * tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (32 commits) Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case" gpio: ws16c48: Utilize the ISA bus driver gpio: 104-idio-16: Utilize the ISA bus driver gpio: 104-idi-48: Utilize the ISA bus driver gpio: 104-dio-48e: Utilize the ISA bus driver watchdog: ebc-c384_wdt: Utilize the ISA bus driver iio: stx104: Utilize the module_isa_driver and max_num_isa_dev macros iio: stx104: Add X86 dependency to STX104 Kconfig option Documentation: Add ISA bus driver documentation isa: Implement the max_num_isa_dev macro isa: Implement the module_isa_driver macro pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS isa: Decouple X86_32 dependency from the ISA Kconfig option driver-core: use 'dev' argument in dev_dbg_ratelimited stub base: dd: don't remove driver_data in -EPROBE_DEFER case kernfs: Move faulting copy_user operations outside of the mutex devcoredump: add scatterlist support debugfs: unproxify files created through debugfs_create_u32_array() debugfs: unproxify files created through debugfs_create_blob() debugfs: unproxify files created through debugfs_create_bool() ...
2016-05-10iwlwifi: don't access a nonexistent register upon assertEmmanuel Grumbach1-3/+4
The commit below added code to dump the content of FIFOs that are present only on dual CPU products (8000 and up). This broke 7265D whose firmware does advertise IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG but doesn't have 2 CPUs. The current code does check the length of the FIFO before dumping them (and the nonexistent FIFO has a 0 length), but we still accessed a register to set the FIFO number and that made the DMA unhappy. The impact was a much longer recovery upon firmware assert. Fixes: 5b086414293f ("iwlwifi: mvm: support dumping UMAC internal txfifos") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-05-10iwlwifi: mvm: add more registers to dump upon errorGolan Ben-Ami1-9/+44
Add UREG, RXFC, RFH, WMAL and RL2P registers to the prph dump upon error. These regesiters could help to debug MSI-X and other issues. These register should be dumped only when multi-queue rx is supported so separate the prph ranges static array to two different arrays, and enable dumping different prph ranges according to run-time decision. Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-05-10Merge tag 'iwlwifi-for-kalle-2016-05-04' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixesLuca Coelho1-2/+4
* fix P2P rates (and possibly other issues) Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-04-15devcoredump: add scatterlist supportAviya Erenfeld1-2/+2
Add scatterlist support (dev_coredumpsg) to allow drivers to avoid vmalloc() like dev_coredumpm(), while also avoiding the module reference that the latter function requires. This internally uses dev_coredumpm() with function inside the devcoredump module, requiring removing the const (which touches the driver using it.) Signed-off-by: Aviya Erenfeld <aviya.erenfeld@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-12iwlwifi: mvm: fix accessing Null pointer during fw dump collectionMatti Gottlieb1-2/+4
The firwmare file can come with data that is relevant for paging. This data is availablet to the firmware upon request, but it stored in the host's memory. During the firmware init flow, the driver configures the firmware so that the firwmare knows where is the data. When paging is used, the variable paging_mem_size is the number of bytes that are available through paging. This variable is not zeror-ed if the driver fails to configure the paging in the firmware, but the memory is freed which is inconsistent. This inconsistency led to a NULL pointer dereference in the code that collects the debug data. Fix this by zero-ing the paging_mem_size variable and NULLify the relevant pointers, so that the code that collects the debug data will know that the paging data is not available. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-03-30iwlwifi: store fw memory segments length and addresses in run-timeGolan Ben-Ami1-15/+46
Currently reading the fw memory segments is done according to addresses and data length that are hard-coded. Lately a new tlv was appended to the ucode, that contains the data type, length and address. Parse this tlv, and in run-time store the memory segments length and addresses that would be dumped upon a fw error. Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-03-20iwlwifi: mvm: support dumping UMAC internal txfifosGolan Ben-Ami1-2/+77
In case of FW error, support dumping the UMAC internal txfifos. To do so, support version 2 of shared memory cfg command, which contains the sizes of the internal txfifos, and move the command to the system group. Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-02-01iwlwifi: mvm: remove shadowing variableJohannes Berg1-2/+0
The outer scope has a perfectly suitable 'i' variable, use it instead of adding a shadowing one in the inner scope. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-02-01iwlwifi: mvm: make collecting fw debug data optionalGolan Ben-Ami1-0/+4
Slow platforms may have issues with dumping data upon firmware assert. Make it easier to disable it for those platform. Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-01-07iwlwifi: mvm: fix memory leaks in error paths upon fw error dumpEmmanuel Grumbach1-8/+6
When iwl_mvm_fw_error_dump fails, it needs to clear the state in mvm, which includes: * clear IWL_MVM_STATUS_DUMPING_FW_LOG * set mvm->fw_dump_trig to NULL * free the description While at it, remove a NULL check in iwl_mvm_free_fw_dump_desc since kfree is NULL safe. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-01-07iwlwifi: mvm: constify the parameters of a few functions in fw-dbg.cEmmanuel Grumbach1-4/+4
The debug functions of fw-dbg.c don't really need to modify the trigger and the description they receive as a parameter. Constify the pointers. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-01-07iwlwifi: mvm: dump the radio registers when the firmware crashesEmmanuel Grumbach1-2/+38
Dumping the content of the radio registers greatly helps to debug PHY issues, which can lead to TFD queue hang. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-12-21iwlwifi: remove unused parameter from grab_nic_accessEmmanuel Grumbach1-2/+2
All the callers used silent = false. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-12-20iwlwifi: mvm: dump more registers upon errorEmmanuel Grumbach1-13/+16
These registers can help to debug PHY issues. Since this adds a significant amount of work to the debug collection phase, dump the periphery registers only if the firmware is stopped. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-12-13iwlwifi: mvm: remove an extra tabDan Carpenter1-1/+1
Smatch prints a static checker warning here: drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c:386 iwl_dump_prph() warn: curly braces intended? Curly braces are NOT intended, the extra tab was added by mistake in commit 1a616dd2f171 ('iwlwifi: dump prph registers in a common place for all transports'). type=cleanup Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-12-01iwlwifi: change the Intel Wireless email addressEmmanuel Grumbach1-1/+1
ilw@linux.intel.com is not available anymore. linuxwifi@intel.com should be used instead. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-12-01iwlwifi: mvm: move fw-dbg code to separate fileGolan Ben-Ami1-0/+780
The fw debug functionality is big enough to warrant a separate file. Move existing related functions to the new file. Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>