Commit Graph

24739 Commits

Author SHA1 Message Date
Tao Huang
3430c68a33 Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (660 commits)
  ANDROID: keychord: Check for write data size
  ANDROID: sdcardfs: Set num in extension_details during make_item
  ANDROID: sdcardfs: Hold i_mutex for i_size_write
  BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck64-XTS
  BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck128-XTS
  BACKPORT, FROMGIT: crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS
  FROMGIT: crypto: speck - export common helpers
  BACKPORT, FROMGIT: crypto: speck - add support for the Speck block cipher
  UPSTREAM: ANDROID: binder: synchronize_rcu() when using POLLFREE.
  f2fs: updates on v4.16-rc1
  BACKPORT: tee: shm: Potential NULL dereference calling tee_shm_register()
  BACKPORT: tee: shm: don't put_page on null shm->pages
  BACKPORT: tee: shm: make function __tee_shm_alloc static
  BACKPORT: tee: optee: check type of registered shared memory
  BACKPORT: tee: add start argument to shm_register callback
  BACKPORT: tee: optee: fix header dependencies
  BACKPORT: tee: shm: inline tee_shm_get_id()
  BACKPORT: tee: use reference counting for tee_context
  BACKPORT: tee: optee: enable dynamic SHM support
  BACKPORT: tee: optee: add optee-specific shared pool implementation
  ...

Conflicts:
	drivers/irqchip/Kconfig
	drivers/media/i2c/tc35874x.c
	drivers/media/v4l2-core/v4l2-compat-ioctl32.c
	drivers/usb/gadget/function/f_fs.c
	fs/f2fs/node.c

Change-Id: Icecd73a515821b536fa3d81ea91b63d9b3699916
2018-03-09 19:10:14 +08:00
Amit Pundir
24740dab5c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

Conflicts:
    fs/f2fs/extent_cache.c
        Pick changes from AOSP Change-Id: Icd8a85ac0c19a8aa25cd2591a12b4e9b85bdf1c5
        ("f2fs: catch up to v4.14-rc1")

    fs/f2fs/namei.c
        Pick changes from AOSP F2FS backport commit 7d5c08fd91
        ("f2fs: backport from (4c1fad64 - Merge tag 'for-f2fs-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs)")
2018-03-05 20:20:17 +05:30
Arnd Bergmann
d3843789e7 wireless: cw1200: use __maybe_unused to hide pm functions_
commit 836856e3bd upstream.

The cw1200 uses #ifdef to check for CONFIG_PM, but then
uses SIMPLE_DEV_PM_OPS, which leaves the references out when
CONFIG_PM_SLEEP is not defined, so we get a warning with
PM=y && PM_SLEEP=n:

drivers/net/wireless/st/cw1200/cw1200_spi.c:450:12: error: 'cw1200_spi_suspend' defined but not used [-Werror=unused-function]

This removes the incorrect #ifdef and instead uses a __maybe_unused
annotation to let the compiler know it can silently drop
the function definition.

For the DEV_PM_OPS definition, we can use an IS_ENABLED() check
to avoid defining the structure when CONFIG_PM is not set without
the #ifdef.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25 11:03:50 +01:00
Arnd Bergmann
6420c014ed cw1200: fix bogus maybe-uninitialized warning
commit 7fc1503c90 upstream.

On x86, the cw1200 driver produces a rather silly warning about the
possible use of the 'ret' variable without an initialization
presumably after being confused by the architecture specific definition
of WARN_ON:

drivers/net/wireless/st/cw1200/wsm.c: In function ‘wsm_handle_rx’:
drivers/net/wireless/st/cw1200/wsm.c:1457:9: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

We have already checked that 'count' is larger than 0 here, so
we know that 'ret' is initialized. Changing the 'for' loop
into do/while also makes this clear to the compiler.

Suggested-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25 11:03:50 +01:00
Arnd Bergmann
5d62b755c3 rtlwifi: fix gcc-6 indentation warning
commit 2acd846485 upstream.

The rtl8821ae_dm_txpower_tracking_callback_thermalmeter function
contains a call to RT_TRACE() that is indented in a misleading
way, as pointed out by a gcc-6 warning:

drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c: In function 'rtl8821ae_dm_txpower_tracking_callback_thermalmeter':
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c:2491:4: error: statement is indented as if it were guarded by...
    RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
    ^~~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c:2488:3: note: ...this 'for' clause, but it is not
   for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++)
   ^~~

It is clear from the context that the call was not meant to be
part of the loop and only the indentation is wrong, so this
removes the extra tabs.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25 11:03:47 +01:00
Larry Finger
4f62fb888d rtlwifi: rtl8821ae: Fix connection lost problem correctly
commit c713fb071e upstream.

There has been a coding error in rtl8821ae since it was first introduced,
namely that an 8-bit register was read using a 16-bit read in
_rtl8821ae_dbi_read(). This error was fixed with commit 40b368af4b
("rtlwifi: Fix alignment issues"); however, this change led to
instability in the connection. To restore stability, this change
was reverted in commit b8b8b16352 ("rtlwifi: rtl8821ae: Fix connection
lost problem").

Unfortunately, the unaligned access causes machine checks in ARM
architecture, and we were finally forced to find the actual cause of the
problem on x86 platforms. Following a suggestion from Pkshih
<pkshih@realtek.com>, it was found that increasing the ASPM L1
latency from 0 to 7 fixed the instability. This parameter was varied to
see if a smaller value would work; however, it appears that 7 is the
safest value. A new symbol is defined for this quantity, thus it can be
easily changed if necessary.

Fixes: b8b8b16352 ("rtlwifi: rtl8821ae: Fix connection lost problem")
Cc: Stable <stable@vger.kernel.org> # 4.14+
Fix-suggested-by: Pkshih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: James Cameron <quozl@laptop.org>  # x86_64 OLPC NL3
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22 15:45:00 +01:00
Tao Huang
1dd2b51cdf net/wireless/rockchip_wlan: fix compile warning
Change-Id: Ife9d64914e2986a07a649064ee0141d83fea69e2
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-02-11 19:21:16 +08:00
xxh
1ee5e73c0e net: wireless: rockchip_wlan: fix bcmdhd driver for GTS
Change-Id: I63173d9c83a2cd2e722dc279f18b226aff3595bf
Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
2018-02-01 10:02:44 +08:00
Tao Huang
f9eefeeaa7 rk: add SPDX license identifier to files with no license
Change-Id: I754250669891307b0deab2bdab1bd01512713f79
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-01-31 20:56:06 +08:00
Tao Huang
640193f76b Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (733 commits)
  LSK-ANDROID: memcg: Remove wrong ->attach callback
  LSK-ANDROID: arm64: mm: Fix __create_pgd_mapping() call
  ANDROID: sdcardfs: Move default_normal to superblock
  blkdev: Refactoring block io latency histogram codes
  FROMLIST: arm64: kpti: Fix the interaction between ASID switching and software PAN
  FROMLIST: arm64: Move post_ttbr_update_workaround to C code
  FROMLIST: arm64: mm: Rename post_ttbr0_update_workaround
  sched: EAS: Initialize push_task as NULL to avoid direct reference on out_unlock path
  fscrypt: updates on 4.15-rc4
  ANDROID: uid_sys_stats: fix the comment
  BACKPORT: tee: indicate privileged dev in gen_caps
  BACKPORT: tee: optee: sync with new naming of interrupts
  BACKPORT: tee: tee_shm: Constify dma_buf_ops structures.
  BACKPORT: tee: optee: interruptible RPC sleep
  BACKPORT: tee: optee: add const to tee_driver_ops and tee_desc structures
  BACKPORT: tee.txt: standardize document format
  BACKPORT: tee: add forward declaration for struct device
  BACKPORT: tee: optee: fix uninitialized symbol 'parg'
  BACKPORT: tee: add ARM_SMCCC dependency
  BACKPORT: selinux: nlmsgtab: add SOCK_DESTROY to the netlink mapping tables
  ...

Conflicts:
	arch/arm64/kernel/vdso.c
	drivers/usb/host/xhci-plat.c
	include/drm/drmP.h
	include/linux/kasan.h
	kernel/time/timekeeping.c
	mm/kasan/kasan.c
	security/selinux/nlmsgtab.c

Also add this commit:
0bcdc0987c ("time: Fix ktime_get_raw() incorrect base accumulation")
2018-01-26 19:26:47 +08:00
Alex Zhao
6b8e6ee695 net: wireless: rockchip_wlan: add WIFI_FEATURE_LINK_LAYER_STATS support
Change-Id: I97334e69270e280f39236eebee7663e08b78d6be
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2018-01-24 09:23:36 +08:00
Ruoming, Wang
083714b03a rtl8189fs: Solve rtl8189fs compile error
Change-Id: I591c9d381d2eb983578eaadb4d27f66a256b12ec
Signed-off-by: Ruoming, Wang <wrm@rock-chips.com>
2018-01-05 17:37:22 +08:00
Xu Xuehui
f4b0c45cc4 net: wireless: rockchip_wlan: fix ap6212a/ap6212 connect ap fail
The ap6212a/ap6212 firmware can not support MFP protocol

Change-Id: I9835e7da0e7dbac6554f75ff28c3c3e9e785f39d
Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
2018-01-05 11:01:54 +08:00
Xu Xuehui
6055719454 Revert "net: wireless: rockchip_wlan: ap6255: fix irq abnormal."
This reverts commit a7e71a03cf

Change-Id: I50ef1401a18c71acaddaf8dbda1c525d71ba4392
Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
2017-12-27 19:28:37 +08:00
Alex Shi
317c5652a7 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-12-21 12:06:53 +08:00
xxh
21ff1d170f net: wireless: rockchip_wlan: fix bcmdhd driver spin lock issue
stack backtrace:
[   95.323698] BUG: scheduling while atomic: dhd_dpc/307/0xfffffe00
[   95.323739] Modules linked in: bcmdhd
[   95.323775] CPU: 3 PID: 307 Comm: dhd_dpc Tainted: G        W       4.4.103 #13
[   95.323792] Hardware name: Rockchip RK3328 EVB (DT)
[   95.323807] Call trace:
[   95.323838] [<ffffff80080896ac>] dump_backtrace+0x0/0x1cc
[   95.323863] [<ffffff800808988c>] show_stack+0x14/0x1c
[   95.323889] [<ffffff80083830b8>] dump_stack+0x94/0xb4
[   95.323915] [<ffffff80080c58c0>] __schedule_bug+0x40/0x54
[   95.323941] [<ffffff8008b0c250>] __schedule+0x8c/0x6f0
[   95.323964] [<ffffff8008b0c934>] schedule+0x80/0xa0
[   95.323991] [<ffffff8008b0f258>] schedule_timeout+0x3c/0x260
[   95.324015] [<ffffff8008b0d48c>] wait_for_common+0x130/0x168
[   95.324040] [<ffffff8008b0d4d8>] wait_for_completion+0x14/0x1c
[   95.324066] [<ffffff800876947c>] mmc_wait_for_req+0x84/0x160
[   95.324091] [<ffffff8008774518>] mmc_io_rw_extended+0x26c/0x2ec
[   95.324117] [<ffffff8008775958>] sdio_io_rw_ext_helper+0x14c/0x1a0
[   95.324141] [<ffffff8008775b50>] sdio_readsb+0x1c/0x24
[   95.325601] [<ffffff8000b5d480>] sdioh_buffer_tofrom_bus+0xc0/0x238 [bcmdhd]
[   95.327078] [<ffffff8000b5e910>] sdioh_request_buffer+0x1c0/0x360 [bcmdhd]
[   95.328529] [<ffffff8000b5c1c8>] bcmsdh_recv_buf+0x88/0xc0 [bcmdhd]
[   95.329991] [<ffffff8000b6412c>] dhd_bcmsdh_recv_buf.constprop.25+0x64/0x98 [bcmdhd]
[   95.331444] [<ffffff8000b66fb8>] dhdsdio_readframes+0x908/0x14e0 [bcmdhd]
[   95.332916] [<ffffff8000b6bc20>] dhd_bus_dpc+0x6c0/0xb80 [bcmdhd]
[   95.334004] [<ffffff8000b35cd8>] dhd_dpc_thread+0x128/0x1a0 [bcmdhd]
[   95.334023] [<ffffff80080bc6e4>] kthread+0xe8/0xf0
[   95.334035] [<ffffff80080828d0>] ret_from_fork+0x10/0x40

Change-Id: I56c837ca08e946970b873e72cc87150592d5eaad
Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
2017-12-21 09:18:41 +08:00
Miaoqing Pan
a815c0a370 ath9k: fix tx99 potential info leak
[ Upstream commit ee0a47186e ]

When the user sets count to zero the string buffer would remain
completely uninitialized which causes the kernel to parse its
own stack data, potentially leading to an info leak. In addition
to that, the string might be not terminated properly when the
user data does not contain a 0-terminator.

Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
Reviewed-by: Christoph Böhmwalder <christoph@boehmwalder.at>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-20 10:05:01 +01:00
Alex Shi
2cea360fea Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-12-19 13:08:40 +08:00
Ben Hutchings
32f8870cc9 mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl()
[ Upstream commit 67bd523861 ]

hwsim_new_radio_nl() now copies the name attribute in order to add a
null-terminator.  mac80211_hwsim_new_radio() (indirectly) copies it
again into the net_device structure, so the first copy is not used or
freed later.  Free the first copy before returning.

Fixes: ff4dd73dd2 ("mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-16 10:33:54 +01:00
Caesar Wang
848ba9f9b3 net: wireless: rockchip_wlan: fixes the warning with gcc-7.2 build
when used the arm-linux-gnueabihf-gcc-7.2.1, had the below
warning information:

1) drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/siutils.c:607:14:
    warning: self-comparison always evaluates to false
    [-Wtautological-compare]

2) drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_common.c:3583:16:
    warning: comparison between pointer and zero character constant
    [-Wpointer-compare] error, forbidden warning: dhd_common.c:3583

