aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
AgeCommit message (Collapse)AuthorFilesLines
2019-09-06iwlwifi: dbg_ini: use linked list for dump TLVs during dump creationShahar S Matityahu1-158/+130
Avoid iterating over dump TLVs twice for size calculation by using linked list to store the dump TLVs. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg_ini: separate cfg and dump flows to different modulesShahar S Matityahu1-429/+0
separate configuration flows and dump collection flows. make ini configuration flows be in iwl-dbg-tlv.c and dump related flows in dbg.c to better reflect their logical difference. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg: align wrt log prints to the same formatShahar S Matityahu1-46/+41
Align wrt log prints to the driver coding style Remove the ext field from the log and print it at the beginning of the apply point. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg_ini: remove debug flow TLVShahar S Matityahu1-2/+0
Debug flow TLV was removed from the FW. Remove the TLV from the driver as well. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg_ini: verify debug TLVs at allocation phaseShahar S Matityahu1-5/+10
Reimplement debug TLV allocation flow. The driver will check the validity of the debug TLVs prior allocating space for them. Any malformed or unsupported TLV will be skipped. The TLV specific checks will be added in later patches. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg_ini: use function to check if ini dbg mode is onShahar S Matityahu1-2/+2
use iwl_trans_dbg_ini_valid function instead of a boolean value check if dbg_ini mode is on. It is needed for a future patch. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: stop passing bogus gfp flags arguments to dma_alloc_coherentChristoph Hellwig1-2/+1
dma_alloc_coherent is not just the page allocator. The only valid arguments to pass are either GFP_ATOMIC or GFP_ATOMIC with possible modifiers of __GFP_NORETRY or __GFP_NOWARN. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg_ini: remove periphery phy and aux regions handlingShahar S Matityahu1-2/+2
periphery phy and aux regions should not be collected like periphery mac region. Remove their handling. The handling will be added in the future once the FW will support it. 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-09-06iwlwifi: dbg_ini: use linked list to store debug TLVsShahar S Matityahu1-7/+8
Use a linked list to maintain the debug TLVs instead of a single buffer. This way, the driver does not need to iterate over the binary file twice and allocates smaller chunks of memory. Also, in case one allocation fails the driver will work with the partial configuration instead of aborting the entire debug configuration. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg_ini: maintain buffer allocations from trans instead of TLVs bufferShahar S Matityahu1-15/+16
Maintain DRAM debug buffer status in trans instead of keeping it as part of the TLVs buffer to avoid allocating extra space for it. Needed for future changes. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg: add debug periphery registers to 9000 device familyShahar S Matityahu1-0/+3
Add debug HW periphery registers to 9000 device family. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg: support debug recording suspend resume commandShahar S Matityahu1-46/+53
Support the new DBGC_SUSPEND_RESUME command to change the recording state. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg: move debug recording stop from trans to op modeShahar S Matityahu1-3/+3
The op mode should stop the debug recording and not the transport layer. Rename iwl_fwrt_stop_device into iwl_fw_dbg_stop_sync and move the debug stop recording to it. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: dbg: move monitor recording functionality from header fileShahar S Matityahu1-0/+85
The recording functions are quite big to be inline and the driver should expose only the stop and restart functions that are allowed to be used rather then the internal helper functions. Move the functions from the header file. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-08-01iwlwifi: dbg_ini: fix compile time assert build errorsMauro Rossi1-10/+12
This patch fixes and preserves existing code style, and readability, for IWL_ERR() and IWL_WARN() macros invocations recently added in dbg.c Fixes the following build errors with Android build system: /home/utente/pie-x86_kernel/kernel/drivers/net/wireless/intel/iwlwifi/fw/dbg.c: In function '_iwl_fw_dbg_apply_point': /home/utente/pie-x86_kernel/kernel/drivers/net/wireless/intel/iwlwifi/fw/dbg.c:2445:3: error: call to '__compiletime_assert_2446' declared with attribute error: BUILD_BUG_ON failed: err_str[sizeof(err_str) - 2] != '\n' /home/utente/pie-x86_kernel/kernel/drivers/net/wireless/intel/iwlwifi/fw/dbg.c:2451:3: error: call to '__compiletime_assert_2452' declared with attribute error: BUILD_BUG_ON failed: err_str[sizeof(err_str) - 2] != '\n' ... /home/utente/pie-x86_kernel/kernel/drivers/net/wireless/intel/iwlwifi/fw/dbg.c:2789:5: error: call to '__compiletime_assert_2790' declared with attribute error: BUILD_BUG_ON failed: invalid_ap_str[sizeof(invalid_ap_str) - 2] != '\n' /home/utente/pie-x86_kernel/kernel/drivers/net/wireless/intel/iwlwifi/fw/dbg.c:2800:5: error: call to '__compiletime_assert_2801' declared with attribute error: BUILD_BUG_ON failed: invalid_ap_str[sizeof(invalid_ap_str) - 2] != '\n' Fixes: 427ab6385cf3 ("iwlwifi: dbg_ini: enforce apply point early on buffer allocation tlv") Fixes: 57d88b116175 ("iwlwifi: dbg_ini: support debug info TLV") Signed-off-by: Mauro Rossi <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2019-06-29iwlwifi: dbg: debug recording stop and restart command removeShahar S Matityahu1-1/+1
The 0xF6 command used to start and stop the recording from 22560 devices was removed. This is causing an assert when the driver tries to alter the recording state. Remove the use of the command. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: fix debug monitor stop and restart in ini modeShahar S Matityahu1-5/+14
In ini debug mode the recording does not restart unless legacy monitor configuration is also given. Add dbg_ini_dest field to trans to indicate the debug monitor destination to solve this. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg: move trans debug fields to a separate structShahar S Matityahu1-21/+23
Unite iwl_trans debug related fields under iwl_trans_debug struct to increase readability and keep iwl_trans clean. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: remove redundant checking of ini modeShahar S Matityahu1-4/+1
There are several flows where the driver checks if it runs in ini mode. Some of these flows are no longer used in ini mode or there is another condition that check the ini mode in the same flow. Either way, those conditions are redundant. Remove the redundant conditions. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: enforce apply point early on buffer allocation tlvShahar S Matityahu1-13/+15
Apply buffer allocation TLV only if it is set to apply point IWL_FW_INI_APPLY_EARLY. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg: fix debug monitor stop and restart delaysShahar S Matityahu1-2/+0
The driver should delay only in recording stop flow between writing to DBGC_IN_SAMPLE register and DBGC_OUT_CTRL register. Any other delay is not needed. Change the following: 1. Remove any unnecessary delays in the flow 2. Increase the delay in the stop recording flow since 100 micro is not enough 3. Use usleep_range instead of delay since the driver is allowed to sleep in this flow. Signed-off-by: Shahar S Matityahu <[email protected]> Fixes: 5cfe79c8d92a ("iwlwifi: fw: stop and start debugging using host command") Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: implement dump info collectionShahar S Matityahu1-0/+67
The info struct contains data about the FW, HW, RF and the debug configuration. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: support debug info TLVShahar S Matityahu1-9/+56
Add support to debug info TLV. The TLV contains human readable naming of the FW image and the debug configuration. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: use different barker for ini dumpShahar S Matityahu1-2/+2
Use a different barker for ini dump to allow differentiation from legacy dump. Also it allows to remove INI_BIT from dump TLVs. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: add consecutive trigger firing supportShahar S Matityahu1-28/+48
When a dump trigger is fired, the driver sets IWL_FWRT_STATUS_DUMPING and aborts any consecutive dump collection. To allow consecutive triggers firing, use 5 dump workers and allocate them upon incoming dump collection requests. This functionality is needed since in ini debug mode each trigger may have entirely different memory regions to collect unlike the legacy mode in which all the triggers dump the same memory regions. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: abort region collection in case the size is 0Shahar S Matityahu1-20/+33
Allows to abort region collection in case the region size is 0. It is needed for future regions that their size might be 0. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg_ini: dump headers cleanupShahar S Matityahu1-33/+24
Unite dump memory ranges under a single struct and add a specific header for each type of memory. Also, maintain a single version to all dump structures. This cleanup is also needed for the future addition of FW notification regions and others. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-29iwlwifi: dbg: allow dump collection in case of an early errorShahar S Matityahu1-2/+5
Improve the robustness of the dump collection flow in case of an early error: 1. in iwl_trans_pcie_sync_nmi, disable and enable interrupts only if they were already enabled 2. attempt to initiate dump collection in iwl_fw_dbg_error_collect only if the device is enabled 3. check Tx command queue was already allocated before trying to collect it Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-06-01iwlwifi: print fseq info upon fw assertShahar S Matityahu1-0/+39
Read fseq info from FW registers and print it upon fw assert. The print is needed since the fseq version coming from the TLV might not be the actual version that is used. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
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]>