This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB WiFi problem on AM17x

 

I'm trying to use USB WiFi dongle RT3370USB on AM17x. 

RT3370USB WiFi dongle is mounted on the AM17x evaluation module (EVM), I am monitoring the log data on the PC via RS232C from EVM.

I have an initialization problem when I make the dongle awake by ifconfig command.

 

At first I compiled the wifi driver for ARM processor and made the loadable module(rt3370sta.ko)

Then, I could install the module on AM17x EVM correctly. And I sent the command 

[ifconfig ra0 up] to enable the WiFi module. But the following error massages appeared on the display.

 

-------------------------------------

root@arago:~# insmod /etc/Wireless/RT2870STA/os/linux/rt3370sta.ko

rtusb init --->



=== pAd = c2a5e000, size = 477328 ===


<-- RTMPAllocAdapterBlock, Status=0

usbcore: registered new interface driver rt2870

root@arago:~# ifconfig ra0 up

ifconfig: page allocation failure. order:6, mode:0x4020

Backtrace:

[<c002f718>] (dump_backtrace+0x0/0x114) from [<c033224c>] (dump_stack+0x18/0x1c)

 r7:00000006 r6:00004020 r5:003fffff r4:00000000

[<c0332234>] (dump_stack+0x0/0x1c) from [<c0078c68>] (__alloc_pages_nodemask+0x4b0/0x514)

[<c00787b8>] (__alloc_pages_nodemask+0x0/0x514) from [<c0078ce4>] (__get_free_pages+0x18/0x44)

[<c0078ccc>] (__get_free_pages+0x0/0x44) from [<c009e2ec>] (__kmalloc+0x40/0xe0)

[<c009e2ac>] (__kmalloc+0x0/0xe0) from [<c01eee2c>] (hcd_buffer_alloc+0x50/0xa0)

 r8:c2a5e000 r7:00000002 r6:00000004 r5:00000001 r4:00000020

[<c01eeddc>] (hcd_buffer_alloc+0x0/0xa0) from [<c01e3058>] (usb_buffer_alloc+0x24/0x30)

 r5:00000001 r4:00000000

[<c01e3034>] (usb_buffer_alloc+0x0/0x30) from [<bf082780>] (NICInitTransmit+0xe4/0xc3c [rt3370sta])

[<bf08269c>] (NICInitTransmit+0x0/0xc3c [rt3370sta]) from [<bf0838cc>] (RTMPAllocTxRxRingMemory+0x5c/0xd8 [rt3370sta])

[<bf083870>] (RTMPAllocTxRxRingMemory+0x0/0xd8 [rt3370sta]) from [<bf067318>] (rt28xx_init+0xa8/0x550 [rt3370sta])

 r5:c07c9dac r4:00000000

[<bf067270>] (rt28xx_init+0x0/0x550 [rt3370sta]) from [<bf07789c>] (rt28xx_open+0x3c/0xf0 [rt3370sta])

[<bf077860>] (rt28xx_open+0x0/0xf0 [rt3370sta]) from [<bf077a60>] (MainVirtualIF_open+0x110/0x184 [rt3370sta])

 r5:c1bf7400 r4:c2a5e000

[<bf077950>] (MainVirtualIF_open+0x0/0x184 [rt3370sta]) from [<c02760c4>] (dev_open+0xbc/0x120)

 r5:c2ad5000 r4:c1bf7400

[<c0276008>] (dev_open+0x0/0x120) from [<c0275538>] (dev_change_flags+0x98/0x170)

 r5:00000041 r4:c1bf7400

[<c02754a0>] (dev_change_flags+0x0/0x170) from [<c02bc424>] (devinet_ioctl+0x2f0/0x6a8)

 r7:c07c9e68 r6:c1ff5500 r5:00000001 r4:00000000

[<c02bc134>] (devinet_ioctl+0x0/0x6a8) from [<c02bdc4c>] (inet_ioctl+0xd0/0x108)

[<c02bdb7c>] (inet_ioctl+0x0/0x108) from [<c0263788>] (sock_ioctl+0x1fc/0x254)

 r5:00008914 r4:c06e8700

[<c026358c>] (sock_ioctl+0x0/0x254) from [<c00af604>] (vfs_ioctl+0x34/0xb4)

 r7:c06e8700 r6:beb4abb0 r5:00008914 r4:c06e8700