Change-Id: Ida287252b7f20b17b68365b965edbff63ae7cbf9
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-12-14 15:36:23 +08:00
Tao Huang
210c1a7480 net: wireless: rockchip_wlan: fix compilation warning for !PM_SLEEP
Change-Id: Ia37c81cc6cabe3bd4ea6048fd9102ea36808dd5b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:42:42 +08:00
Alex Zhao
26da30df33 net: wireless: rockchip_wlan: add network wakeup for 8188eu/8723cs/8723ds
Change-Id: Ib1bd1258a793932a42c0dd4809f7610f34f87fa5
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-12-04 10:41:39 +08:00
Tao Huang
afd240d168 Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (510 commits)
  Linux 4.4.103
  Revert "sctp: do not peel off an assoc from one netns to another one"
  xen: xenbus driver must not accept invalid transaction ids
  s390/kbuild: enable modversions for symbols exported from asm
  ASoC: wm_adsp: Don't overrun firmware file buffer when reading region data
  btrfs: return the actual error value from from btrfs_uuid_tree_iterate
  ASoC: rsnd: don't double free kctrl
  netfilter: nf_tables: fix oob access
  netfilter: nft_queue: use raw_smp_processor_id()
  spi: SPI_FSL_DSPI should depend on HAS_DMA
  staging: iio: cdc: fix improper return value
  iio: light: fix improper return value
  mac80211: Suppress NEW_PEER_CANDIDATE event if no room
  mac80211: Remove invalid flag operations in mesh TSF synchronization
  drm: Apply range restriction after color adjustment when allocation
  ALSA: hda - Apply ALC269_FIXUP_NO_SHUTUP on HDA_FIXUP_ACT_PROBE
  ath10k: set CTS protection VDEV param only if VDEV is up
  ath10k: fix potential memory leak in ath10k_wmi_tlv_op_pull_fw_stats()
  ath10k: ignore configuring the incorrect board_id
  ath10k: fix incorrect txpower set by P2P_DEVICE interface
  ...

