]> asedeno.scripts.mit.edu Git - linux.git/log
linux.git
5 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Sun, 14 Oct 2018 09:21:43 +0000 (12:21 +0300)]
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git

ath.git patches for 4.20. Major changes:

ath10k

* support NET_DETECT WoWLAN feature

* wcn3990 basic functionality now working after we got QMI support

5 years agoMerge tag 'mt76-for-kvalo-2018-10-13' of https://github.com/nbd168/wireless
Kalle Valo [Sun, 14 Oct 2018 08:40:41 +0000 (11:40 +0300)]
Merge tag 'mt76-for-kvalo-2018-10-13' of https://github.com/nbd168/wireless

mt76 patches for 4.20

* mt76x0 fixes
* mt76x0e improvements (should be usable now)
* usb support improvements
* more mt76x0/mt76x2 unification work
* minor fix for aggregation + powersave clients

5 years agoath10k: add QMI message handshake for wcn3990 client
Govind Singh [Thu, 11 Oct 2018 10:16:26 +0000 (13:16 +0300)]
ath10k: add QMI message handshake for wcn3990 client

Add WCN3990 QMI client handshakes for Q6 integrated WLAN connectivity
subsystem. This layer is responsible for communicating qmi control
messages to wifi fw QMI service using QMI messaging protocol.

Qualcomm MSM Interface(QMI) is a messaging format used to communicate
between components running between remote processors with underlying
transport layer based on integrated chipset(shared memory) or
discrete chipset(PCI/USB/SDIO/UART).

Signed-off-by: Govind Singh <govinds@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: add debug mask for QMI layer
Govind Singh [Thu, 11 Oct 2018 10:16:14 +0000 (13:16 +0300)]
ath10k: add debug mask for QMI layer

Add debug mask to control debug info of ath10k qmi
messaging layer.

Signed-off-by: Govind Singh <govinds@codeaurora.org>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agofirmware: qcom: scm: Add WLAN VMID for Qualcomm SCM interface
Govind Singh [Thu, 11 Oct 2018 10:16:01 +0000 (13:16 +0300)]
firmware: qcom: scm: Add WLAN VMID for Qualcomm SCM interface

Add WLAN related VMID's to support wlan driver to set up
the remote's permissions call via TrustZone.

Signed-off-by: Govind Singh <govinds@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agodt: bindings: add bindings for msa memory region
Govind Singh [Thu, 11 Oct 2018 10:15:49 +0000 (13:15 +0300)]
dt: bindings: add bindings for msa memory region

Add device tree binding documentation details of msa
memory region for ath10k qmi client for SDM845/APQ8098
SoC into "qcom,ath10k.txt".

Signed-off-by: Govind Singh <govinds@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: add support to create boardname for non-bmi target
Rakesh Pillai [Thu, 11 Oct 2018 10:11:45 +0000 (13:11 +0300)]
ath10k: add support to create boardname for non-bmi target

Add support to create the boardname for non-bmi targets
like WCN3990, which uses qmi for bdf download. This
boardname is used to parse the board data from board-2.bin.

Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Signed-off-by: Govind Singh <govinds@codeaurora.org>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: add qmi service helpers for wcn3990 qmi client
Govind Singh [Thu, 11 Oct 2018 10:11:32 +0000 (13:11 +0300)]
ath10k: add qmi service helpers for wcn3990 qmi client

WLAN qmi server running in Q6 exposes host to target
cold boot qmi handshakes. Add WLAN QMI service helpers
for ath10k wcn3990 qmi client.

Signed-off-by: Govind Singh <govinds@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agowil6210: fix debugfs_simple_attr.cocci warnings
YueHaibing [Fri, 5 Oct 2018 11:07:26 +0000 (11:07 +0000)]
wil6210: fix debugfs_simple_attr.cocci warnings

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
for debugfs files.

Semantic patch information:
Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
imposes some significant overhead as compared to
DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath9k: fix RX_STAT_INC() etc macros
Arnd Bergmann [Tue, 9 Oct 2018 16:03:06 +0000 (18:03 +0200)]
ath9k: fix RX_STAT_INC() etc macros

A couple of macros that deal with statistics in ath9k rely on the
declaration of the 'sc' variable, which they dereference.

However, when the statistics are disabled, the new instance in
ath_cmn_process_fft() causes a warning for an unused variable:

drivers/net/wireless/ath/ath9k/common-spectral.c: In function 'ath_cmn_process_fft':
drivers/net/wireless/ath/ath9k/common-spectral.c:474:20: error: unused variable 'sc' [-Werror=unused-variable]

It's better if those macros only operate on their arguments instead of
known variable names, and adding a cast to (void) kills off that warning.

Fixes: 03224678c013 ("ath9k: add counters for good and errorneous FFT/spectral frames")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: htt: remove some dead code
Dan Carpenter [Thu, 11 Oct 2018 08:09:20 +0000 (11:09 +0300)]
ath10k: htt: remove some dead code

We added an unnecessary condition here in commit a904417fc876 ("ath10k:
add extended per sta tx statistics support").  "legacy_rate_idx" is a u8
so it can't be negative.  The caller doesn't pass negatives either.  I
have deleted this code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: allocate small size dma memory in ath10k_pci_diag_write_mem
Carl Huang [Thu, 11 Oct 2018 07:55:26 +0000 (15:55 +0800)]
ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem

ath10k_pci_diag_write_mem may allocate big size of the dma memory
based on the parameter nbytes. Take firmware diag download as
example, the biggest size is about 500K. In some systems, the
allocation is likely to fail because it can't acquire such a large
contiguous dma memory.

The fix is to allocate a small size dma memory. In the loop,
driver copies the data to the allocated dma memory and writes to
the destination until all the data is written.

Tested with QCA6174 PCI with
firmware-6.bin_WLAN.RM.4.4.1-00119-QCARMSWP-1, this also affects
QCA9377 PCI.

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
Reviewed-by: Brian Norris <briannorris@chomium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: add peer flush in ath10k_flush for STATION
Wen Gong [Mon, 8 Oct 2018 09:02:43 +0000 (17:02 +0800)]
ath10k: add peer flush in ath10k_flush for STATION

In the noisy environment, if there are packets in the queue and can't
send out, the suspend timing will be more than 5 seconds due to the wait,
flush the queue to optimize the suspend timing, and let the upper layer to
retry the packets after resume.

Tested with QCA6174 PCI with firmware
WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
It's not a regression with new firmware releases.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: remove unnecessary comparison of unsigned integer with < 0
Gustavo A. R. Silva [Fri, 5 Oct 2018 18:56:23 +0000 (20:56 +0200)]
ath10k: remove unnecessary comparison of unsigned integer with < 0

There is no need to compare *ps_state_enable* with < 0 because
such variable is of type u8 (8 bits, unsigned), making it
impossible to hold a negative value.

Fix this by removing such comparison.

Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: htt_rx: fix signedness bug in ath10k_update_per_peer_tx_stats
Gustavo A. R. Silva [Fri, 5 Oct 2018 18:42:45 +0000 (20:42 +0200)]
ath10k: htt_rx: fix signedness bug in ath10k_update_per_peer_tx_stats

Currently, the error handling for the call to function
ath10k_get_legacy_rate_idx() doesn't work because
*rate_idx* is of type u8 (8 bits, unsigned), which
makes it impossible for it to hold a value less
than 0.

Fix this by changing the type of variable *rate_idx*
to s8 (8 bits, signed).

Addresses-Coverity-ID: 1473914 ("Unsigned compared against 0")
Fixes: 0189dbd71cbd ("ath10k: get the legacy rate index to update the txrate table")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: management tx ack rssi capability check
Balaji Pothunoori [Mon, 10 Sep 2018 06:24:30 +0000 (11:54 +0530)]
ath10k: management tx ack rssi capability check

Adding WMI service check for management tx ack rssi support; this is
done to maintain common avg ack signal in user level for both data
and management tx ack packet.

Tested on QCA4019(fw version-10.4-3.2.1-00063).

Signed-off-by: Balaji Pothunoori <bpothuno@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: support NET_DETECT WoWLAN feature
Wen Gong [Thu, 4 Oct 2018 05:45:31 +0000 (08:45 +0300)]
ath10k: support NET_DETECT WoWLAN feature

For WoWLAN support it is expected to support wake up based on discovery of
one or more known SSIDs. This is the WIPHY_WOWLAN_NET_DETECT feature,
which shows up as an NL80211 feature flag.

This shows up in 'iw phy' as:

WoWLAN support:
* wake up on network detection, up to 16 match sets

And it can be enabled with command:

iw phy0 wowlan enable net-detect interval 5000 delay 30 freqs 2412 matches ssid foo

Firmware will do scan by the configured parameters after suspend and
wakeup if it found matched SSIDs. Tested with QCA6174 hw3.0 with
firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
[kvalo@codeaurora.org: fix lots of endian bugs, whitespace, commit log and style cleanup]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: set probe request oui during driver start
Rakesh Pillai [Tue, 2 Oct 2018 18:03:13 +0000 (23:33 +0530)]
ath10k: set probe request oui during driver start

Currently the wmi command for setting probe request
oui, needed for mac randomization, is sent during
the mac register. At this time, during the driver
init the wmi has already been detached. This can
cause unexpected behavior since the firmware is
already down and the wmi has been detached.

Send the wmi command for setting probe request
oui during the driver start. This will make sure
that the firmware is started and wmi is initialized
before we send this command.

Tested HW: WCN3990
Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1

Fixes: 60e1d0fb290197fe505dff6e4e3b7e4d258dbf60
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: fix possible out of bound access of ath10k_rates array
Sriram R [Wed, 3 Oct 2018 03:13:50 +0000 (08:43 +0530)]
ath10k: fix possible out of bound access of ath10k_rates array

While using 'ath10k_mac_get_rate_hw_value()' to obtain the hw value
from the passed bitrate, there is a chance of out of bound array access
when wrong bitrate is passed. This is fixed by comparing the bitrates
within the correct size of the ath10k_rates array.

Fixes commit f279294e9ee2 ("ath10k: add support for configuring management
packet rate"). Also correction made to some indents used in the above commit.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortl8xxxu: Remove set but not used variables 'usedesc40' and 'seq_number'
YueHaibing [Mon, 8 Oct 2018 14:16:59 +0000 (14:16 +0000)]
rtl8xxxu: Remove set but not used variables 'usedesc40' and 'seq_number'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function 'rtl8xxxu_tx':
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:4925:7: warning:
 variable 'usedesc40' set but not used [-Wunused-but-set-variable]

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:4921:6: warning:
 variable 'seq_number' set but not used [-Wunused-but-set-variable]

'usedesc40' and 'seq_number' are not used any more after
commit b59415c2dd08 ("rtl8xxxu: Split filling of TX descriptors into separate functions")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac_pcie: cleanup Pearl platform headers
Sergey Matyukevich [Mon, 8 Oct 2018 09:56:03 +0000 (09:56 +0000)]
qtnfmac_pcie: cleanup Pearl platform headers

Remove redundant information from Pearl platform headers.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: use SPDX identifier for pcie bus layer files
Sergey Matyukevich [Mon, 8 Oct 2018 09:56:02 +0000 (09:56 +0000)]
qtnfmac: use SPDX identifier for pcie bus layer files

Change pcie bus layer licensing information to SPDX format.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: use 'help' in Kconfig
Sergey Matyukevich [Mon, 8 Oct 2018 09:56:00 +0000 (09:56 +0000)]
qtnfmac: use 'help' in Kconfig

Fix checkpatch warning: use preferred 'help' option in Kconfig.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas: return errno from lbs_add_card()
Lubomir Rintel [Sun, 7 Oct 2018 00:33:27 +0000 (02:33 +0200)]
libertas: return errno from lbs_add_card()

This makes the error handling somewhat cleaner -- lbs_add_card() does no
logner throw away the errno and lets its callers propagate it.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas: don't set URB_ZERO_PACKET on IN USB transfer
Lubomir Rintel [Sat, 6 Oct 2018 20:12:32 +0000 (22:12 +0200)]
libertas: don't set URB_ZERO_PACKET on IN USB transfer

The USB core gets rightfully upset:

  usb 1-1: BOGUS urb flags, 240 --> 200
  WARNING: CPU: 0 PID: 60 at drivers/usb/core/urb.c:503 usb_submit_urb+0x2f8/0x3ed
  Modules linked in:
  CPU: 0 PID: 60 Comm: kworker/0:3 Not tainted 4.19.0-rc6-00319-g5206d00a45c7 #39
  Hardware name: OLPC XO/XO, BIOS OLPC Ver 1.00.01 06/11/2014
  Workqueue: events request_firmware_work_func
  EIP: usb_submit_urb+0x2f8/0x3ed
  Code: 75 06 8b 8f 80 00 00 00 8d 47 78 89 4d e4 89 55 e8 e8 35 1c f6 ff 8b 55 e8 56 52 8b 4d e4 51 50 68 e3 ce c7 c0 e8 ed 18 c6 ff <0f> 0b 83 c4 14 80 7d ef 01 74 0a 80 7d ef 03 0f 85 b8 00 00 00 8b
  EAX: 00000025 EBX: ce7d4980 ECX: 00000000 EDX: 00000001
  ESI: 00000200 EDI: ce7d8800 EBP: ce7f5ea8 ESP: ce7f5e70
  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068 EFLAGS: 00210292
  CR0: 80050033 CR2: 00000000 CR3: 00e80000 CR4: 00000090
  Call Trace:
   ? if_usb_fw_timeo+0x64/0x64
   __if_usb_submit_rx_urb+0x85/0xe6
   ? if_usb_fw_timeo+0x64/0x64
   if_usb_submit_rx_urb_fwload+0xd/0xf
   if_usb_prog_firmware+0xc0/0x3db
   ? _request_firmware+0x54/0x47b
   ? _request_firmware+0x89/0x47b
   ? if_usb_probe+0x412/0x412
   lbs_fw_loaded+0x55/0xa6
   ? debug_smp_processor_id+0x12/0x14
   helper_firmware_cb+0x3c/0x3f
   request_firmware_work_func+0x37/0x6f
   process_one_work+0x164/0x25a
   worker_thread+0x1c4/0x284
   kthread+0xec/0xf1
   ? cancel_delayed_work_sync+0xf/0xf
   ? kthread_create_on_node+0x1a/0x1a
   ret_from_fork+0x2e/0x38
  ---[ end trace 3ef1e3b2dd53852f ]---

Cc: stable@vger.kernel.org
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoiwlegacy: Add a lock assertion in il4965_send_rxon_assoc()
Jia-Ju Bai [Fri, 5 Oct 2018 13:55:46 +0000 (21:55 +0800)]
iwlegacy: Add a lock assertion in il4965_send_rxon_assoc()

The variables il->staging.filter_flags, rxon1->filter_flags and
rxon2->filter_flags need to be protected by the mutex lock il->mutex.
This patch adds a lock assertion of il->mutex to check whether
this lock is held.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmsmac: AP mode: update beacon when TIM changes
Ali MJ Al-Nasrawy [Wed, 3 Oct 2018 16:21:39 +0000 (19:21 +0300)]
brcmsmac: AP mode: update beacon when TIM changes

Beacons are not updated to reflect TIM changes. This is not compliant with
power-saving client stations as the beacons do not have valid TIM and can
cause the network to stall at random occasions and to have highly variable
latencies.
Fix it by updating beacon templates on mac80211 set_tim callback.

Addresses an issue described in:
https://marc.info/?i=20180911163534.21312d08%20()%20manjaro

Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agomt76x0: phy: do not run calibration during channel switch
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:28 +0000 (12:16 +0200)]
mt76x0: phy: do not run calibration during channel switch

Do not perform phy/vga calibration during channel switch.
Moreover remove mt76x0_agc_save and mt76x0_agc_restore routines
since they are no longer necessary. Furthermore run mt76_set_channel
in order to check if there are pending frames during channel switch

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: phy: align channel gain logic to mt76x2 one
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:27 +0000 (12:16 +0200)]
mt76x0: phy: align channel gain logic to mt76x2 one

