diff options
author | Maxim Mikityanskiy <maxtram95@gmail.com> | 2020-01-24 19:15:35 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2020-01-24 19:57:53 +0100 |
commit | 268d3636dfb22254324774de1f8875174b3be064 (patch) | |
tree | e6ce27cdf4115656d14bc5c2fdace00f7c84a027 /net/bluetooth/hci_sock.c | |
parent | 6613babaf662cfbd283fcd0abdd758e338dd181d (diff) |
Bluetooth: btrtl: Use kvmalloc for FW allocations
Currently, kmemdup is applied to the firmware data, and it invokes
kmalloc under the hood. The firmware size and patch_length are big (more
than PAGE_SIZE), and on some low-end systems (like ASUS E202SA) kmalloc
may fail to allocate a contiguous chunk under high memory usage and
fragmentation:
Bluetooth: hci0: RTL: examining hci_ver=06 hci_rev=000a lmp_ver=06 lmp_subver=8821
Bluetooth: hci0: RTL: rom_version status=0 version=1
Bluetooth: hci0: RTL: loading rtl_bt/rtl8821a_fw.bin
kworker/u9:2: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0
<stack trace follows>
As firmware load happens on each resume, Bluetooth will stop working
after several iterations, when the kernel fails to allocate an order-4
page.
This patch replaces kmemdup with kvmalloc+memcpy. It's not required to
have a contiguous chunk here, because it's not mapped to the device
directly.
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_sock.c')
0 files changed, 0 insertions, 0 deletions