aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
AgeCommit message (Collapse)AuthorFilesLines
2019-04-29iwlwifi: dbg_ini: check for valid region type during regions parsingShahar S Matityahu1-3/+8
Add region type checking during regions parsing to avoid attempts to parse unsupported or illegal region types. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-29iwlwifi: avoid allocating memory for region with disabled domainShahar S Matityahu1-0/+4
In iwl_fw_ini_get_trigger_len the driver allocates space for memory regions regardless of their domain and in iwl_fw_ini_dump_trigger the driver aborts trigger collection of disabled domain. This diff causes unneeded memory allocation and traling zeros in the dump file. Solve this behavior by enforcing domain checking in iwl_fw_ini_get_trigger_len Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-29iwlwifi: dbg: replace dump info device family with HW typeShahar S Matityahu1-5/+2
In the dump info, the driver sets device_family to IWL_FW_ERROR_DUMP_FAMILY_7 in case IWL_FW_ERROR_DUMP_FAMILY_7 is used or IWL_FW_ERROR_DUMP_FAMILY_8 otherwise. This information is misleading and incorrect since the driver sets the device family to 8 to any device that is from family 8 and later, e.g. device family 9 is represented as 8 in the dump. Also, the device family enum is known only to the driver and does not give any information to the FW developer Change the device family to HW type to give propper data about the nic in use. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-29iwlwifi: dbg_ini: add periodic trigger supportShahar S Matityahu1-0/+40
Allows to configure a periodic data collection Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-29iwlwifi: dbg_ini: add lmac and umac error tables dumping supportShahar S Matityahu1-1/+7
Add LMAC_ERROR_TABLE and UMAC_ERROR_TABLE region types and handle them in the same way as we handle DEVICE_MEMORY. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-19iwlwifi: dbg_ini: set dump bit only when trigger collection is certainShahar S Matityahu1-0/+3
In case the the trigger occurrences is zero or force_restart is set, the driver sets IWL_FWRT_STATUS_DUMPING without actually scheduling trigger collection. At this point no other dump collection can be performed. Solve this by setting IWL_FWRT_STATUS_DUMPING bit only when the driver is surely going to schedule dump collection Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-19iwlwifi: dbg: add lmac and umac PC registers to periphery dumpShahar S Matityahu1-0/+2
Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-19iwlwifi: dbg: add periphery memory dumping support to ax210 device familyShahar S Matityahu1-1/+7
Allows to dump periphery memory on ax210 devices. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-19iwlwifi: dbg_ini: add debug prints to the ini flowsShahar S Matityahu1-23/+79
Add debug prints to the ini flow and rewrite existing prints to provide more information Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-19iwlwifi: dbg_ini: support notification and dhc regions type parsingShahar S Matityahu1-1/+7
IWL_FW_INI_REGION_CSR and IWL_FW_INI_REGION_NOTIFICATION does not have memory addresses attached to them so the driver should skip them when parsing the region tlv. Also, instead of declearing what region types should skip the addition of the memory addresses, declare what regions have addition of memory addresses. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-18Merge tag 'wireless-drivers-next-for-davem-2019-04-18' of ↵David S. Miller1-148/+278
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 5.2 Nothing really special standing out this time, iwlwifi being the most active driver. Major changes: iwlwifi * send NO_DATA events so they can be captured in radiotap * support for multiple BSSID * support for some new FW API versions * support new hardware * debugfs cleanups by Greg-KH qtnfmac * allow each MAC to specify its own regulatory rules ==================== Signed-off-by: David S. Miller <[email protected]>
2019-04-03iwlwifi: dbg: fill radio registers data regardless of fifos data dumpingShahar S Matityahu1-2/+3
The driver calculates memory regions dump size, allocate memory and fills the data. The driver fills the radio registers data only if the memory size of the fifos is greater then zero, so in case the user masked out the fifos from the dump, the driver will skip filling the radio register data. Solve this by checking filling radio registers data independently from fifos data. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: apply rx fifo offset after reading the region registersShahar S Matityahu1-2/+6
The region registers comes in abolute value so read the registers before applying the rx fifo offset. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: remove redundant type argument from iwl_dump_ini_memShahar S Matityahu1-16/+12
Since iwl_dump_ini_mem receive struct iwl_fw_ini_region_cfg which holds the region type, there is no point to pass the type separately. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: remove redundant curly brackets from trigger collection flowShahar S Matityahu1-4/+2
remove redundant curly brackets from iwl_fw_ini_dump_trigger and iwl_fw_ini_get_trigger_len Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: add monitor header to smem monitorShahar S Matityahu1-16/+85
Add write pointer and cycle count registers to smem monitor header. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: fix the dram monitor header sizeShahar S Matityahu1-1/+2
Add sizeof(struct iwl_fw_ini_error_dump_range) to the header of the dram monitor. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: change memory range base address to u64Shahar S Matityahu1-6/+6
AX210 devices will use u64 for the base address to the DRAM monitor buffer. To support this, change the structure for all device families so both address sizes fit. Also move range_data_size to the top of the struct to ease the parsing of the memory range. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: add registers addresses in fifo dumpShahar S Matityahu1-14/+32
Add to the fifo dump the registers addresses. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: add region id to the region dumpShahar S Matityahu1-0/+1
Add the region id of the collected memory to the header of the memory region. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: add version to dump headerShahar S Matityahu1-0/+5
Add version to dump header to allow future changes of the dump struct, once the ini debug flow becomes operational, without breaking backwards compatibility. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: add memory offset to the base address of a memory regionShahar S Matityahu1-15/+11
Add the offset to the base address of a memory region to show the actual addresses being read. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: fix iwl_dump_ini_dev_mem_iter memory base addressShahar S Matityahu1-2/+2
The driver is using range->start_addr before assigning it a value. Set value into range->start_addr and then use it. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-04-03iwlwifi: dbg_ini: enforce always on domain checkingShahar S Matityahu1-0/+8
Enforce domain checking before sending host commands and collecting memory regions. Currently the driver supports always on domain only. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-03-22iwlwifi: dbg_ini: separate between ini and legacy dump flowsShahar S Matityahu1-78/+111
Separate between ini and legacy dump flows to allow adding ini triggers that are not supported in the legacy flow and to increase readabilty. iwl_fw_dbg_ini_collect function is now called with legacy trigger id and _iwl_fw_dbg_ini_collect is called with ini trigger id. Also make the actual dumping function static so that any dump collection will go through iwl_fw_dbg_collect_sync. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-03-22iwlwifi: use sync nmi in case of init flow failureShahar S Matityahu1-23/+3
In case of alive interrupt timeout or any failure in the init flow the driver generates FW nmi. The driver assumes that the nmi will generate SW interrupt. This assumption does not hold and leads to faulty behavior in the recovery flow. Solve this by using sync nmi, this way, even if the driver does not receive SW interrupt, it still starts the recovery flow. Also remove the wait queue from iwl_fwrt_stop_device since the driver is handling the SW interrupt synchronously. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-03-22iwlwifi: dbg_ini: fix bad dump size calculationShahar S Matityahu1-3/+3
The driver initiates the size value with the size of the struct and then adds the size of the data and checks if the size is zero so size can not be equal to zero. Solve this by getting the data size, check that it is not equal to zero and only then add the struct size. Signed-off-by: Shahar S Matityahu <[email protected]> Fixes: 7a14c23dcdee ("iwlwifi: dbg: dump data according to the new ini TLVs") Signed-off-by: Luca Coelho <[email protected]>
2019-03-22iwlwifi: dbg_ini: in case of region dump failure set memory to 0Shahar S Matityahu1-0/+2
In case the driver fails to dump a memory region, and this is the last region, then partial region would be extracted. Solve this by setting the data to zero in case of failure. This will cause dump to be a list of consecutive successful memory regions and trailing zeros with no partial memories extracted. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-20iwlwifi: dbg_ini: implement Rx fifos dumpShahar S Matityahu1-2/+131
Implement Rx fifos dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-20iwlwifi: dbg_ini: implement Tx fifos dumpShahar S Matityahu1-6/+183
Implement Tx fifos dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-20iwlwifi: dbg_ini: add region to fill_header handlerShahar S Matityahu1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-20iwlwifi: dbg_ini: make fill_range handler accept generic range pointerShahar S Matityahu1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-20iwlwifi: dbg_ini: make memory dump get_size handler include headersShahar S Matityahu1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-20iwlwifi: dbg_ini: add print to iwl_dump_ini_mem in case of invalid rangeShahar S Matityahu1-2/+6
Add informative print in case the range is not available. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-20iwlwifi: dbg_ini: fix infinite time ignore consecutive dumpsShahar S Matityahu1-2/+0
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 <[email protected]> Fixes: fe1b7d6c2888 ("iwlwifi: add support for triggering ini triggers") Signed-off-by: Luca Coelho <[email protected]>
2019-02-20iwlwifi: remove redundant condition from prior alive dump flowShahar S Matityahu1-16/+0
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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: dbg_ini: enable ignore consecutive trigger featureShahar S Matityahu1-2/+1
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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: properly use delay option in dump trigger flowShahar S Matityahu1-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 <[email protected]> Fixes: ea7cb8293874 ("iwlwifi: dbg: make trigger functions type agnostic") Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: align to new periphery address space for AX210 familyShaul Triebitz1-4/+8
In AX210 family, UMAC periphery address space moved from 0xA00000 to 0xD00000. Signed-off-by: Shaul Triebitz <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: dbg: temporarily skip periphery dump for AX210 devicesShaul Triebitz1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: dbg_ini: rewrite trigger flow and align to FW API changesShahar S Matityahu1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: dbg_ini: implement monitor dram memory dumpShahar S Matityahu1-12/+74
Implement monitor dram memory dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: dbg_ini: implement monitor sram memory dumpShahar S Matityahu1-6/+17
Implement monitor sram memory dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: dbg_ini: implement paging memory dumpShahar S Matityahu1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: dbg_ini: implement device internal memory dumpShahar S Matityahu1-39/+21
Implement device internal memory dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: dbg_ini: implement csr memory dumpShahar S Matityahu1-31/+25
Implement csr memory dump in the new dump mechanism. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: dbg_ini: create new dump flow and implement prph dumpShahar S Matityahu1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: dbg_ini: align struct iwl_fw_ini_region_cfg to the FWShahar S Matityahu1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: dbg_ini: remove redundant dram buffer allocationShahar S Matityahu1-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 <[email protected]> Fixes: d47902f9f71d ("iwlwifi: dbg: add apply point logic") Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: Fix pre operational dumping flowsShahar S Matityahu1-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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>