Conflicts:
	drivers/media/v4l2-core/v4l2-ctrls.c
	kernel/sched/fair.c

Change-Id: I48152b2a0ab1f9f07e1da7823119b94f9b9e1751
2017-12-01 11:04:13 +08:00
Alex Shi
0f646885c3 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-12-01 01:02:04 +08:00
Bartosz Markowski
7e920566c3 ath10k: set CTS protection VDEV param only if VDEV is up
[ Upstream commit 7cfe0455ee ]

The cts protection vdev parameter, in new QCA9377 TF2.0 firmware,
requires bss peer to be created for the STATION vdev type.
bss peer is being allocated by the firmware after vdev_start/_up commands.
mac80211 may call the cts protection setup at any time, so the
we needs to track the situation and defer the cts configuration
to prevent firmware asserts, like below:

[00]: 0x05020001 0x000015B3 0x0099ACE2 0x00955B31
[04]: 0x0099ACE2 0x00060730 0x00000004 0x00000000
[08]: 0x0044C754 0x00412C10 0x00000000 0x00409C54
[12]: 0x00000009 0x00000000 0x00952F6C 0x00952F77
[16]: 0x00952CC4 0x00910712 0x00000000 0x00000000
[20]: 0x4099ACE2 0x0040E858 0x00421254 0x004127F4
[24]: 0x8099B9B2 0x0040E8B8 0x00000000 0xC099ACE2
[28]: 0x800B75CB 0x0040E8F8 0x00000007 0x00005008
[32]: 0x809B048A 0x0040E958 0x00000010 0x00433B10
[36]: 0x809AFBBC 0x0040E9A8 0x0042BB74 0x0042BBBC
[40]: 0x8091D252 0x0040E9C8 0x0042BBBC 0x00000001
[44]: 0x809FFA45 0x0040EA78 0x0043D3E4 0x0042C2C8
[48]: 0x809FCEF4 0x0040EA98 0x0043D3E4 0x00000001
[52]: 0x80911210 0x0040EAE8 0x00000010 0x004041D0
[56]: 0x80911154 0x0040EB28 0x00400000 0x00000000

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:37:26 +00:00
Christian Lamparter
ef751ca546 ath10k: fix potential memory leak in ath10k_wmi_tlv_op_pull_fw_stats()
[ Upstream commit 097e46d2ae ]