[<c00af5d0>] (vfs_ioctl+0x0/0xb4) from [<c00afd18>] (do_vfs_ioctl+0x594/0x5f0)

 r7:c06e8700 r6:00000003 r5:c06e8700 r4:00000003

[<c00af784>] (do_vfs_ioctl+0x0/0x5f0) from [<c00afdb4>] (sys_ioctl+0x40/0x64)

[<c00afd74>] (sys_ioctl+0x0/0x64) from [<c002bf20>] (ret_fast_syscall+0x0/0x28)

 r7:00000036 r6:beb4aed4 r5:00000004 r4:0008bbc8

Mem-info:

DMA per-cpu:

CPU    0: hi:    0, btch:   1 usd:   0

active_anon:329 inactive_anon:583 isolated_anon:0

 active_file:1351 inactive_file:2738 isolated_file:0

 unevictable:0 dirty:0 writeback:0 unstable:0

 free:711 slab_reclaimable:134 slab_unreclaimable:448

 mapped:1951 shmem:40 pagetables:42 bounce:0

DMA free:2844kB min:720kB low:900kB high:1080kB active_anon:1316kB inactive_anon:2332kB active_file:5404kB inactive_file:10952kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:32512kB mlocked:0kB dirty:0kB writeback:0kB mapped:7804kB shmem:160kB slab_reclaimable:536kB slab_unreclaimable:1792kB kernel_stack:248kB pagetables:168kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 0

DMA: 195*4kB 120*8kB 37*16kB 0*32kB 0*64kB 0*128kB 2*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 2844kB

4129 total pagecache pages

0 pages in swap cache

Swap cache stats: add 0, delete 0, find 0/0

Free swap  = 0kB

Total swap = 0kB

8192 pages of RAM

772 free pages

1188 reserved pages

424 slab pages

2947 pages shared

0 pages swap cached

<-- ERROR in Alloc TX TxContext[0] HTTX_BUFFER !!

<-- RTMPAllocTxRxRingMemory, Status=3

ERROR!!! RTMPAllocDMAMemory failed, Status[=0x00000003]

!!! rt28xx Initialized fail !!!

ifconfig: SIOCSIFFLAGS: Operation not permitted

-------------------------------------

 

Though I sent the command [ifconfig ra0 up] again, the same above mentioned error 

messages appeared. And then, I sent the command [ifconfig ra0 up] again. I eventually could enable the WiFi module. This behavior was very strange. The log is the following.

 

-------------------------------------

root@arago:~# ifconfig ra0 up

<-- RTMPAllocTxRxRingMemory, Status=0

-->RTUSBVenderReset

<--RTUSBVenderReset

Key1Str is Invalid key length(0) or Type(0)

Key2Str is Invalid key length(0) or Type(0)

Key3Str is Invalid key length(0) or Type(0)

Key4Str is Invalid key length(0) or Type(0)

1. Phy Mode = 5

2. Phy Mode = 5

NVM is Efuse and its size =2d[2d0-2fc]

RTMPSetPhyMode: channel is out of range, use first channel=1

3. Phy Mode = 9

MCS Set = ff 00 00 00 01

<==== rt28xx_init, Status=0

0x1300 = 00064300

-------------------------------------

 

I could also confirm same problem with RT3070USB on AM17x.

RT3070USB is similar device to RT3370USB. 

 

Anyway, I would like to fix this problem. 

Could anyone kindly give a solution?

 

Ryo Suzuki

 

  • Dear swami,

     

    Thank you for your reply.

    I modified the kernel as your suggested and booted our target.

    However, the patched kernel shows no improvement for this issue.

     

    My concern is I changed default config setting to "disable DMA for USB host".

    I will make DMA enabled and try again.

     

    Regards,

    Ryo Suzuki

  • Dear all,

     

    My test environment have enough size of memory for this test.

    However, the enough memory may be fragmentary or reserved for caches by Linux.

    The kernel could not allocate a contiguous block of memory large enough to enable the network I/F.

     

    Just a plan, I(user) can free system caches using following command before "ifconfig ra0 up".

    # sync

    # echo 1 > /proc/sys/vm/drop_caches

    # free

     

    The "ifconfig ra0 up" error seemed to disappear after above commands.

    However, it's preferable that allocation errors are absorbed by kernel or module or driver.., I think.

     

    Or, if need user's care for these kind of issue, please advise me on how to close this issue.