Update vga tuning algorithm to the one used in mt76x2 driver

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: introduce mt76x02_init_agc_gain routine
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:26 +0000 (12:16 +0200)]
mt76: introduce mt76x02_init_agc_gain routine

Add mt76x02_init_agc_gain routine in mt76x02-lib moudule in
order to be reused by mt76x0 for vga initalization

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: move mt76x02_phy_adjust_vga_gain in mt76/mt76x02_phy.c
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:25 +0000 (12:16 +0200)]
mt76: move mt76x02_phy_adjust_vga_gain in mt76/mt76x02_phy.c

Move mt76x02_phy_adjust_vga_gain routine in mt76x02-lib module
in order to be reused by mt76x0 driver for vga calibration

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: move rssi_gain_thresh routines in mt76x02-lib module
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:24 +0000 (12:16 +0200)]
mt76: move rssi_gain_thresh routines in mt76x02-lib module

Move mt76x2_get_rssi_gain_thresh and mt76x2_get_low_rssi_gain_thresh
routines in mt76x02-lib module in order to be reused by mt76x0 driver
for dynamic vga calibration

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: phy: add phy/vco temperature compensation
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:23 +0000 (12:16 +0200)]
mt76x0: phy: add phy/vco temperature compensation

Introduce phy/vco temperature calibration.
Moreover fix configuration of register 67 on bank0
during temperature reading and use mt76_poll utility routine
to poll core34 register.
Furthermore temperature compensation needs to be disabled
if the device supports tssi compensation.
This issue has never been hit since temperature reading is not
actually used by usb code.

Fixes: 10de7a8b4ab9 ("mt76x0: phy files")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: eeprom: introduce mt76x0_tssi_enabled routine
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:22 +0000 (12:16 +0200)]
mt76x0: eeprom: introduce mt76x0_tssi_enabled routine