ath10k_wmi_tlv_op_pull_fw_stats() uses tb = ath10k_wmi_tlv_parse_alloc(...)
function, which allocates memory. If any of the three error-paths are
taken, this tb needs to be freed.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:37:26 +00:00
Ryan Hsu
b24769300a ath10k: ignore configuring the incorrect board_id
[ Upstream commit d2e202c06c ]

With command to get board_id from otp, in the case of following

  boot get otp board id result 0x00000000 board_id 0 chip_id 0
  boot using board name 'bus=pci,bmi-chip-id=0,bmi-board-id=0"
  ...
  failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-board-id=0 from
  ath10k/QCA6174/hw3.0/board-2.bin

The invalid board_id=0 will be used as index to search in the board-2.bin.

Ignore the case with board_id=0, as it means the otp is not carrying
the board id information.

Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:37:26 +00:00
Ryan Hsu
64b22ee723 ath10k: fix incorrect txpower set by P2P_DEVICE interface
[ Upstream commit 88407beb1b ]

Ath10k reports the phy capability that supports P2P_DEVICE interface.

When we use the P2P supported wpa_supplicant to start connection, it'll
create two interfaces, one is wlan0 (vdev_id=0) and one is P2P_DEVICE
p2p-dev-wlan0 which is for p2p control channel (vdev_id=1).

	ath10k_pci mac vdev create 0 (add interface) type 2 subtype 0
	ath10k_add_interface: vdev_id: 0, txpower: 0, bss_power: 0
	...
	ath10k_pci mac vdev create 1 (add interface) type 2 subtype 1
	ath10k_add_interface: vdev_id: 1, txpower: 0, bss_power: 0

