summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.gitKalle Valo2017-10-1621-111/+218
| |\ \ | | | | | | | | | | | | | | | | Mark Brown reported that there are conflicts in iwlwifi between the two trees so fix those now.
| * | | iwlwifi: remove dflt_pwr_limit from the transportLuca Coelho2017-10-063-13/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default power limit read from the SPLC method in ACPI doesn't have anything to do with the transport and is only used in the opmode, so we can remove it from the trans. Additionally, this value is only user when the opmode is starting, so we don't need to store it anywhere. Remove the dflt_pwr_limit element from the trans and move call to iwl_acpi_get_pwr_limit() call to mvm. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: mvm: warn on invalid statistics sizeJohannes Berg2017-10-061-4/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Getting the wrong statistics size is a problem, having a warning will help us catch it quicker during firmware/driver development. In released firmware/driver versions, we obviously make sure this won't happen. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: move code that reads SPLC to acpiLuca Coelho2017-10-063-23/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move most of the set_dflt_pwr_limit() function to acpi.c and make it return the pwr_limit value instead of setting directly. Also rename it to iwl_acpi_get_pwr_limit(). Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: fix indentation in a000 family configurationJohannes Berg2017-10-061-50/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the double indentation in the configuration structs for a000 family devices. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: move function to get mcc into acpi codeLuca Coelho2017-10-066-46/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The iwl_get_bios_mcc() function was in the iwl-nvm-parse.c file, but it has nothing to do with the NVM. Move it to fw/acpi.c and rename it to iwl_acpi_get_mcc(). Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: remove a couple of unnecessary ifdefsLuca Coelho2017-10-062-8/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the #ifdef CONFIG_ACPI are not needed anymore, so they can be removed. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: make iwl_get_bios_mcc() use the common acpi functionsLuca Coelho2017-10-063-54/+20Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way iwl_get_bios_mcc() gets the WiFi package and checks for its integrity is almost identical to the new iwl_acpi_get_wifi_pkg() function. Instead of having duplicate code, convert it to use the common code. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: use iwl_acpi_get_wifi_pkg when reading reading SPLCLuca Coelho2017-10-062-51/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of finding the wifi package with its own code, we can reuse the new iwl_acpi_get_wifi_pkg() function when reading the default power limit from SPLC. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: generalize iwl_mvm_sar_find_wifi_pkg()Luca Coelho2017-10-063-54/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move this function to acpi.c, renaming it to iwl_acpi_get_wifi_pkg(), because it can also be used with other methods (i.e. SPLC and WRDD). Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: move ACPI-related definitions to acpi.hLuca Coelho2017-10-064-32/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ACPI table size definitions were spread around the different files that used them. Move them all to a common place. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: move ACPI method definitions to acpi.hLuca Coelho2017-10-064-21/+18Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of defining each method where they are used and re-defining WIFI_DOMAIN in each one of them, move all the definitions to a central place and define the domain only a single time. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: acpi: add common code to read from ACPILuca Coelho2017-10-067-141/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are many places where the same process of invoking a method from ACPI is used, causing a lot of duplicate code. To improve this, introduce a new function to get an ACPI object by invoking an ACPI method that can be reused. Additionally, since this function needs to be called when we only have the trans, the opmode or the device, introduce a new debug macro that gets the device as a parameter so it can be used in the new function. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: mvm: change warning to warn_once()Sara Sharon2017-10-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case there is a FW bug where the BAID value in the metadata is not properly initialized we hit the warning for every RX packet. Change it to warn once and add elaborate message. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: pcie: dump registers when HW becomes inaccessibleRajat Jain2017-10-062-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We conclude the HW became inaccessible when we timeout waiting for a bit to be set in a memory mapped register (CSR_GP_CNTRL). This conclusion may not be true because the bit may not get set due to: - a firmware issue - a driver issue - a PCI bus issue - a platform issue There are a lot of such reports with really no good debug information beyond this message to help us. Add some debug information and attempt to dump the different register spaces at such a failure: * Dump some configuration space of device - this will tell us if something very basic is broken in the PCIe bus (so that configuration accesses are failing). If this works, the PCIe bus seems OK. If this does not work, it is definitely an PCIe issue. * Dump some memory mapped registers - if we're reading some sane'ish values, this will tell us that the PCIe bus is OK, but may be a firmware / driver issue. If this does not work, it may be a PCI configuration issue or a driver/firmware issue. * Dump parent and device's AER registers, will give us some straws to chew on. This is the sample output: [ 13.082651] ------------[ cut here ]------------ [ 13.086791] iwlwifi 0000:01:00.0: iwlwifi transaction failed, dumping registers [ 13.086793] iwlwifi 0000:01:00.0: iwlwifi device config registers: [ 13.086893] iwlwifi 0000:01:00.0: 00000000: 095a8086 00100406 02800059 00000000 00000004 00000000 00000000 00000000 [ 13.086895] iwlwifi 0000:01:00.0: 00000020: 00000000 00000000 00000000 50108086 00000000 000000c8 00000000 00000100 [ 13.086901] iwlwifi 0000:01:00.0: iwlwifi device memory mapped registers: [ 13.086989] iwlwifi 0000:01:00.0: 00000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff [ 13.086991] iwlwifi 0000:01:00.0: 00000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff [ 13.086999] iwlwifi 0000:01:00.0: iwlwifi device AER capability structure: [ 13.087033] iwlwifi 0000:01:00.0: 00000000: 14010001 00100000 00000000 00462031 00002000 00002000 00000014 40000001 [ 13.087034] iwlwifi 0000:01:00.0: 00000020: 0000000f d140000c 00000000 [ 13.087036] iwlwifi 0000:01:00.0: iwlwifi parent port (0000:00:1c.0) config registers: [ 13.087074] iwlwifi 0000:00:1c.0: 00000000: 9d108086 00100506 060400f1 00810010 00000000 00000000 00010100 200000f0 [ 13.087075] iwlwifi 0000:00:1c.0: 00000020: d140d140 0001fff1 00000000 00000000 00000000 00000040 00000000 0006010b [ 13.087087] ------------[ cut here ]------------ [ 13.087095] WARNING: CPU: 0 PID: 1759 at drivers/net/wireless/iwl7000/iwlwifi/pcie/trans.c:2082 iwl_trans_pcie_reclaim+0x1ee4/0x2b9a [iwlwifi]() [ 13.087096] Timeout waiting for hardware access (CSR_GP_CNTRL 0xffffffff) Signed-off-by: Rajat Jain <rajatja@google.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: fix minor code style issuesChristoph Böhmwalder2017-10-061-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes three trivial issues as reported by checkpatch.pl, namely two switch/case indentation issues and one alignment issue in a multiline comment. Signed-off-by: Christoph Böhmwalder <christoph@boehmwalder.at> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: mvm: add marker cmd response struct.Mordechay Goodstein2017-10-062-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps for documentation and clarifies the code by defining the exact response struct for the marker command. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: fw: api: remove excess enum value documentationJohannes Berg2017-10-061-4/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These enum values don't exist, so remove their documentation as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: mvm: don't send identical PHY_CTXT_CMDEmmanuel Grumbach2017-10-063-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we have an AP which supports HT and a single HT station is connected, we change the min_width from NL80211_CHAN_WIDTH_20_NOHT to NL80211_CHAN_WIDTH_20. This of course has no implication on the channel width but still sends a command to the firmware. Remember the last width that was sent and refrain from sending unnecessary commands to the firmware. Sending a PHY_CTXT_CMD to the firmware has a cost since it recalculates the presence on the medium and because of that it closes the transmit queues for a short while. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: remove redundant reading from NVM fileChaya Rachel Ivgi2017-10-061-7/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver reads xtal_calib from NVM file, but actually never uses it. This is only used in dvm driver. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: pcie: dynamic Tx command queue sizeShahar S Matityahu2017-10-066-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devices in the A000 family can use a different size for the command queue. To allow this, make the command queue size configurable and set the size for A000 devices to 32. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: Add few debug prints to the WRT dump flowIlan Peer2017-10-061-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would enable to better catch timing issues with cases that WRT dump takes too much time. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: mvm: support firmware debug trigger on frame reorder timeoutEmmanuel Grumbach2017-10-065-26/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The trigger that collects data when a frame is released because of the timer of the reordering buffer was not implemented for 9000 devices. Fix this. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: mvm: remove support for Link Quality MeasurementsEmmanuel Grumbach2017-10-066-238/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was never used by any product. Remove it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: mvm: Add new quota command APIDavid Spinadel2017-10-065-33/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New quota command adds a field indicating low latency direction per quota. A TLV API bit was added to indicate the new API. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: add a new a000 deviceOren Givon2017-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new a000 device with PCI ID (0x2720, 0x0030). Signed-off-by: Oren Givon <oren.givon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: fix wrong struct for a000 deviceOren Givon2017-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PCI ID (0x2720, 0x0070) was set with the config struct iwla000_2ax_cfg_hr instead of iwla000_2ac_cfg_hr_cdb. Fixes: 175b87c69253 ("iwlwifi: add the new a000_2ax series") Signed-off-by: Oren Givon <oren.givon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: trans: move ref/unref code to the common part of the transportLuca Coelho2017-10-062-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | De-inline iwl_trans_ref/unref and move it to common transport code in preparation for more common code to come to these functions. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlwifi: mvm: add dbgfs entry for fw infoLiad Kaufman2017-10-061-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a dbgfs entry for an easy way during runtime to check what FW file was loaded, and get some general FW-related data. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * | | iwlegacy: make const array static to shink object code sizeColin Ian King2017-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't populate const array ac_to_fifo on the stack in an inlined function, instead make it static. Makes the object code smaller by over 800 bytes: text data bss dec hex filename 159029 33154 1216 193399 2f377 4965-mac.o text data bss dec hex filename 158122 33250 1216 192588 2f04c 4965-mac.o (gcc version 7.2.0 x86_64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | | | Merge branch 'linus' into locking/core, to resolve conflictsIngo Molnar2017-11-075-0/+5
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: include/linux/compiler-clang.h include/linux/compiler-gcc.h include/linux/compiler-intel.h include/uapi/linux/stddef.h Signed-off-by: Ingo Molnar <mingo@kernel.org>
| * | | License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman2017-11-025-0/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* / | locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns ↵Mark Rutland2017-10-254-9/+9
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to READ_ONCE()/WRITE_ONCE() Please do not apply this to mainline directly, instead please re-run the coccinelle script shown below and apply its output. For several reasons, it is desirable to use {READ,WRITE}_ONCE() in preference to ACCESS_ONCE(), and new code is expected to use one of the former. So far, there's been no reason to change most existing uses of ACCESS_ONCE(), as these aren't harmful, and changing them results in churn. However, for some features, the read/write distinction is critical to correct operation. To distinguish these cases, separate read/write accessors must be used. This patch migrates (most) remaining ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following coccinelle script: ---- // Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and // WRITE_ONCE() // $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch virtual patch @ depends on patch @ expression E1, E2; @@ - ACCESS_ONCE(E1) = E2 + WRITE_ONCE(E1, E2) @ depends on patch @ expression E; @@ - ACCESS_ONCE(E) + READ_ONCE(E) ---- Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: davem@davemloft.net Cc: linux-arch@vger.kernel.org Cc: mpe@ellerman.id.au Cc: shuah@kernel.org Cc: snitzer@redhat.com Cc: thor.thayer@linux.intel.com Cc: tj@kernel.org Cc: viro@zeniv.linux.org.uk Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
* | iwlwifi: nvm: set the correct offsets to 3168 seriesChaya Rachel Ivgi2017-10-069-28/+59
| | | | | | | | | | | | | | | | | | | | | | | | The driver currently handles two NVM formats, one for 7000 family and below, and one for 8000 family and above. The 3168 series uses something in between, so currently the driver uses incorrect offsets for it. Fix the incorrect offsets. Fixes: c4836b056d83 ("iwlwifi: Add PCI IDs for the new 3168 series") Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: nvm-parse: unify channel flags printingJohannes Berg2017-10-061-59/+39Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current channel flags printing is very strange and messy, in LAR we sometimes print the channel number and sometimes the frequency, in both we print a calculated value (whether ad-hoc is supported or not) etc. Unify all this to * print the channel number, not the frequency * remove the band print (2.4/5.2 GHz, it's obvious) * remove the calculated Ad-Hoc print Doing all of this also gets the length of the string to a max of 101 characters, which is below the max of 110 for tracing, and thus avoids the warning that came up on certain channels with certain flag combinations. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: return -ENODATA when reading the temperature with the FW downLuca Coelho2017-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It seems that libsensors treats -EIO as a special non-recoverable failure when it tries to read the temperature while the firmware is not running. To solve that, change the error code to a milder -ENODATA. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=196941 Fixes: c221daf219b1 ("iwlwifi: mvm: add registration to thermal zone") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: stop dbgc recording before stopping DMAGolan Ben Ami2017-10-062-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | Today we stop the device and the DMA without stopping the dbgc recording before. This causes host crashes when the DMA rate is high. Stop dbgc recording when clearing the fw debug configuration to fix this. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: do not print security error in monitor modeShaul Triebitz2017-10-064-2/+16
| | | | | | | | | | | | | | | | | | | | | | In monitor mode we are not expected to decrypt encrypted packets (not having the keys). Hence we are expected to get an unknown rx security status. Keeping the print in monitor mode causes a print for each captured packet flooding the dmesg. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: fix reorder buffer for 9000 devicesSara Sharon2017-09-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The condition to check if reorder buffer ran out of space is faulty, as it takes into account only the NSSN. In case the head SN was too far behind the reorder buffer should move forward, regardless of the NSSN status. This caused the driver to release packets out of order in some scenarios. Fixes: b915c10174fb ("iwlwifi: mvm: add reorder buffer per queue") Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: set status before calling iwl_mvm_send_cmd_status()Luca Coelho2017-09-082-1/+2
| | | | | | | | | | | | | | | | We always must set the status to what we consider success before calling iwl_mvm_send_cmd_status() (also iwl_mvm_send_cmd_pdu_status() which calls it). Fix a few places where initialization is missing. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: initialize status in iwl_mvm_add_int_sta_common()Luca Coelho2017-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We always need to initialize the status argument to the success case before calling iwl_mvm_send_cmd_status() or iwl_mvm_send_cmd_pdu_status() (which calls the former) otherwise we may get an uninitialized value back. In this case, we use ADD_STA_SUCCESS as success. Fixes: 732d06e9d9cf ("iwlwifi: mvm: add station before allocating a queue") Reported by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: handle FIF_ALLMULTI when setting multicast addressesLuca Coelho2017-09-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | We were ignoring the FIF_ALLMULTI flag when setting the multicast addresses with MCAST_FILTER_CMD. Check if this flag is set and enable pass_all accordingly. We also need to set the count to 0 if pass_all is enable so we don't pass addresses to the firmware when not needed (as doing so causes an assert). This fixes https://bugzilla.kernel.org/show_bug.cgi?id=196741 Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: use IWL_HCMD_NOCOPY for MCAST_FILTER_CMDLuca Coelho2017-09-081-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The MCAST_FILTER_CMD can get quite large when we have many mcast addresses to set (we support up to 255). So the command should be send as NOCOPY to prevent a warning caused by too-long commands: WARNING: CPU: 0 PID: 9700 at /root/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/pcie/tx.c:1550 iwl_pcie_enqueue_hcmd+0x8c7/0xb40 [iwlwifi] Command MCAST_FILTER_CMD (0x1d0) is too large (328 bytes) This fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196743 Cc: stable@vger.kernel.org Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: wake the correct mac80211 queueAvraham Stern2017-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | iwl_mvm_start_mac_queues() takes a bitmap of the queues to wake. When deferred tx is purged, set the bit of the hw_queue so the correct queue will be waken up. Fixes: 7e39a00d5931 ("iwlwifi: mvm: start mac queues when deferred tx frames are purged") Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: change state when queueing agg start workNaftali Goldstein2017-09-083-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new state to enum iwl_mvm_agg_state, which is used between queueing the work that starts tx aggregations and actually starting that work (changing to state IWL_AGG_STARTING). This solves a race where ieee80211_start_tx_ba_session is called a second time, before the work queued by the first run has a chance to change the agg_state. In this case the second call to ieee80211_start_tx_ba_session returns an error, and the fallback is to abort the ba session start. Fixes: 482e48440a0e ("iwlwifi: mvm: change open and close criteria of a BA session") Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: send all non-bufferable frames on the probe queueAvraham Stern2017-09-081-5/+5
| | | | | | | | | | | | | | | | | | | | AP interfaces now send all non-bufferable frames using the broadcast station. Thus allow them to use the probe queue and don't warn about it. Fixes: eb045e6e0389 ("iwlwifi: mvm: Avoid deferring non bufferable frames") Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: Flush non STA TX queuesDavid Spinadel2017-09-081-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | When starting wowlan mac80211 requests flush w/o vif and we ignore this request. As a result some packets stay stuck in the queue and it may end up with a queue hang. Allow the driver to flush queues even if station isn't specified. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: fix wowlan resume failed to load INIT ucodeMatt Chen2017-09-081-1/+1
|/ | | | | | | | | | | | | | | | | | If we set disconnect on wowlan and run suspend/resume, will run into: ...snipped iwlwifi 0000:01:00.0: Failed to load firmware chunk! iwlwifi 0000:01:00.0: Could not load the [0] uCode section iwlwifi 0000:01:00.0: Failed to start INIT ucode: -110 iwlwifi 0000:01:00.0: Failed to run INIT ucode: -110 iwlwifi 0000:01:00.0: Failed to start RT ucode: -110 It is because we still keep IWL_MVM_STATUS_IN_HW_RESTART in __iwl_mvm_resume. When mac80211 starts the device as __iwl_mvm_mac_start(), we will miss iwl_mvm_restart_cleanup(mvm). Signed-off-by: Matt Chen <matt.chen@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: mvm: only send LEDS_CMD when the FW supports itLuca Coelho2017-09-072-1/+3
| | | | | | | | | | | | | | | | | | | The LEDS_CMD command is only supported in some newer FW versions (e.g. iwlwifi-8000C-31.ucode), so we can't send it to older versions (such as iwlwifi-8000C-27.ucode). To fix this, check for a new bit in the FW capabilities TLV that tells when the command is supported. Note that the current version of -31.ucode in linux-firmware.git (31.532993.0) does not have this capability bit set, so the LED won't work, even though this version should support it. But we will update this firmware soon, so it won't be a problem anymore. Fixes: 7089ae634c50 ("iwlwifi: mvm: use firmware LED command where applicable") Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2017-09-023-9/+12
|\ | | | | | | | | | | Three cases of simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>