Add mt76x0_tssi_enabled in order to check if tssi compensation
is enabled since mt76x0 condition differs from mt76x2 one.
Moreover move back mt76x02_temp_tx_alc_enabled and mt76x02_tssi_enabled
routines in mt76x2/eeprom.h since they are mt76x2 specific

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: phy: update set_channel for mt76x0e devices
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:21 +0000 (12:16 +0200)]
mt76x0: phy: update set_channel for mt76x0e devices

Do not run mt76x0_vco_cal and mt76x0_bbp_set_bw routines and
configure MT_TX_SW_CFG0 register for pcie devices in
mt76x0_phy_set_channel function.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: pci: introduce mt76x0_phy_calirate routine
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:20 +0000 (12:16 +0200)]
mt76x0: pci: introduce mt76x0_phy_calirate routine

Add mt76x0_phy_calirate routine in order to perform
phy calibration for mt76x0e devices.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: pci: rename mt76x0_phy_calibrate
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:19 +0000 (12:16 +0200)]
mt76x0: pci: rename mt76x0_phy_calibrate

Rename mt76x0_phy_calibrate routine in mt76x0_phy_calibration_work
in order to not collide with calibration routine for mt76x0e

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: move mt76x02_phy_set_band in mt76x02-lib module
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:18 +0000 (12:16 +0200)]
mt76: move mt76x02_phy_set_band in mt76x02-lib module

Move mt76x02_phy_set_band routine in mt76x02_phy.c since
it is shared between mt76x0 and mt76x2 drivers and remove
duplicated code

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: move mt76x02_phy_set_bw in mt76x02-lib module
Lorenzo Bianconi [Fri, 12 Oct 2018 10:16:17 +0000 (12:16 +0200)]
mt76: move mt76x02_phy_set_bw in mt76x02-lib module

Move mt76x02_phy_set_bw routine in mt76x02_phy.c since
it is shared between mt76x0 and mt76x2 drivers and remove
duplicated code

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: phy: remove channel parameter from mt76x0_phy_set_chan_bbp_params
Lorenzo Bianconi [Wed, 10 Oct 2018 10:31:13 +0000 (12:31 +0200)]
mt76x0: phy: remove channel parameter from mt76x0_phy_set_chan_bbp_params

Remove unused channel parameter from mt76x0_phy_set_chan_bbp_params
routine signature

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: phy: fix restore phase in mt76x0_phy_recalibrate_after_assoc
Lorenzo Bianconi [Tue, 9 Oct 2018 08:57:06 +0000 (10:57 +0200)]
mt76x0: phy: fix restore phase in mt76x0_phy_recalibrate_after_assoc

Fix restore value configured in MT_BBP(IBI, 9) register in
mt76x0_phy_recalibrate_after_assoc routine.

Fixes: 10de7a8b4ab9 ("mt76x0: phy files")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x0e: another fix for the external PA current setting
Felix Fietkau [Tue, 9 Oct 2018 08:44:36 +0000 (10:44 +0200)]
mt76: mt76x0e: another fix for the external PA current setting

- Use the register number define instead of a magic value
- Fix inverted bit test (override needs to be applied if the bit is not set)

Fixes: 2b2cb40bcd7d ("mt76x0: pci: add hw initialization at bootstrap")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: pci: fix set external PA I/O current
YueHaibing [Mon, 8 Oct 2018 13:21:49 +0000 (13:21 +0000)]
mt76x0: pci: fix set external PA I/O current

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/mediatek/mt76/mt76x0/pci.c: In function 'mt76x0e_register_device':
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c:107:8: warning:
 variable 'data' set but not used [-Wunused-but-set-variable]

It seems correct value to write is 'data'

Fixes: 2b2cb40bcd7d ("mt76x0: pci: add hw initialization at bootstrap")
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: do not store aggregation sequence number for null-data frames
Felix Fietkau [Mon, 8 Oct 2018 08:39:24 +0000 (10:39 +0200)]
mt76: do not store aggregation sequence number for null-data frames

Fixes a rare corner case where a BlockAckReq might get the wrong
sequence number.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: remove dma.h
Stanislaw Gruszka [Mon, 8 Oct 2018 11:22:20 +0000 (13:22 +0200)]
mt76x0: remove dma.h

dma.h is not used any longer.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: reserve enough room for USB tx skbs
Stanislaw Gruszka [Mon, 8 Oct 2018 11:22:00 +0000 (13:22 +0200)]
mt76: reserve enough room for USB tx skbs

Reserve enough room for USB skb, so we don not need to check
the room every time we send frame.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: pci: add mt76x0_register_device in mt76x0e_register_device
Lorenzo Bianconi [Sun, 7 Oct 2018 09:57:22 +0000 (11:57 +0200)]
mt76x0: pci: add mt76x0_register_device in mt76x0e_register_device

Run mt76x0_register_device routine in mt76x0e_register_device
in order to register the device to the mac80211 layer.
Moreover init mt76_driver_ops data structure and register
interrupt line

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: disable ldpc coding for mt76x0 devices
Lorenzo Bianconi [Sun, 7 Oct 2018 09:57:21 +0000 (11:57 +0200)]
mt76: disable ldpc coding for mt76x0 devices

Disable ldpc coding for mt76x0 devices. Morover remove
mt76x02_mac_fill_txwi routine since it is used just in
mt76x02_mac_write_txwi

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: pci: add missing mac80211 callbacks
Lorenzo Bianconi [Sun, 7 Oct 2018 09:57:20 +0000 (11:57 +0200)]
mt76x0: pci: add missing mac80211 callbacks

Add missing mac80211 callbacks in mt76x0e_ops data structure

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: pci: report firmware version using ethtool
Lorenzo Bianconi [Sun, 7 Oct 2018 09:51:16 +0000 (11:51 +0200)]
mt76x0: pci: report firmware version using ethtool