And the txpower in per vif bss_conf will only be set to valid tx power when
the interface is assigned with channel_ctx.

But this P2P_DEVICE interface will never be used for any connection, so
that the uninitialized bss_conf.txpower=0 is assinged to the
arvif->txpower when interface created.

Since the txpower configuration is firmware per physical interface.
So the smallest txpower of all vifs will be the one limit the tx power
of the physical device, that causing the low txpower issue on other
active interfaces.

	wlan0: Limiting TX power to 21 (24 - 3) dBm
	ath10k_pci mac vdev_id 0 txpower 21
	ath10k_mac_txpower_recalc: vdev_id: 1, txpower: 0
	ath10k_mac_txpower_recalc: vdev_id: 0, txpower: 21
	ath10k_pci mac txpower 0

This issue only happens when we use the wpa_supplicant that supports
P2P or if we use the iw tool to create the control P2P_DEVICE interface.

Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:37:26 +00:00
Arnd Bergmann
f1be210210 rtlwifi: fix uninitialized rtlhal->last_suspend_sec time
commit 3f2a162fab upstream.

We set rtlhal->last_suspend_sec to an uninitialized stack variable,
but unfortunately gcc never warned about this, I only found it
while working on another patch. I opened a gcc bug for this.

Presumably the value of rtlhal->last_suspend_sec is not all that
important, but it does get used, so we probably want the
patch backported to stable kernels.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82839
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:37:21 +00:00
Larry Finger
3c260c60d2 rtlwifi: rtl8192ee: Fix memory leak when loading firmware
commit 519ce2f933 upstream.

In routine rtl92ee_set_fw_rsvdpagepkt(), the driver allocates an skb, but
never calls rtl_cmd_send_packet(), which will free the buffer. All other
rtlwifi drivers perform this operation correctly.

This problem has been in the driver since it was included in the kernel.
Fortunately, each firmware load only leaks 4 buffers, which likely
explains why it has not previously been detected.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:37:21 +00:00
Alex Zhao
60b3b75a43 net: wireless: rockchip_wlan: update rtl8188eu
update wifi driver to v5.2.2.3_24783.20171030

Change-Id: I6fb8d8791ecdd7a51349a7696b98942dfdcd29f7
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-29 17:30:35 +08:00
Chris Zhong
ac042485f4 net: wireless: rockchip_wlan: fix compile warning
fix this compile warning:
drivers/net/wireless/rockchip_wlan/rtl8189fs/core/rtw_p2p.c:3518:31:
warning: comparison of constant ‘3’ with boolean expression is alwa
false [-Wbool-compare] error, forbidden warning: rtw_p2p.c:3518

Change-Id: Ic900425434f3ae0069237bbe6d3cb8242e31ed0f
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2017-11-29 11:47:45 +08:00
Alex Zhao
96f622feda net: wireless: rockchip_wlan: add WEXT support for wifi pcba test
Change-Id: Id340b4765f623415384129d7f031d322c8789187
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-21 16:58:11 +08:00
Amit Pundir
839f249169 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Conflicts due to AOSP's backported commits:
    fs/f2fs/crypto.c
    fs/f2fs/crypto_fname.c
        Deleted by AOSP commit c1286ff41c ("f2fs: backport from (4c1fad64 -
        Merge tag 'for-f2fs-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs)")

    fs/f2fs/crypto_key.c
    fs/f2fs/data.c
    fs/f2fs/file.c
        AOSP commit 13f002354d ("f2fs: catch up to v4.14-rc1")
        override most of stable 4.4.y changes.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2017-11-20 20:53:19 +05:30
Chi-hsien Lin
7ecc076a5d brcmfmac: remove setting IBSS mode when stopping AP
commit 9029679f66 upstream.

Upon stopping an AP interface the driver disable INFRA mode effectively
setting the interface in IBSS mode. However, this may affect other
interfaces running in INFRA mode. For instance, if user creates and stops
hostap daemon on virtual interface, then association cannot work on
primary interface because default BSS has been set to IBSS mode in
firmware side. The IBSS mode should be set when cfg80211 changes the
interface.

Reviewed-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <Chi-Hsien.Lin@cypress.com>
[kvalo@codeaurora.org: rephased commit log based on discussion]
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Cc: Philipp Rosenberger <p.rosenberger@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-18 11:11:07 +01:00
Caesar Wang
aa2cbb707e net: wireless: rockchip_wlan: avoid the unused the print
As the ap6212 used on kylin board, the kylin always got the error log
when we connected the AP. Says:
..
[   70.169440] CFG80211-ERROR) wl_cfg80211_get_station :
    wl_cfg80211_get_station: if_counters not supported ret=-23
