aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/iwl-io.c
AgeCommit message (Collapse)AuthorFilesLines
2023-06-14wifi: iwlwifi: unify checks for HW error valuesJohannes Berg1-1/+3
The hardware, depending on which part fails or times out, returns 0xA5A5A5A. or 0x5A5A5A5. with the lowest 4 bits encoding some further reason/status. However, mostly we don't really need to care about the exact reasons, so unify the checks for this to avoid hardcoding those magic values all over the driver. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20230612184434.3e2959741a38.I1c297a53787b87e4e2b8f296c041921338573f4d@changeid Signed-off-by: Johannes Berg <[email protected]>
2022-02-18iwlwifi: make some functions friendly to sparseJohannes Berg1-8/+10
Somehow, sparse cannot track the cond_lock() here properly, but if we return directly from the inner basic block then it doesn't complain. Refactor the code a bit to make it not complain. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20220130115024.3f9de2d59929.Ib6324e93951ee877754538c89f3ab2a84998bd40@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-12-21iwlwifi: fix Bz NMI behaviourJohannes Berg1-1/+1
Contrary to what was stated before, the hardware hasn't changed the bits here yet. In any case, the new CSR is also directly (lower 16 bits) connected to UREG_DOORBELL_TO_ISR6, so if it still changes the changes would be there. Adjust the code and comments accordingly. Signed-off-by: Johannes Berg <[email protected]> Fixes: 6c0795f1a524 ("iwlwifi: implement Bz NMI behaviour") Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20211210090244.75b6207536e3.I7d170a48a9096e6b7269c3a9f447c326f929b171@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-10-28iwlwifi: dump host monitor data when NIC doesn't initJohannes Berg1-1/+45
If the NIC cannot be initialized, dump host monitor data so we can analyze properly why it didn't initialize. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20211024165252.21c90ba4fa5f.I2a30f62aa4685dc7623d3c69838909833c3f435c@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-10-22iwlwifi: remove redundant iwl_finish_nic_init() argumentJohannes Berg1-2/+2
We don't need this argument, since in all cases where the function is called, trans->trans_cfg is already set (it's in fact set during allocation). Remove it to avoid any confusion about it. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20211017162352.cb04580b8521.I7129d4ba3dc689af839761d5807a10f99718893e@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-08-26iwlwifi: implement Bz NMI behaviourJohannes Berg1-1/+4
The method to NMI the firmware also changed in Bz devices, implement the new logic. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20210802215208.c9bd2034dc05.I983c25caa09c3776c7640fff73fe739362ecc5b6@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-08-26iwlwifi: pcie: implement Bz device startupJohannes Berg1-5/+12
Device startup changed in Bz, some register bits moved around. Change the code accordingly. The new Bz hardware changes also the way we wake it (grab NIC access) and the way we disable bus mastering, update the driver code accordingly. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20210802215208.00a137364a95.I059a2abac948965458862941ee7db6a2e1076fa6@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-08-26iwlwifi: prepare for synchronous error dumpsJohannes Berg1-2/+2
In some cases it may be necessary to synchronously create a firmware error report, add the necessary infrastructure for this. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20210802170640.481b6642f0fc.I7c9c958408a285e3d19aceed2a5a3341cfc08382@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-02-10iwlwifi: remove flags argument for nic_accessJohannes Berg1-29/+17
Since we no longer save interrupts, we no longer need the flags argument here, remove it throughout. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20210210142629.8de8fe6f9fff.If040b056d0e8c771c65ac5c29230f939354a142b@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-02-08Merge tag 'iwlwifi-next-for-kalle-2021-02-05' of ↵Kalle Valo1-0/+36
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next iwlwifi patches intended for v5.12 * Check FW notification sizes for robustness; * Improvements in the NAPI implementation; * Implement a workaround for CCA-EXT; * Add new FW API support; * Fix a CSA bug; * Implement PHY integration version parsing; * A bit of refactoring; * One more CSA bug fix, this time in the AP side; * Support for new So devices and a bit of reorg; * Per Platform Antenna Gain (PPAG) fixes and improvements; * Improvements in the debug framework; * Some other clean-ups and small fixes. # gpg: Signature made Fri 05 Feb 2021 12:04:21 PM EET using RSA key ID 1A3CC5FA # gpg: Good signature from "Luciano Roth Coelho (Luca) <[email protected]>" # gpg: aka "Luciano Roth Coelho (Intel) <[email protected]>"
2021-02-05iwl-trans: iwlwifi: move sync NMI logic to transMordechay Goodstein1-0/+36
The code is not directly related to PCIe transport, and it will help moving sync/async commands logic out of PCIe in the next patches. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20210117130510.271f59887fd1.I8ff41236f4e11a25df83d76c982a2a30ba2b9903@changeid Signed-off-by: Luca Coelho <[email protected]>
2021-01-25iwlwifi: fix the NMI flow for old devicesEmmanuel Grumbach1-4/+5
I noticed that the flow that triggers an NMI on the firmware for old devices (tested on 7265) doesn't work. Apparently, the firmware / device is still in low power when we write the register that triggers the NMI. We call the "grab_nic_access" function to make sure the device is awake but that wasn't enough. I played with this and noticed that if we wait 1 ms after the device reports it is awake before we write to the NMI register, the device always sees our write and the firmware gets properly asserted. Triggering an NMI to the firmware can be done with the debugfs hook: echo 1 > /sys/kernel/debug/iwlwifi/0000\:00\:03.0/iwlmvm/fw_nmi What happened before is that the firmware would just stall without running its NMI routine. Because of that the driver wouldn't get the "firmware crashed" interrupt. After a while the driver would notice that the firmware is not responding to some command and it would read the error data from the firmware, but this data is populated in the NMI service routine in the firmware which was not called. So in the logs it looked like: iwlwifi 0000:00:03.0: Error sending REPLY_ERROR: time out after 2000ms. iwlwifi 0000:00:03.0: Current CMD queue read_ptr 33 write_ptr 34 iwlwifi 0000:00:03.0: Loaded firmware version: 29.09bd31e1.0 7265D-29.ucode iwlwifi 0000:00:03.0: 0x00000000 | ADVANCED_SYSASSERT iwlwifi 0000:00:03.0: 0x00000000 | trm_hw_status0 iwlwifi 0000:00:03.0: 0x00000000 | trm_hw_status1 iwlwifi 0000:00:03.0: 0x00000000 | branchlink2 iwlwifi 0000:00:03.0: 0x00000000 | interruptlink1 iwlwifi 0000:00:03.0: 0x00000000 | interruptlink2 iwlwifi 0000:00:03.0: 0x00000000 | data1 iwlwifi 0000:00:03.0: 0x00000000 | data2 iwlwifi 0000:00:03.0: 0x00000000 | data3 iwlwifi 0000:00:03.0: 0x00000000 | beacon time iwlwifi 0000:00:03.0: 0x00000000 | tsf low ... With this fix, immediately after we trigger the NMI to the firmware, we get the expected: iwlwifi 0000:00:03.0: Microcode SW error detected. Restarting 0x2000000. iwlwifi 0000:00:03.0: Start IWL Error Log Dump: iwlwifi 0000:00:03.0: Status: 0x00000040, count: 6 iwlwifi 0000:00:03.0: Loaded firmware version: 29.09bd31e1.0 7265D-29.ucode iwlwifi 0000:00:03.0: 0x00000084 | NMI_INTERRUPT_UNKNOWN iwlwifi 0000:00:03.0: 0x000002F1 | trm_hw_status0 iwlwifi 0000:00:03.0: 0x00000000 | trm_hw_status1 iwlwifi 0000:00:03.0: 0x00043D6C | branchlink2 iwlwifi 0000:00:03.0: 0x0004AFD6 | interruptlink1 iwlwifi 0000:00:03.0: 0x000008C4 | interruptlink2 iwlwifi 0000:00:03.0: 0x00000000 | data1 iwlwifi 0000:00:03.0: 0x00000080 | data2 iwlwifi 0000:00:03.0: 0x07030000 | data3 iwlwifi 0000:00:03.0: 0x003FD4C3 | beacon time iwlwifi 0000:00:03.0: 0x00C22AC3 | tsf low iwlwifi 0000:00:03.0: 0x00000000 | tsf hi iwlwifi 0000:00:03.0: 0x00000000 | time gp1 iwlwifi 0000:00:03.0: 0x00C22AC3 | time gp2 iwlwifi 0000:00:03.0: 0x00000001 | uCode revision type iwlwifi 0000:00:03.0: 0x0000001D | uCode version major Notice the first line: "Microcode SW error detected:" which is printed in the driver's ISR, which means that the driver actually got an interrupt from the firmware saying that it crashed. And then we have the properly populated error data. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20210115130252.70e67cc75d88.I6615cad4361862e7f3c9f2d3cafb6a8c61e16781@changeid
2020-12-10iwlwifi: use SPDX tagsJohannes Berg1-61/+5
Use SPDX tags instead of the long copyright notices. Also cleanup some duplicate copyright notices and combine the years where possible. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20201210000603.481bcb512a6f.I8146abe5a637079e7336209f23cb26af98b12b31@changeid Signed-off-by: Luca Coelho <[email protected]>
2020-12-10iwlwifi: mvm: fix 22000 series driver NMIJohannes Berg1-1/+1
For triggering an NMI in the firmware, we should only set BIT(24) in the corresponding register, not the entire mask that's usable by the driver. This currently doesn't matter because the firmware only enables BIT(24), but we'll start using BIT(25) for other purposes with an upcoming API change. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20201209231352.2f982365d085.Id09daabfd331ba9e120abcbbedd2ad6448902ed0@changeid Signed-off-by: Luca Coelho <[email protected]>
2019-12-23iwlwifi: remove CSR registers abstractionLuca Coelho1-34/+3
We needed this abstraction for some CSR registers for IWL_DEVICE_22560, but that has been removed, so we don't need the abstraction anymore. Remove it. Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: add a pointer to the trans_cfg directly in transLuca Coelho1-3/+3
Add a pointer to the iwl_trans structure and point it to the trans part of the cfg. This is the first step in disassociating the trans configuration from the rest of the configuration. Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: separate elements from cfg that are needed by trans_allocLuca Coelho1-10/+11
In order to be able to select the cfg depending on the HW revision or on the RF ID, we need to set up the trans before selecting the cfg. To do so, move the elements from cfg that are needed by iwl_trans_alloc() to a separate struct at the top of the cfg, so it can be used by other cfg types as well, before selecting the rest of the configuration. Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: add force NMI for AX210 devicesShaul Triebitz1-1/+4
For AX210 devices, the periphry for forcing NMI has changed. Signed-off-by: Shaul Triebitz <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-14iwlwifi: align to new periphery address space for AX210 familyShaul Triebitz1-4/+4
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-04iwlwifi: implement BISR HW workaround for 22260 devicesJohannes Berg1-0/+10
There's a small hardware bug in 22260 devices which thus require a few more delays during initialization. Implement this workaround. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: refactor NIC init sequenceJohannes Berg1-0/+30
The typical sequence of setting INIT_DONE and then waiting for clock stabilisation is going to need a new workarounds, so first of all refactor it. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-02-04iwlwifi: move config structs to C fileJohannes Berg1-0/+32
Even if they're static const, there's no need to duplicate the structs every time they're included and used. Move them to an appropriate C file instead. Also remove useless parentheses along the way. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-01-29iwlwifi: pcie: align licensing to dual GPL/BSDJohannes Berg1-3/+38
These files have a long history of code changes, but analysing the remaining code leads to having only a few changes that are not already owned by Intel, notably from - Andy Lutomirski <[email protected]> - Joonwoo Park <[email protected]> - Kirtika Ruchandani <[email protected]> - Rajat Jain <[email protected]> - Stanislaw Gruszka <[email protected]> remaining in the code today. Note that - I myself was working for Intel and for any possibly code that might be before my employment there give permission - Wizery employees were working for Intel More specifically, we identified the following commits that (partially may) remain today: 25c03d8e8c13 Joonwoo Park <[email protected]> ("iwlwifi: do not schedule tasklet when rcv unused irq") f36d04abe684 Stanislaw Gruszka <[email protected]> ("iwlwifi: use dma_alloc_coherent") 387f3381f732 Stanislaw Gruszka <[email protected]> ("iwlwifi: fix dma mappings and skbs leak") 2624e96ce16b Stanislaw Gruszka <[email protected]> ("iwlwifi: fix possible data overwrite in hcmd callback") bfe4b80e9f73 Stanislaw Gruszka <[email protected]> ("iwlwifi: always check if got h/w access before write") d536c32b45d2 Andy Lutomirski <[email protected]> ("iwlwifi: pcie: log when waking the NIC for hcmd submission fails") a6d24fad00d9 Rajat Jain <[email protected]> ("iwlwifi: pcie: dump registers when HW becomes inaccessible") fb12777ab59b Kirtika Ruchandani <[email protected]> ("iwlwifi: Add more call-sites for pcie reg dumper") 3a73a30049f2 Stanislaw Gruszka <[email protected]> ("iwlwifi: cleanup/fix memory barriers") aa5affbacb24 Stanislaw Gruszka <[email protected]> ("iwlwifi: dump stack when fail to gain access to the device") Align the licenses with their permission to clean up and to make it all identical. CC: Joonwoo Park <[email protected]> CC: Stanislaw Gruszka <[email protected]> CC: Andy Lutomirski <[email protected]> CC: Rajat Jain <[email protected]> CC: Kirtika Ruchandani <[email protected]> Acked-by: Johannes Berg <[email protected]> Acked-by: Kirtika Ruchandani <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Joonwoo Park <[email protected]> Acked-by: Rajat Jain <[email protected]> Acked-by: Andy Lutomirski <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2018-08-31iwlwifi: remove all occurrences of the FSF address paragraphLuca Coelho1-4/+0
The Free Software Foundation address is superfluous and causes checkpatch to issue a warning when present. Remove all paragraphs with FSF's address to prevent that. Signed-off-by: Luca Coelho <[email protected]>
2017-08-09iwlwifi: fix nmi triggering from hostGolan Ben-Ami1-11/+3
Although nmi was triggered fine till now, it appears that the driver didn't write the exact correct values to the correct addresses for each HW. Fix the nmi triggering by setting the correct addresses and values. Fixes: 4c9706dc2f29 ("iwlwifi: update nmi register") Signed-off-by: Golan Ben-Ami <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-05iwlwifi: add 9000 and A000 device familiesSara Sharon1-2/+2
Add two new device families to differentiate them from 8000. Signed-off-by: Sara Sharon <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-04-25iwlwifi: gen2: support nmi triggering from hostLiad Kaufman1-0/+3
For gen2 there is a new register. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-04-11iwlwifi: use upper_32_bits/lower_32_bits where appropriateJohannes Berg1-2/+2
That's a bit nicer than open-coding it. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2016-09-15iwlwifi: fix semicolon.cocci warningskbuild test robot1-1/+1
drivers/net/wireless/intel/iwlwifi/iwl-io.c:243:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Sara Sharon <[email protected]> Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2016-07-06iwlwifi: centralize 64 bit HW registers writeSara Sharon1-0/+27
Move the write_prph_64 of pcie to be transport agnostic. Add direct write as well, as it is needed for a000 HW. Signed-off-by: Sara Sharon <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2016-07-06iwlwifi: add dump of RFHSara Sharon1-2/+113
Add support of dumping new RFH instead of FH registers. Signed-off-by: Sara Sharon <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2015-12-21iwlwifi: remove unused parameter from grab_nic_accessEmmanuel Grumbach1-7/+7
All the callers used silent = false. Signed-off-by: Emmanuel Grumbach <[email protected]>
2015-12-20iwlwifi: change the Intel Wireless email addressEmmanuel Grumbach1-1/+1
[email protected] is not available anymore. [email protected] should be used instead. Signed-off-by: Emmanuel Grumbach <[email protected]>
2015-11-26iwlwifi: export the _no_grab version of PRPH IO functionsGolan Ben-Ami1-10/+15
Expose _no_grab prph i/o functions that allow performing i/o outside the transport, without requiring grab and release NIC access for each operation. In addition, rename the functions so they reflect their non-grabbing behavior. This can be very useful for consecutive prph i/o operation that occur outside trans, such as fw dumps. Signed-off-by: Golan Ben-Ami <[email protected]> Signed-off-by: Emmanuel Grumbach <[email protected]>
2015-11-18iwlwifi: move under intel vendor directoryKalle Valo1-0/+289
Part of reorganising wireless drivers directory and Kconfig. Signed-off-by: Kalle Valo <[email protected]>