Report via ethtool fw_ver and build_ver members of mt76x02_fw_header
data structure similarly to what is reported in the syslog

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: use mt76x02_dev instead of mt76_dev in mt76x02_eeprom.c
Lorenzo Bianconi [Sun, 7 Oct 2018 09:45:24 +0000 (11:45 +0200)]
mt76: use mt76x02_dev instead of mt76_dev in mt76x02_eeprom.c

Use mt76x02_dev data structure as reference in mt76x02_eeprom.c
instead of mt76_dev

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: use mt76x02_dev instead of mt76_dev in mt76x02_txrx.c
Lorenzo Bianconi [Sun, 7 Oct 2018 09:45:23 +0000 (11:45 +0200)]
mt76: use mt76x02_dev instead of mt76_dev in mt76x02_txrx.c

Use mt76x02_dev data structure as reference in mt76x02_txrx.c
instead of mt76_dev

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: use mt76x02_dev instead of mt76_dev in mt76x02_mac.c
Lorenzo Bianconi [Sun, 7 Oct 2018 09:45:22 +0000 (11:45 +0200)]
mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mac.c

Use mt76x02_dev data structure as reference in mt76x02_mac.c
instead of mt76_dev

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: use mt76x02_dev instead of mt76_dev in mt76x02_usb_mcu.c
Lorenzo Bianconi [Sun, 7 Oct 2018 09:45:21 +0000 (11:45 +0200)]
mt76: use mt76x02_dev instead of mt76_dev in mt76x02_usb_mcu.c

Use mt76x02_dev data structure as reference in mt76x02_usb_mcu.c
instead of mt76_dev

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: use mt76x02_dev instead of mt76_dev in mt76x02_util.c
Lorenzo Bianconi [Sun, 7 Oct 2018 09:45:20 +0000 (11:45 +0200)]
mt76: use mt76x02_dev instead of mt76_dev in mt76x02_util.c

Use mt76x02_dev data structure as reference in mt76x02_util.c
instead of mt76_dev

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: use mt76x02_dev instead of mt76_dev in mt76x02_phy.c
Lorenzo Bianconi [Sun, 7 Oct 2018 09:45:19 +0000 (11:45 +0200)]
mt76: use mt76x02_dev instead of mt76_dev in mt76x02_phy.c

Use mt76x02_dev data structure as reference in mt76x02_phy.c
instead of mt76_dev

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: use mt76x02_dev instead of mt76_dev in mt76x02_mcu.c
Lorenzo Bianconi [Sun, 7 Oct 2018 09:45:18 +0000 (11:45 +0200)]
mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mcu.c

Use mt76x02_dev data structure as reference in mt76x02_mcu.c
instead of mt76_dev

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: phy: fix bank check in mt76x0_rf_csr_{wr,rr}
Lorenzo Bianconi [Sun, 7 Oct 2018 09:37:40 +0000 (11:37 +0200)]
mt76x0: phy: fix bank check in mt76x0_rf_csr_{wr,rr}

Fix typo in bank check in mt76x0_rf_csr_{wr,rr} routines.
This issue has never been hit since mt76x0_rf_csr_{wr,rr}
are actually used just by pci code

Fixes: 10de7a8b4ab9 ("mt76x0: phy files")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: use bus helper to identify rf access method
Stanislaw Gruszka [Thu, 4 Oct 2018 10:04:55 +0000 (12:04 +0200)]
mt76x0: use bus helper to identify rf access method

Use mt76_is_usb() to identify RF access method instead of
MT76_STATE_MCU_RUNNING flag and add warning since MCU has
to be initialized before we can access RF registers via MCU.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: correct RF reg pairs write for PCIe
Stanislaw Gruszka [Thu, 4 Oct 2018 10:04:54 +0000 (12:04 +0200)]
mt76x0: correct RF reg pairs write for PCIe

We have to use RF CSR method for PCIe.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: allow to identify bus
Stanislaw Gruszka [Thu, 4 Oct 2018 10:04:53 +0000 (12:04 +0200)]
mt76: allow to identify bus

Add helpers to identify bus type.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: correct RF access via RF_CSR register.
Stanislaw Gruszka [Thu, 4 Oct 2018 10:04:52 +0000 (12:04 +0200)]
mt76x0: correct RF access via RF_CSR register.

PCIe version don't use MCU for RF registers access. We need
to correct RF CSR method to support up to 127 RF registers.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x0: print BBP version only for debug
Stanislaw Gruszka [Thu, 4 Oct 2018 10:04:51 +0000 (12:04 +0200)]
mt76x0: print BBP version only for debug

Use dev_dbg to print BBP version.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agortlwifi: rtl8821ae: replace _rtl8821ae_mrate_idx_to_arfr_id with generic version
Colin Ian King [Mon, 8 Oct 2018 08:50:28 +0000 (09:50 +0100)]
rtlwifi: rtl8821ae: replace _rtl8821ae_mrate_idx_to_arfr_id with generic version

Function _rtl8821ae_mrate_idx_to_arfr_id is functionally identical to
the generic version rtl_mrate_idx_to_arfr_id, so remove
_rtl8821ae_mrate_idx_to_arfr_id and use the generic one instead.

This also fixes a missing break statement found by CoverityScan in
_rtl8821ae_mrate_idx_to_arfr_id, namely: CID#1167237 ("Missing break
in switch")

Thanks to Joe Perches for spotting this when I submitted an earlier patch.

Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoiwlwifi: mvm: check return value of rs_rate_from_ucode_rate()
Luca Coelho [Sat, 13 Oct 2018 06:46:08 +0000 (09:46 +0300)]
iwlwifi: mvm: check return value of rs_rate_from_ucode_rate()

The rs_rate_from_ucode_rate() function may return -EINVAL if the rate
is invalid, but none of the callsites check for the error, potentially
making us access arrays with index IWL_RATE_INVALID, which is larger
than the arrays, causing an out-of-bounds access.  This will trigger
KASAN warnings, such as the one reported in the bugzilla issue
mentioned below.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=200659