[   70.184371] CFG80211-ERROR) wl_cfg80211_get_station :
    wl_cfg80211_get_station: if_counters not supported ret=-23
..

And the normal status, the ap6212 wifi always print the ssid and channel
message for output. Says:
..
[  125.172243] wl_run_escan: LEGACY_SCAN sync ID: 4, bssidx: 0
[  178.181897] wl_run_escan: LEGACY_SCAN sync ID: 5, bssidx: 0
[  241.192452] wl_run_escan: LEGACY_SCAN sync ID: 6, bssidx: 0
..

The AP6212 don't need these logs for default status.

Change-Id: I43455bcc277e380daf15ee91a1436cdc81a95039
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-11-15 19:16:21 +08:00
Alex Zhao
07e3824bd6 net: wireless: rockchip_wlan: update rtl8723cs
update rtl8723cs wifi driver to version v5.2.1.7_25082.20171108_COEX20170626-1a00

Change-Id: Ibe11dcb9b3592dfd7f554c20814b3233da87ff24
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-14 19:25:34 +08:00
Alex Zhao
c56fa46c21 net: wireless: rockchip_wlan: update rtl8723ds
update rtl8723ds wifi driver to version v5.2.15.1_25011.20171107_COEX20171025-2020

Change-Id: Ifbf94c2ebc7c7d8e529910d77f6094d0ae4f7907
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-14 19:25:24 +08:00
Alex Zhao
83605c3fa8 net: wireless: rockchip_wlan: fix country code setup failed
Change-Id: I8cc1b7c3bfd6dc941e0f6f771fcfd3f7eb15cc8e
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-07 09:41:55 +08:00
Tao Huang
6bedca442a Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (546 commits)
  Linux 4.4.93
  x86/alternatives: Fix alt_max_short macro to really be a max()
  USB: serial: console: fix use-after-free after failed setup
  USB: serial: qcserial: add Dell DW5818, DW5819
  USB: serial: option: add support for TP-Link LTE module
  USB: serial: cp210x: add support for ELV TFD500
  USB: serial: ftdi_sio: add id for Cypress WICED dev board
  fix unbalanced page refcounting in bio_map_user_iov
  direct-io: Prevent NULL pointer access in submit_page_section
  usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options
  ALSA: line6: Fix leftover URB at error-path during probe
  ALSA: caiaq: Fix stray URB at probe error path
  ALSA: seq: Fix copy_from_user() call inside lock
  ALSA: seq: Fix use-after-free at creating a port
  ALSA: usb-audio: Kill stray URB at exiting
  iommu/amd: Finish TLB flush in amd_iommu_unmap()
  usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet
  KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit
  crypto: shash - Fix zero-length shash ahash digest crash
  HID: usbhid: fix out-of-bounds bug
  ...

Conflicts:
	drivers/cpufreq/cpufreq-dt.c
	drivers/usb/dwc3/gadget.c

Change-Id: I1a24ad0bba307b56b5ddf1fd7c4832ffb73ad12f
2017-11-02 17:00:07 +08:00
Alex Zhao
03f831b6c8 net: wireless: rockchip_wlan: wifi work as ko module
select CFG80211 and MAC80211 when CONFIG_WIFI_BUILD_MODULE is set

