4d04a4da59
[ 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> |
||
---|---|---|
.. | ||
ath3k.c | ||
bcm203x.c | ||
bfusb.c | ||
bluecard_cs.c | ||
bpa10x.c | ||
bt3c_cs.c | ||
btbcm.c | ||
btbcm.h | ||
btintel.c | ||
btintel.h | ||
btmrvl_debugfs.c | ||
btmrvl_drv.h | ||
btmrvl_main.c | ||
btmrvl_sdio.c | ||
btmrvl_sdio.h | ||
btmtkuart.c | ||
btqca.c | ||
btqca.h | ||
btqcomsmd.c | ||
btrsi.c | ||
btrtl.c | ||
btrtl.h | ||
btsdio.c | ||
btusb.c | ||
btwilink.c | ||
dtl1_cs.c | ||
h4_recv.h | ||
hci_ag6xx.c | ||
hci_ath.c | ||
hci_bcm.c | ||
hci_bcsp.c | ||
hci_h4.c | ||
hci_h5.c | ||
hci_intel.c | ||
hci_ldisc.c | ||
hci_ll.c | ||
hci_mrvl.c | ||
hci_nokia.c | ||
hci_qca.c | ||
hci_serdev.c | ||
hci_uart.h | ||
hci_vhci.c | ||
Kconfig | ||
Makefile |