mwifiex: fix driver init failure under memory pressure
authorXinming Hu <huxm@marvell.com>
Fri, 18 Sep 2015 13:32:06 +0000 (06:32 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 29 Sep 2015 07:47:31 +0000 (10:47 +0300)
commit9a9053c3420fcc5779319e4ea267c6dcbf8d7c04
tree32f94e7d3395684ad31b93cd816ecb2e34cd3051
parente3ad3d5b6ab2a9876773fe99d9d1866d3c1744ae
mwifiex: fix driver init failure under memory pressure

64k Tx and Rx buffers are allocated during driver initialization
for SDIO level data aggregations. When host is under memory
pressure situation, kzalloc() request for 64k may fail.

We will try allocating 32k buffers and disable our rx single port
aggreagation feature in this situation.

If the allocation still fails, we will disable our sdio multport
aggregation feature as well. In this way, we will transmit and
receive packets one by one, thus reduce the demand for big
memory.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/main.h
drivers/net/wireless/mwifiex/sdio.c
drivers/net/wireless/mwifiex/sta_cmd.c