Cc: stable@vger.kernel.org
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoMerge tag 'iwlwifi-next-for-kalle-2018-10-12' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Sat, 13 Oct 2018 11:47:09 +0000 (14:47 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2018-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

Fourth set of iwlwifi patches intended for 4.20

* Support for a new scan type;
* Clean-up in the queue handling code;
* A few bug fixes;

5 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Sat, 13 Oct 2018 04:38:46 +0000 (21:38 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts were easy to resolve using immediate context mostly,
except the cls_u32.c one where I simply too the entire HEAD
chunk.

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 's390-qeth-next'
David S. Miller [Fri, 12 Oct 2018 18:27:01 +0000 (11:27 -0700)]
Merge branch 's390-qeth-next'

Julian Wiedmann says:

====================
s390/qeth: updates 2018-10-12

please apply one more patchset for net-next. This extends the TSO support
in qeth.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agos390/qeth: add TSO support for L2 devices
Julian Wiedmann [Fri, 12 Oct 2018 15:27:15 +0000 (17:27 +0200)]
s390/qeth: add TSO support for L2 devices

Except for the new HW header id, this works just like TSO6 on L3 devices
and reuses all the existing data path support in qeth_xmit().

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agos390/qeth: add support for IPv6 TSO
Julian Wiedmann [Fri, 12 Oct 2018 15:27:14 +0000 (17:27 +0200)]
s390/qeth: add support for IPv6 TSO

This adds TSO6 support for L3 qeth devices.
Just like for standard IPv6 traffic, TSO6 doesn't use IP offload and
thus runs over the normal qeth_xmit() path.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agos390/qeth: enhance TSO control sequence
Julian Wiedmann [Fri, 12 Oct 2018 15:27:13 +0000 (17:27 +0200)]
s390/qeth: enhance TSO control sequence

TSO6 requires the full programming sequence, and not just a simple
START command. This implements the additional ENABLE command, and adds
some sanity checks that were missing for the START command.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agos390/qeth: make TSO controls protocol-agnostic
Julian Wiedmann [Fri, 12 Oct 2018 15:27:12 +0000 (17:27 +0200)]
s390/qeth: make TSO controls protocol-agnostic

In preparation for IPv6 TSO, turn the protocol version into a parameter
for the TSO control code.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'hns3-promisc-next'
David S. Miller [Fri, 12 Oct 2018 18:23:45 +0000 (11:23 -0700)]
Merge branch 'hns3-promisc-next'

Salil Mehta says:

====================
Fixes & small enhancements related to the promisc mode in HNS3

This patch-set presents some fixes and enhancements related to promiscuous
mode and MAC VLAN Table full condition in HNS3 Ethernet Driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: Resume promisc mode and vlan filter status after loopback test
Jian Shen [Fri, 12 Oct 2018 14:34:06 +0000 (15:34 +0100)]
net: hns3: Resume promisc mode and vlan filter status after loopback test

This patch resumes promisc mode and vlan filter status after
loopback test.

Fixes: 3b75c3df599d ("net: hns3: net: hns3: Add support for IFF_ALLMULTI flag")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: Resume promisc mode and vlan filter status after reset
Jian Shen [Fri, 12 Oct 2018 14:34:05 +0000 (15:34 +0100)]
net: hns3: Resume promisc mode and vlan filter status after reset

This patch resumes promisc mode and vlan filter status after reset.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: Enable promisc mode when mac vlan table is full
Jian Shen [Fri, 12 Oct 2018 14:34:04 +0000 (15:34 +0100)]
net: hns3: Enable promisc mode when mac vlan table is full

Currently, the driver does nothing when mac vlan table is full.
In this case, the packet with new mac address will be dropped
by hardware. This patch adds check for the result of sync mac
address, and enable promisc mode when mac vlan table is full.
Furtherly, disable vlan filter when enable promisc by user
command.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonetlink: replace __NLA_ENSURE implementation
Johannes Berg [Fri, 12 Oct 2018 10:53:00 +0000 (12:53 +0200)]
netlink: replace __NLA_ENSURE implementation

We already have BUILD_BUG_ON_ZERO() which I just hadn't found
before, so we should use it here instead of open-coding another
implementation thereof.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge tag 'mac80211-next-for-davem-2018-10-12' of git://git.kernel.org/pub/scm/linux...
David S. Miller [Fri, 12 Oct 2018 17:56:56 +0000 (10:56 -0700)]
Merge tag 'mac80211-next-for-davem-2018-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
Highlights:
 * merge net-next, so I can finish the hwsim workqueue removal
 * fix TXQ NULL pointer issue that was reported multiple times
 * minstrel cleanups from Felix
 * simplify lib80211 code by not using skcipher, note that this
   will conflict with the crypto tree (and this new code here
   should be used)
 * use new netlink policy validation in nl80211
 * fix up SAE (part of WPA3) in client-mode
 * FTM responder support in the stack
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: bridge: add support for per-port vlan stats
Nikolay Aleksandrov [Fri, 12 Oct 2018 10:41:16 +0000 (13:41 +0300)]
net: bridge: add support for per-port vlan stats

This patch adds an option to have per-port vlan stats instead of the
default global stats. The option can be set only when there are no port
vlans in the bridge since we need to allocate the stats if it is set
when vlans are being added to ports (and respectively free them
when being deleted). Also bump RTNL_MAX_TYPE as the bridge is the
largest user of options. The current stats design allows us to add
these without any changes to the fast-path, it all comes down to
the per-vlan stats pointer which, if this option is enabled, will
be allocated for each port vlan instead of using the global bridge-wide
one.

CC: bridge@lists.linux-foundation.org
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agofore200e: fix sbus compile
Christoph Hellwig [Fri, 12 Oct 2018 08:17:51 +0000 (10:17 +0200)]
fore200e: fix sbus compile

Fix a stupid typo introduced in the refactoring.

Fixes: 0efe5523 ("fore200e: simplify fore200e_bus usage")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: Evict neighbor entries on carrier down
David Ahern [Fri, 12 Oct 2018 03:33:49 +0000 (20:33 -0700)]
net: Evict neighbor entries on carrier down

When a link's carrier goes down it could be a sign of the port changing
networks. If the new network has overlapping addresses with the old one,
then the kernel will continue trying to use neighbor entries established
based on the old network until the entries finally age out - meaning a
potentially long delay with communications not working.

This patch evicts neighbor entries on carrier down with the exception of
those marked permanent. Permanent entries are managed by userspace (either
an admin or a routing daemon such as FRR).

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet/ipv6: Add knob to skip DELROUTE message on device down
David Ahern [Fri, 12 Oct 2018 03:17:21 +0000 (20:17 -0700)]
net/ipv6: Add knob to skip DELROUTE message on device down

Another difference between IPv4 and IPv6 is the generation of RTM_DELROUTE
notifications when a device is taken down (admin down) or deleted. IPv4
does not generate a message for routes evicted by the down or delete;
IPv6 does. A NOS at scale really needs to avoid these messages and have
IPv4 and IPv6 behave similarly, relying on userspace to handle link
notifications and evict the routes.

At this point existing user behavior needs to be preserved. Since
notifications are a global action (not per app) the only way to preserve
existing behavior and allow the messages to be skipped is to add a new
sysctl (net/ipv6/route/skip_notify_on_dev_down) which can be set to
disable the notificatioons.

IPv6 route code already supports the option to skip the message (it is
used for multipath routes for example). Besides the new sysctl we need
to pass the skip_notify setting through the generic fib6_clean and
fib6_walk functions to fib6_clean_node and to set skip_notify on calls
to __ip_del_rt for the addrconf_ifdown path.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: fddi: skfp: Remove unused macros 'PNMI_GET_ID' and 'PNMI_SET_ID'
YueHaibing [Fri, 12 Oct 2018 02:37:41 +0000 (10:37 +0800)]
net: fddi: skfp: Remove unused macros 'PNMI_GET_ID' and 'PNMI_SET_ID'

The two PNMI macros are never used

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: cdc_ncm: remove set but not used variable 'ctx'
YueHaibing [Fri, 12 Oct 2018 01:49:13 +0000 (01:49 +0000)]
net: cdc_ncm: remove set but not used variable 'ctx'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/usb/cdc_ncm.c: In function 'cdc_ncm_status':
drivers/net/usb/cdc_ncm.c:1603:22: warning:
 variable 'ctx' set but not used [-Wunused-but-set-variable]
  struct cdc_ncm_ctx *ctx;

It not used any more after
commit fa83dbeee558 ("net: cdc_ncm: remove redundant "disconnected" flag")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Greg Kroah-Hartman [Fri, 12 Oct 2018 15:41:27 +0000 (17:41 +0200)]
Merge tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Arnd writes:
  "ARM: SoC fixes for 4.19

   Two last minute bugfixes, both for NXP platforms:

   * The Layerscape 'qbman' infrastructure suffers from probe ordering
     bugs in some configurations, a two-patch series adds a hotfix for
     this. 4.20 will have a longer set of patches to rework it.

   * The old imx53-qsb board regressed in 4.19 after the addition
     of cpufreq support, adding a set of explicit operating points
     fixes this."

* tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  soc: fsl: qman_portals: defer probe after qman's probe
  soc: fsl: qbman: add APIs to retrieve the probing status
  ARM: dts: imx53-qsb: disable 1.2GHz OPP

5 years agoafs: Fix afs_server struct leak
David Howells [Fri, 12 Oct 2018 13:00:57 +0000 (14:00 +0100)]
afs: Fix afs_server struct leak

Fix a leak of afs_server structs.  The routine that installs them in the
various lookup lists and trees gets a ref on leaving the function, whether
it added the server or a server already exists.  It shouldn't increment
the refcount if it added the server.

The effect of this that "rmmod kafs" will hang waiting for the leaked
server to become unused.

Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoMAINTAINERS: use the correct location for dt-bindings includes for mux
Peter Rosin [Fri, 12 Oct 2018 14:46:46 +0000 (14:46 +0000)]
MAINTAINERS: use the correct location for dt-bindings includes for mux

Just drop the "linux" part of the path, it was never correct.

Reported-by: Joe Perches <joe@perches.com>
Fixes: 256ac0375098 ("dt-bindings: document devicetree bindings for mux-controllers and gpio-mux")
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomux: adgs1408: use the correct MODULE_LICENSE
Peter Rosin [Fri, 12 Oct 2018 14:46:40 +0000 (14:46 +0000)]
mux: adgs1408: use the correct MODULE_LICENSE

The file is GPL v2 or later.

Acked-by: Mircea Caprioru <mircea.caprioru@analog.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoafs: Fix cell proc list
David Howells [Thu, 11 Oct 2018 21:45:49 +0000 (22:45 +0100)]
afs: Fix cell proc list

Access to the list of cells by /proc/net/afs/cells has a couple of
problems:

 (1) It should be checking against SEQ_START_TOKEN for the keying the
     header line.

 (2) It's only holding the RCU read lock, so it can't just walk over the
     list without following the proper RCU methods.

Fix these by using an hlist instead of an ordinary list and using the
appropriate accessor functions to follow it with RCU.

Since the code that adds a cell to the list must also necessarily change,
sort the list on insertion whilst we're at it.

Fixes: 989782dcdc91 ("afs: Overhaul cell database management")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomac80211: implement ieee80211_tx_rate_update to update rate
Anilkumar Kolli [Thu, 11 Oct 2018 12:45:03 +0000 (18:15 +0530)]
mac80211: implement ieee80211_tx_rate_update to update rate

Current mac80211 has provision to update tx status through
ieee80211_tx_status() and ieee80211_tx_status_ext(). But
drivers like ath10k updates the tx status from the skb except
txrate, txrate will be updated from a different path, peer stats.

Using ieee80211_tx_status_ext() in two different paths
(one for the stats, one for the tx rate) would duplicate
the stats instead.

To avoid this stats duplication, ieee80211_tx_rate_update()
is implemented.

Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
[minor commit message editing, use initializers in code]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoMerge tag 'mmc-v4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Greg Kroah-Hartman [Fri, 12 Oct 2018 10:57:05 +0000 (12:57 +0200)]
Merge tag 'mmc-v4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Ulf writes:
   "MMC core:
    - Avoid fragile multiblock reads for the last sector in SPI mode
    WIFI/SDIO:
    - libertas: Fixup suspend sequence for the SDIO card"

* tag 'mmc-v4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  libertas: call into generic suspend code before turning off power
  mmc: block: avoid multiblock reads for the last sector in SPI mode

5 years agonl80211: Add per peer statistics to compute FCS error rate
Ankita Bajaj [Thu, 27 Sep 2018 15:01:57 +0000 (18:01 +0300)]
nl80211: Add per peer statistics to compute FCS error rate

Add support for drivers to report the total number of MPDUs received
and the number of MPDUs received with an FCS error from a specific
peer. These counters will be incremented only when the TA of the
frame matches the MAC address of the peer irrespective of FCS
error.

It should be noted that the TA field in the frame might be corrupted
when there is an FCS error and TA matching logic would fail in such
cases. Hence, FCS error counter might not be fully accurate, but it can
provide help in detecting bad RX links in significant number of cases.
This FCS error counter without full accuracy can be used, e.g., to
trigger a kick-out of a connected client with a bad link in AP mode to
force such a client to roam to another AP.

Signed-off-by: Ankita Bajaj <bankita@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoMerge tag 'gpio-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Greg Kroah-Hartman [Fri, 12 Oct 2018 10:56:25 +0000 (12:56 +0200)]
Merge tag 'gpio-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Linus writes:
  "GPIO fix for the v4.19 series:
   - Fix up the interrupt parent for the irqdomains."

* tag 'gpio-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: Assign gpio_irq_chip::parents to non-stack pointer

5 years agoMerge tag 'pinctrl-v4.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Greg Kroah-Hartman [Fri, 12 Oct 2018 10:55:47 +0000 (12:55 +0200)]
Merge tag 'pinctrl-v4.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Linus writes:
  "pin control fix for v4.19:

   A single pin control fix for v4.19:
   - Interrupt setup in the MCP23S08 driver."

* tag 'pinctrl-v4.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: mcp23s08: fix irq and irqchip setup order

5 years agoMerge tag 'mtd/fixes-for-4.19-rc8' of git://git.infradead.org/linux-mtd
Greg Kroah-Hartman [Fri, 12 Oct 2018 10:54:26 +0000 (12:54 +0200)]
Merge tag 'mtd/fixes-for-4.19-rc8' of git://git.infradead.org/linux-mtd

Boris writes:
  "mdt: fix for 4.19-rc8

   * Fix a stack overflow in lib/bch.c"

* tag 'mtd/fixes-for-4.19-rc8' of git://git.infradead.org/linux-mtd:
  lib/bch: fix possible stack overrun

5 years agoMerge tag 'drm-fixes-2018-10-12-1' of git://anongit.freedesktop.org/drm/drm
Greg Kroah-Hartman [Fri, 12 Oct 2018 10:53:48 +0000 (12:53 +0200)]
Merge tag 'drm-fixes-2018-10-12-1' of git://anongit.freedesktop.org/drm/drm

Dave writes:
  "drm fixes for 4.19-rc8

   single nouveau runtime reference and mst change"

* tag 'drm-fixes-2018-10-12-1' of git://anongit.freedesktop.org/drm/drm:
  drm/nouveau/drm/nouveau: Grab runtime PM ref in nv50_mstc_detect()

5 years agoMerge tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Greg Kroah-Hartman [Fri, 12 Oct 2018 10:53:06 +0000 (12:53 +0200)]
Merge tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Doug writes:
  "RDMA fixes:

   Final for-rc pull request for 4.19

   We only have one bug to submit this time around.  It fixes a DMA
   unmap issue where we unmapped the DMA address from the IOMMU before
   we did from the card, resulting in a DMAR error with IOMMU enabled,
   or possible crash without."

* tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  IB/mlx5: Unmap DMA addr from HCA before IOMMU

5 years agomac80211: support FTM responder configuration/statistics
Pradeep Kumar Chitrapu [Thu, 4 Oct 2018 03:19:20 +0000 (20:19 -0700)]
mac80211: support FTM responder configuration/statistics

New bss param ftm_responder is used to notify the driver to
enable fine timing request (FTM) responder role in AP mode.

Plumb the new cfg80211 API for FTM responder statistics through to
the driver API in mac80211.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Greg Kroah-Hartman [Fri, 12 Oct 2018 10:35:02 +0000 (12:35 +0200)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Dmitry writes:
  "Input updates for v4.19-rc7

   - we added a few scheduling points into various input interfaces to
     ensure that large writes will not cause RCU stalls
   - fixed configuring PS/2 keyboards as wakeup devices on newer
     platforms
   - added a new Xbox gamepad ID."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: uinput - add a schedule point in uinput_inject_events()
  Input: evdev - add a schedule point in evdev_write()
  Input: mousedev - add a schedule point in mousedev_write()
  Input: i8042 - enable keyboard wakeups by default when s2idle is used
  Input: xpad - add support for Xbox1 PDP Camo series gamepad

5 years agoMerge tag 'next-fixes-20181012' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Fri, 12 Oct 2018 10:33:54 +0000 (12:33 +0200)]
Merge tag 'next-fixes-20181012' of git://git.kernel.org/pub/scm/linux/kernel/git/sfr/next-fixes

Stephen writes:
  "A couple of warning fixes:

  Two fixes from Peter Oberparleiter <oberpar@linux.ibm.com>:
    Commit 6b7dca401cb1 ("tracing: Allow gcov profiling on only ftrace subsystem")
   uncovered linker problems when using gcov kernel profiling on some
   architectures. These problems were likely introduced earlier, and are
   possibly related to compiler changes."

* tag 'next-fixes-20181012' of git://git.kernel.org/pub/scm/linux/kernel/git/sfr/next-fixes:
  vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections
  vmlinux.lds.h: Fix incomplete .text.exit discards