I have a driver (yes, it is official wl18xx wifi driver from TI.) that applies page allocation during module init with get_free_pages, but it fails sometimes,
code is like this:
" __get_free_pages(GFP_KERNEL,order); "
order is 4. and the page size is 4k. please refer to the logs.
It just happens sometimes when the driver is probed, not always.
when the issue happens, not sure how many process is running.
The Android version is 4.4.3, kernel 3.10.53, i.MX6dl(NXP) platform.1G RAM.
following are the logs, it seems 64k Continuous memory is available, but why allocation fails?
Is it possible that there is any issue about memory related configurations in uboot?
01-02 08:09:56.340 507 567 D WifiHW : [nFore] WIFI HAL Version : 201503171629
01-02 08:09:56.340 507 567 D WifiHW : [nFore]wifi_load_driver start
01-02 08:09:56.340 507 567 D WifiHW : [nFore]Load /system/lib/modules/wl18xx.ko ...
01-02 08:09:56.374 507 567 I KERNEL : [ 620.220295] WifiStateMachin: page allocation failure: order:4, mode:0xd0
01-02 08:09:56.382
507 567 I KERNEL : [ 620.227523] CPU: 0 PID: 567 Comm: WifiStateMachin Tainted: G O 3.10.53 #1
01-02 08:09:56.395 507 567 I KERNEL : [ 620.239333] [<80013f78>] (unwind_backtrace+0x0/0x11c) from [<80011894>] (show_stack+0x10/0x14)
01-02 08:09:56.410 507 567 I KERNEL : [ 620.254148] [<80011894>] (show_stack+0x10/0x14) from [<8009eba0>] (warn_alloc_failed+0xf4/0x11c)
01-02 08:09:56.420 507 567 I KERNEL : [ 620.263329] [<8009eba0>] (warn_alloc_failed+0xf4/0x11c) from [<800a164c>]
(__alloc_pages_nodemask+0x788/0x7ec) 01-02 08:09:56.432 507 567 I KERNEL : [ 620.275621] [<800a164c>] (__alloc_pages_nodemask+0x788/0x7ec) from [<800a16c0>] (__get_free_pages+0x10/0x24)
01-02 08:09:56.444 507 567 I KERNEL : [ 620.287158] [<800a16c0>] (__get_free_pages+0x10/0x24) from [<7f0bd758>] (wlcore_alloc_hw+0x3d0/0x5dc [wlcore])
01-02 08:09:56.455 507 567 I KERNEL : [ 620.297722] [<7f0bd758>] (wlcore_alloc_hw+0x3d0/0x5dc [wlcore]) from [<7f11a2ec>] (wl18xx_probe+0x1c/0x84 [wl18xx])
01-02 08:09:56.470 507 567 I KERNEL : [ 620.313318] [<7f11a2ec>] (wl18xx_probe+0x1c/0x84 [wl18xx]) from [<80271630>] (platform_drv_probe+0x14/0x18)
01-02 08:09:56.480 507 567 I KERNEL : [ 620.323359] [<80271630>] (platform_drv_probe+0x14/0x18) from [<802703b8>] (driver_probe_device+0x13c/0x37c)
01-02 08:09:56.489 507 567 I KERNEL : [ 620.333194] [<802703b8>] (driver_probe_device+0x13c/0x37c) from [<80270658>] (__driver_attach+0x60/0x84)
01-02 08:09:56.499 507 567 I KERNEL : [ 620.342770] [<80270658>] (__driver_attach+0x60/0x84) from [<8026ea08>] (bus_for_each_dev+0x50/0x90)
01-02 08:09:56.508 507 567 I KERNEL : [ 620.351938] [<8026ea08>] (bus_for_each_dev+0x50/0x90) from [<8026f99c>] (bus_add_driver+0xcc/0x234)
01-02 08:09:56.517 507 567 I KERNEL : [ 620.361069] [<8026f99c>] (bus_add_driver+0xcc/0x234) from [<80270b48>] (driver_register+0x9c/0xe0)
01-02 08:09:56.526 507 567 I KERNEL : [ 620.370157] [<80270b48>] (driver_register+0x9c/0xe0) from [<80008688>] (do_one_initcall+0xc0/0x174)
01-02 08:09:56.535 507 567 I KERNEL : [ 620.379307] [<80008688>] (do_one_initcall+0xc0/0x174) from [<80073f10>] (load_module+0x19d4/0x1c78)
01-02 08:09:56.544
507 567 I KERNEL : [ 620.388481] [<80073f10>] (load_module+0x19d4/0x1c78) from [<800742cc>] (SyS_init_module+0x118/0x128)
01-02 08:09:56.554 507 567 I KERNEL : [ 620.397708] [<800742cc>] (SyS_init_module+0x118/0x128) from [<8000e280>] (ret_fast_syscall+0x0/0x30)
01-02 08:09:56.556
507 567 I KERNEL : [ 620.406888] Mem-info:
01-02 08:09:56.558 507 567 I KERNEL : [ 620.409261] DMA per-cpu:
01-02 08:09:56.563 507 567 I KERNEL : [ 620.411824] CPU 0: hi: 186, btch: 31 usd: 70
01-02 08:09:56.568 507 567 I KERNEL : [ 620.416658] CPU 1: hi: 186, btch: 31 usd: 174
01-02 08:09:56.601 507 567 I KERNEL : [ 620.421544] active_anon:59585 inactive_anon:69 isolated_anon:0
01-02 08:09:56.601 507 567 I KERNEL : [ 620.421544] active_file:38140 inactive_file:69995 isolated_file:0
01-02 08:09:56.601 507 567 I KERNEL : [ 620.421544] unevictable:182 dirty:10 writeback:0 unstable:0
01-02 08:09:56.601 507 567 I KERNEL : [ 620.421544] free:33393 slab_reclaimable:7358 slab_unreclaimable:2617
01-02 08:09:56.601
507 567 I KERNEL : [ 620.421544] mapped:15364 shmem:78 pagetables:2055 bounce:0
01-02 08:09:56.601 507 567 I KERNEL : [ 620.421544] free_cma:30463
01-02 08:09:56.644 507 567 I KERNEL : [ 620.454053] DMA free:133572kB min:3488kB low:7652kB high:8524kB active_anon:238340kB inactive_anon:276kB active_file:152560kB inactive_file:279980kB unevictable:728kB isolated(anon):0kB isolated(file):0kB present:1047552kB managed:761024kB mlocked:0kB dirty:40kB writeback:0kB mapped:61456kB shmem:312kB slab_reclaimable:29432kB slab_unreclaimable:10468kB kernel_stack:4568kB pagetables:8220kB unstable:0kB bounce:0kB free_cma:121852kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
01-02 08:09:56.647 507 567 I KERNEL : [ 620.497711] lowmem_reserve[]:
01-02 08:09:56.647 507 567 I KERNEL : 0
01-02 08:09:56.648 507 567 I KERNEL : 0
01-02 08:09:56.648 507 567 I KERNEL : 0
01-02 08:09:56.648 507
567 I KERNEL : 0
01-02 08:09:56.648 507 567 I KERNEL :
01-02 08:09:56.650 507 567 I KERNEL : [ 620.501502] DMA:
01-02 08:09:56.651 507 567 I KERNEL : 1416*4kB
01-02 08:09:56.651 507 567 I KERNEL : (UEMC)
01-02 08:09:56.652
507 567 I KERNEL : 872*8kB
01-02 08:09:56.653 507 567 I KERNEL : (EMC)
01-02 08:09:56.653 507 567 I KERNEL : 84*16kB
01-02 08:09:56.654 507 567 I KERNEL : (C)
01-02 08:09:56.654 507 567 I KERNEL : 83*32kB
01-02 08:09:56.655
507 567 I KERNEL : (C)
01-02 08:09:56.656 507 567 I KERNEL : 82*64kB
01-02 08:09:56.657 507 567 I KERNEL : (C)
01-02 08:09:56.657 507 567 I KERNEL : 74*128kB
01-02 08:09:56.658 507 567 I KERNEL : (C)
01-02 08:09:56.659 507 567 I KERNEL : 73*256kB
01-02 08:09:56.659 507 567 I KERNEL : (C)
01-02 08:09:56.660 507 567 I KERNEL : 75*512kB
01-02 08:09:56.660 507 567 I KERNEL : (C)
01-02 08:09:56.661 507 567 I KERNEL : 36*1024kB
01-02 08:09:56.661 507 567 I KERNEL : (C)
01-02 08:09:56.662 507 567 I KERNEL : 4*2048kB
01-02 08:09:56.662 507 567 I KERNEL : (C)
01-02 08:09:56.663 507 567 I KERNEL : 0*4096kB
01-02 08:09:56.664 507 567 I KERNEL : 0*8192kB
01-02 08:09:56.665 507 567 I KERNEL : 0*16384kB
01-02 08:09:56.666 507 567 I KERNEL : 0*32768kB
01-02 08:09:56.667 507 567 I KERNEL : = 133504kB
01-02 08:09:56.671 507 567 I KERNEL : [ 620.520349] 108391 total pagecache pages
01-02 08:09:56.674 507 567 I KERNEL : [ 620.524315] 0 pages in swap cache
01-02 08:09:56.680 507 567 I KERNEL : [ 620.527940] Swap cache stats: add 0, delete 0, find 0/0
01-02 08:09:56.683 507 567 I KERNEL : [ 620.533395] Free swap = 0kB
01-02 08:09:56.686 507 567 I KERNEL : [ 620.536303] Total swap = 0kB
01-02 08:09:56.711 507 567 I KERNEL : [ 620.560817] 262144 pages of RAM
01-02 08:09:56.714 507 567 I KERNEL : [ 620.564001] 34415 free pages
01-02 08:09:56.717 507 567 I KERNEL : [ 620.567157] 8211 reserved pages
01-02 08:09:56.720 507 567 I KERNEL : [ 620.570397] 8588 slab pages
01-02 08:09:56.723 507 567 I KERNEL : [ 620.573245] 448023 pages shared
01-02 08:09:56.726
507 567 I KERNEL : [ 620.576430] 0 pages swap cached
01-02 08:09:56.898 507 567 I KERNEL : [ 620.747499] wlcore: ERROR can't allocate hw
01-02 08:09:56.890 507 567 D WifiHW : [nFore]NO FIRMWARE_LOADER... ()
01-02 08:09:56.905 507 567 I KERNEL : [ 620.751760] wl18xx_driver: probe of wl18xx.0.auto failed with error -12
Hi Feifei
one can try to debug it using below resources
WL18xx Driver Debug - Texas Instruments Wiki
wl18xx/mm at master · varigit/wl18xx · GitHub
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------