summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMaxim Mikityanskiy <maxtram95@gmail.com>2020-01-24 19:15:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 13:17:29 +0200
commit0c81861ae9036f7343b0f8a4640dedd923af4f9b (patch)
tree3c89937503007b6a396a39c54ec56df26fe56707 /kernel
parent821bf0bf652c8d9de30c7307211e67775ec24ec0 (diff)
Bluetooth: btrtl: Use kvmalloc for FW allocations
[ Upstream commit 268d3636dfb22254324774de1f8875174b3be064 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions