summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
Commit message (Collapse)AuthorAgeFilesLines
* iwlwifi: dbg_ini: implement Rx fifos dumpShahar S Matityahu2019-02-201-2/+131
| | | | | | | Implement Rx fifos dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: implement Tx fifos dumpShahar S Matityahu2019-02-201-6/+183
| | | | | | | Implement Tx fifos dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: add region to fill_header handlerShahar S Matityahu2019-02-201-9/+12
| | | | | | | | Add iwl_fw_ini_region_cfg region struct to fill_header handler of iwl_dump_ini_mem_ops. it is needed for future support in fifos dumping. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: make fill_range handler accept generic range pointerShahar S Matityahu2019-02-201-24/+29
| | | | | | | | Make fill_range handler of iwl_dump_ini_mem_ops accept a generic range pointer. It is needed for future support in fifos dumping. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: make memory dump get_size handler include headersShahar S Matityahu2019-02-201-49/+49
| | | | | | | | Make the get size handler of iwl_dump_ini_mem_ops include the total size of the region. It is needed for fifos dumping. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: add print to iwl_dump_ini_mem in case of invalid rangeShahar S Matityahu2019-02-201-2/+6
| | | | | | | Add informative print in case the range is not available. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: fix infinite time ignore consecutive dumpsShahar S Matityahu2019-02-201-2/+0Star
| | | | | | | | | | | | The driver sets ignore_consec to -1 which is 0xffffffff in u32 so when iwl_fw_ini_trigger_on is called, it will always return false and each trigger could be used only once. Solve this by removing the assignment to -1. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: fe1b7d6c2888 ("iwlwifi: add support for triggering ini triggers") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: remove redundant condition from prior alive dump flowShahar S Matityahu2019-02-201-16/+0Star
| | | | | | | | | | | | | | After the FW image was loaded for the first time, fwrt->smem_cfg.num_lmacs value will no longer be zero since we don't clean it when we stop the device. So if we load the image once and then we fail on a consecutive attempt, the driver will abort any dumping. Solve this by removing the condition. It is safe to remove since when we do the actual dumping in iwl_fw_dbg_collect_sync we check that STATUS_DEVICE_ENABLED bit is still active. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: enable ignore consecutive trigger featureShahar S Matityahu2019-02-141-2/+1Star
| | | | | | | | Enable ignore consecutive trigger feature which allows to configure the driver to skip consecutive triggers from the same type. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: properly use delay option in dump trigger flowShahar S Matityahu2019-02-141-2/+4
| | | | | | | | | | | | Fix several issues related to dump delay: 1. In legacy dump trigger, use stop_delay field instead of trig_dis_ms. 2. ini delay is messured in usec so align both ini and legacy to usec. 3. schedule_delayed_work receives the delay value in jiffies so translate the dump delay to jiffies. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: ea7cb8293874 ("iwlwifi: dbg: make trigger functions type agnostic") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: align to new periphery address space for AX210 familyShaul Triebitz2019-02-141-4/+8
| | | | | | | | In AX210 family, UMAC periphery address space moved from 0xA00000 to 0xD00000. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: temporarily skip periphery dump for AX210 devicesShaul Triebitz2019-02-141-3/+5
| | | | | | | | | Many periphery addresses have changed in AX210 devices. Until sorting out which peripheries should be dumped, skip that step for now. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: rewrite trigger flow and align to FW API changesShahar S Matityahu2019-02-141-37/+79
| | | | | | | | | | | | | | | | | | | | Trigger field ignore_default was changed to override_trig. The first byte of the field indicates the driver to override existing configuration or keep the previous one The second byte of the field indicated the driver to replace the regions of the previous trigger or to append new regions to it. Change the way the active triggers are maintained to support trigger override in different apply points. Do this by making a trigger that updates at runtime by the triggers that are being used in the different apply points. In case of an assert, the driver does not reconfigure the triggers and uses the old configuration which leads to undefined behavior. Solve this by clearing the triggers in assert recovery flow. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: implement monitor dram memory dumpShahar S Matityahu2019-02-141-12/+74
| | | | | | | Implement monitor dram memory dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: implement monitor sram memory dumpShahar S Matityahu2019-02-141-6/+17
| | | | | | | Implement monitor sram memory dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: implement paging memory dumpShahar S Matityahu2019-02-041-12/+102
| | | | | | | | | Implement paging memory dump in the new dump mechanism. To support this change, moved iwl_self_init_dram strcut from trans_pcie to trans so that it will accessible via fw_runtime. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: implement device internal memory dumpShahar S Matityahu2019-02-041-39/+21Star
| | | | | | | Implement device internal memory dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: implement csr memory dumpShahar S Matityahu2019-02-041-31/+25Star
| | | | | | | Implement csr memory dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: create new dump flow and implement prph dumpShahar S Matityahu2019-02-041-39/+125
| | | | | | | | Create a skeleton to unite all memory dumps in ini mode. Implement prph dump with the new skeleton. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: align struct iwl_fw_ini_region_cfg to the FWShahar S Matityahu2019-02-041-15/+26
| | | | | | | | | | | | | | | | | New fields were added to struct iwl_fw_ini_region_cfg. add those field and apply the changes the result from this change offset field is used to differentiate between the different LMACs and any memory access to the region addresses should be base_addr + offset. A fifo struct is to hold the meta data needed for fifo regions Also move range_data_size and num_of_ranges into a struct under the union to be aligned to the struct in the FW. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: remove redundant dram buffer allocationShahar S Matityahu2019-02-041-35/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are several flows in that can cause redundant allocation. In case the driver reaches the maximum amount of blocks allowed, it allocates the buffer and only then checks if it reached the maximum amount of blocks and return without freeing the buffer, causing a memory leak. Solve this by moving the check of the amount of buffers being used before the allocation. In case there was an assert, the apply points are being reused, causing that for each assert, the driver allocates a new redundant buffer. Solve this by adding a new is_alloc field to indicate if the driver already allocated memory for the requested buffer. Also, split iwl_fw_dbg_buffer_allocation function into iwl_fw_dbg_buffer_allocation and iwl_fw_dbg_buffer_apply to increase the clearity of the flow. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: d47902f9f71d ("iwlwifi: dbg: add apply point logic") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: Fix pre operational dumping flowsShahar S Matityahu2019-02-041-38/+51
| | | | | | | | | | | | | | | There are several dumping flows in the driver in case of a fail prior to operational. In some cases we get 2 dumps while in others we get none. Fix this by uniting the different flows. Add a different dump type to driver triggered dumps in case we want a dump but did not got assert, and make all dumping go through iwl_fw_dbg_collect_desc to avoid multiple dumps. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: differentiate between alive timeout and alive flow failureShahar S Matityahu2019-02-041-13/+18
| | | | | | | | | | | | | | There are two cases that can cause the alive flow to fail, an assert or a timeout. Currently we mask any incoming asserts when we wait for alive. Solve this by differentiating between the two cases: 1. Let the regular error handling to handle a received assert 2. Do a dump collection in the case of a timeout Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: f38efdb29389 ("iwlwifi: add dump collection in case alive flow fails") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: fix bad dma handling in page_mem dumping flowShahar S Matityahu2019-02-041-0/+3
| | | | | | | | | | | | | | | | | | | | Prior to gen2 we allocate the paging memory via alloc_pages which requires passing ownership on the memory between the cpu and the device using dma_sync_single_for_cpu and dma_sync_single_for_device. Add missing dma_sync_single_for_device in iwl_dump_paging after copying the memory. since gen2, we allocate the paging memory using dma_alloc_coherent which does not need passing ownership between the cpu and device. Remove unneeded call to dma_sync_single_for_cpu in iwl_trans_pcie_dump_data prior to copying the memory. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: 5538409ba393 ("iwlwifi: pcie: support page dumping in wrt in gen2") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: give better naming to region struct fieldsShahar S Matityahu2019-02-041-10/+11
| | | | | | | | Some of the region struct fields have misleading naming change those fields to have an informative naming Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: set dump mask BIT(n) instead of nShahar S Matityahu2019-01-291-2/+2
| | | | | | | | | The driver sets dump_mask value instead of BIT(value). fix it by updating dump_mask correctly. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: 7a14c23dcdee ("iwlwifi: dbg: dump data according to the new ini TLVs") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: retrieve dump_delay value properlyShahar S Matityahu2019-01-291-1/+1
| | | | | | | | | The driver uses ignore_consec instead of dump_delay. Fix it by using dump_delay as expected. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: fe1b7d6c2888 ("iwlwifi: add support for triggering ini triggers") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: properly handle ini user triggerShahar S Matityahu2019-01-291-4/+0Star
| | | | | | | | | | | | | in case of a user trigger while ini is enable we change FW_DBG_TRIGGER_USER to IWL_FW_TRIGGER_ID_USER_TRIGGER in iwl_fw_dbg_collect and then again we attempt to do so in _iwl_fw_error_ini_dump which causes to abort the dump. Fix it by removing the second check in _iwl_fw_error_ini_dump. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: 7a14c23dcdee ("iwlwifi: dbg: dump data according to the new ini TLVs") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg_ini: allocate dram buffer with proper flagsShahar S Matityahu2019-01-291-2/+4
| | | | | | | | | | | | Use the same flags we use in the legacy buffer allocation. Missing __GFP_NOWARN will cause an unwanted warning incase we fail to allocate. Missing __GFP_ZERO will give a buffer initially filled with garbage which can make debug difficult in case our wrap count is zero. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: d47902f9f71d ("iwlwifi: dbg: add apply point logic") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: mvm: clean up LDBG config command usageJohannes Berg2019-01-291-6/+6
| | | | | | | | | | | | | | | | | | Clean up the LDBG config command to not be called "continuous recording", and while at it actually remove the continuous recording implementation completely since it was only used for store & forward architectures. This also fixes a bug at least in iwl_fw_dbg_buffer_allocation() because what's now "__le32 type" (matching the firmware) used to be "__le16 enable_recording", so the buffer allocation config sub-struct would erroneously have started at the wrong offset. In the other cases this didn't actually lead to a bug as other bytes in pad[] were all zeroes, so accessing the 16-bit value as a 32-bit value wouldn't make a difference (in little endian.) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: avoid access out of memory allocatedMordechay Goodstein2019-01-251-0/+6
| | | | | | | | | The value in num_lmac can be bigger than mem_cfg->lmac array, warn in case it's bigger. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Fixes: 68025d5f9bfe ("iwlwifi: dbg: refactor dump code to improve readability") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: tighten boundary checksLiad Kaufman2019-01-251-0/+2
| | | | | | | | | | The driver assumes certain sizes and lengths aren't crossed in some places. Make sure this indeed happens. Found by Klocwork. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: wrt: add 22000 device familiy prph dump supportShahar S Matityahu2019-01-251-37/+131
| | | | | | | Add prph dump addresses to support prph dump in 22000 HW. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: wrt: add to dump number of lmacs, lmac1 and umac error idShahar S Matityahu2019-01-251-1/+7
| | | | | | | | | | Add to the dump the number of lmacs, the error id of the umac and the error id of lmac1, if supported. In case the reason for the dump trigger is not an assert the error id is zero. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: add debug data to warningSara Sharon2018-12-201-1/+2
| | | | | | | | | Add debug data to the warning issued when getting wrong region id from firmware. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* iwlwifi: wrt: add rt status and num of rx/tx fifos to dumpShahar S Matityahu2018-12-201-0/+1
| | | | | | | | | | Add the rt status of the last assert or 0 if the dump collection was not initiated by an assert. Add the number of rx and tx fifos in use. These fields are added to dump info lst file. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* iwlwifi: add support for triggering ini triggersSara Sharon2018-12-141-6/+53
| | | | | | | Add support for ini triggers. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: dump data according to the new ini TLVsSara Sharon2018-12-141-2/+261
| | | | | | | | When ini TLVs are loaded, dump data according to the stored configuration. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: add apply point logicSara Sharon2018-11-231-0/+207
| | | | | | | | | | | | | Add a function to be called when apply point occurs. For each of the TLVs, the function will perform the apply point logic: - For HCMD - send the stored host command - For buffer allocation - allocate the memory and send the buffer allocation command - For trigger and region - update the stored configuration Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: disable triggers for iniSara Sharon2018-11-231-0/+3
| | | | | | | | When ini is loaded, disable all legacy trigger configuration. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: add fw dump upon RT ucode start failureLior Cohen2018-11-231-0/+8
| | | | | | | | | FW dump was missing in case the RT FW ucode section failed to load. This failure happens when the RT section of the FW file is corrupted. Signed-off-by: Lior Cohen <lior2.cohen@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: split fifos dumpSara Sharon2018-11-231-13/+39
| | | | | | | | | Split the dump of RXF and TXF. This is in order to enable code reuse for INI, which may decide to dump only RXF and not TXF, and vice versa. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: don't limit dump decisions to all or monitorSara Sharon2018-11-231-2/+5
| | | | | | | | | Currently opmode is limited to asking transport to either dump all the dumps configured at startup, or monitor only. Instead, pass to transport a bitmask, to allow flexibility. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: fw: use helper to determine whether to dump pagingSara Sharon2018-11-111-28/+29
| | | | | | | | | Logic is there twice, and we'll need a third place soon for ini dumping. In addition move the dumping to a function, also to enable reuse. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: use helper to check if debug type is setSara Sharon2018-11-111-18/+18
| | | | | | | This enables to incorporate more logic in one place. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: avoid passing trigger aroundSara Sharon2018-11-111-11/+9Star
| | | | | | | | | The trigger structure is being passed around, when all we care about is whether to dump only monitor or not. Pass a bool instead. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dump debug data before stop deviceShahar S Matityahu2018-10-081-7/+20
| | | | | | | | | | | | | | | | Debug data dump is not working in flows that stop the device is used in their error handling. During these flows the op mode mutex is locked until the device stops. Because of that, any assert generated from the firmware can be handled only after the device already stopped. Since dumping cannot occour after stopping the device, split the the dump function to two parts, Part that handles locking, and the part that starts the actual dumping and call the second part in the op mode stop device function. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: make trigger functions type agnosticSara Sharon2018-10-061-19/+18Star
| | | | | | | | As preparation for new trigger type, make iwl_fw_dbg_collect_desc agnostic to the trigger structure. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: dbg: decrement occurrences for all triggersSara Sharon2018-10-061-6/+10
| | | | | | | | | | | | iwl_fw_dbg_collect can be called by any function that already has the error string ready. iwl_fw_dbg_collect_trig, on the other hand, does string formatting. The occurrences decrement is at iwl_fw_dbg_collect_trig, instead of iwl_fw_dbg_collect, which causes it to sometimes be skipped. Move it to the right location. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: add dump collection in case alive flow failsShahar S Matityahu2018-10-061-1/+26
| | | | | | | | Trigger dump collection if the alive flow fails, regardless of the reason. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>