Change-Id: I42acf5d554223b13c0c689b8edae15b4a7a57a70
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-01 16:08:13 +08:00
Alex Zhao
d0eaf0d99e net: wireless: rockchip_wlan: add CONFIG_WIFI_BUILD_MODULE
support compile wifi driver as ko module

Change-Id: Idfb9951f2851dee51e8cc88ad938301f280119dd
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-10-31 10:48:25 +08:00
Larry Finger
51ba40fcfd rtlwifi: rtl8821ae: Fix connection lost problem
commit b8b8b16352 upstream.

In commit 40b368af4b ("rtlwifi: Fix alignment issues"), the read
of REG_DBI_READ was changed from 16 to 8 bits. For unknown reasonsi
this change results in reduced stability for the wireless connection.
This regression was located using bisection.

Fixes: 40b368af4b ("rtlwifi: Fix alignment issues")
Reported-and-tested-by: James Cameron <quozl@laptop.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-27 10:23:17 +02:00
Arnd Bergmann
260b6739e8 brcmsmac: make some local variables 'static const' to reduce stack size
commit c503dd38f8 upstream.

With KASAN and a couple of other patches applied, this driver is one
of the few remaining ones that actually use more than 2048 bytes of
kernel stack:

broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy_gainctrl':
broadcom/brcm80211/brcmsmac/phy/phy_n.c:16065:1: warning: the frame size of 3264 bytes is larger than 2048 bytes [-Wframe-larger-than=]
broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy':
broadcom/brcm80211/brcmsmac/phy/phy_n.c:17138:1: warning: the frame size of 2864 bytes is larger than 2048 bytes [-Wframe-larger-than=]

Here, I'm reducing the stack size by marking as many local variables as
'static const' as I can without changing the actual code.

This is the first of three patches to improve the stack usage in this
driver. It would be good to have this backported to stabl kernels
to get all drivers in 'allmodconfig' below the 2048 byte limit so
we can turn on the frame warning again globally, but I realize that
the patch is larger than the normal limit for stable backports.

The other two patches do not need to be backported.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-27 10:23:16 +02:00
Alex Zhao
ab82abc4c1 net: wireless: rockchip_wlan: update bcmdhd driver to 1.579.77.41.2 (r)
1.add android 8.0 support
2.add VTS support

Change-Id: I19b99383e2b2cab243c2acfe0f9f175cde2bdf86
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-10-23 10:45:19 +08:00
Johannes Berg
3e8c1a04d3 mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length
[ Upstream commit ff4dd73dd2 ]

Unfortunately, the nla policy was defined to have HWSIM_ATTR_RADIO_NAME
as an NLA_STRING, rather than NLA_NUL_STRING, so we can't use it as a
NUL-terminated string in the kernel.

Rather than break the API, kasprintf() the string to a new buffer to
guarantee NUL termination.

Reported-by: Andrew Zaborowski <andrew.zaborowski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-21 17:09:04 +02:00
Alex Shi
ce6cd7bc4a Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-10-19 14:23:10 +08:00
Luca Coelho
45bd4e4080 iwlwifi: mvm: use IWL_HCMD_NOCOPY for MCAST_FILTER_CMD
commit 97bce57bd7 upstream.

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

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18 09:20:41 +02:00
Arend Van Spriel
6721969c7b brcmfmac: add length check in brcmf_cfg80211_escan_handler()
commit 17df6453d4 upstream.

Upon handling the firmware notification for scans the length was
checked properly and may result in corrupting kernel heap memory
due to buffer overruns. This fix addresses CVE-2017-0786.

Cc: Kevin Cernekee <cernekee@chromium.org>
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18 09:20:40 +02:00
Alex Shi
80cd9be34a Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Conflicts:
	included wakeup_reason.h file of 57caa2ad5c in kernel/power/process.c
2017-10-13 23:14:45 +08:00