My Linux 2.6.37 application, running on OMAP-L137, requires periodically switching down and up again an USB network interface,
by means of IOCTL calls to the socket interface, exactly as ifconfig utility (ifconfig ra0 down/up).
The USB network device is always firmly tied to the USB connector
All usb signals and power appear to be clean.
Disabling and reenabling the USB network interface is performed by means of a timed thread.
This method usually works for a substantial time, with no console logging reporting problems to USB ,
but sometimes the following problem arises:
[Mon Jul 15 14:32:28.167 2013]<NetSetup>Interface sync 77 [2/0]... <----------------- ra0 interface was correcly disabled
[Mon Jul 15 14:32:29.181 2013] (Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
[Mon Jul 15 14:32:34.048 2013] usb 1-1: USB disconnect, address 2 <----------------------------- USB device disconnected !
[Mon Jul 15 14:32:34.048 2013] #
[Mon Jul 15 14:32:34.063 2013] rtusb_disconnect: unregister usbnet usb-ohci.0-1
[Mon Jul 15 14:32:34.063 2013] RtmpOSNetDevDetach(): RtmpOSNetDeviceDetach(), dev->name=ra0!
[Mon Jul 15 14:32:34.079 2013] #
network interface driver goes on, but is spoilt because usb device removed....
[Mon Jul 15 14:32:34.079 2013] # ReqType=OUT, Req=0x2, Idx=0x404,pAd->Flags=0x100
[Mon Jul 15 14:32:34.095 2013] Request Value=0x0072!
[Mon Jul 15 14:32:34.110 2013] RTMP_TimerListAdd: add timer obj c21448d0!
[Mon Jul 15 14:32:34.110 2013] RTMP_TimerListAdd: add timer obj c2144918!
[Mon Jul 15 14:32:34.126 2013] RTMP_TimerListAdd: add timer obj c2144960!
[Mon Jul 15 14:32:34.126 2013] RTMP_TimerListAdd: add timer obj c2144888!
[Mon Jul 15 14:32:34.126 2013] RTMP_TimerListAdd: add timer obj c21447b0!
[Mon Jul 15 14:32:34.141 2013] RTMP_TimerListAdd: add timer obj c21447f8!
[Mon Jul 15 14:32:34.141 2013] RTMP_TimerListAdd: add timer obj c210f384!
[Mon Jul 15 14:32:34.157 2013] RTMP_TimerListAdd: add timer obj c20fec4c!
[Mon Jul 15 14:32:34.157 2013] RTMP_TimerListAdd: add timer obj c20fec9c!
[Mon Jul 15 14:32:34.157 2013] RTMP_TimerListAdd: add timer obj c210f470!
[Mon Jul 15 14:32:34.173 2013] RTMP_TimerListAdd: add timer obj c210f2f4!
[Mon Jul 15 14:32:34.173 2013] ERROR!!! RTMPSetTimer failed, Halt in Progress!
[Mon Jul 15 14:32:34.188 2013] RTMP_TimerListAdd: add timer obj c210f424!
[Mon Jul 15 14:32:34.188 2013] ERROR!!! NICInitializeAdapter failed, Status[=0x00000001]
<--- network interface driver goes on, but is spoilt because usb device remove
[Mon Jul 15 14:32:34.297 2013] !!! rt28xx Initialized fail !!!
[Mon Jul 15 14:32:34.407 2013] ---> RTMPFreeTxRxRingMemory
[Mon Jul 15 14:32:34.422 2013] <--- RTMPFreeTxRxRingMemory
[Mon Jul 15 14:32:34.438 2013] RTUSB disconnect successfully
[Mon Jul 15 14:32:34.765 2013] usb 1-1: new full speed USB device using ohci and address 3 <--- USB device being reconnected again !!!???
[Mon Jul 15 14:32:34.984 2013] usb 1-1: New USB device found, idVendor=148f, idProduct=3070
[Mon Jul 15 14:32:34.999 2013] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Mon Jul 15 14:32:35.015 2013] usb 1-1: Product: 802.11 n WLAN
[Mon Jul 15 14:32:35.015 2013] usb 1-1: Manufacturer: Ralink
[Mon Jul 15 14:32:35.046 2013] usb 1-1: SerialNumber: 1.0
[Mon Jul 15 14:32:35.124 2013]
[Mon Jul 15 14:32:35.124 2013] USB device reconnectition fails.....
[Mon Jul 15 14:32:35.124 2013] === pAd = c2674000, size = 517448 ===
[Mon Jul 15 14:32:35.124 2013]
[Mon Jul 15 14:32:35.155 2013] khubd: page allocation failure. order:5, mode:0x20
[Mon Jul 15 14:32:35.155 2013] [<c002c624>] (unwind_backtrace+0x0/0xec) from [<c007fe8c>] (__alloc_pages_nodemask+0x4b8/0x510)
[Mon Jul 15 14:32:35.249 2013] [<c007fe8c>] (__alloc_pages_nodemask+0x4b8/0x510) from [<c002ce80>] (__dma_alloc+0xa8/0x284)
[Mon Jul 15 14:32:35.280 2013] [<c002ce80>] (__dma_alloc+0xa8/0x284) from [<c002d0d0>] (dma_alloc_coherent+0x50/0x5c)
[Mon Jul 15 14:32:35.311 2013] [<c002d0d0>] (dma_alloc_coherent+0x50/0x5c) from [<bf083648>] (RTMPAllocUsbBulkBufStruct+0x60/0xa8 [rt3070sta])
[Mon Jul 15 14:32:35.343 2013] [<bf083648>] (RTMPAllocUsbBulkBufStruct+0x60/0xa8 [rt3070sta]) from [<bf083cc4>] (RTMPAllocTxRxRingMemory+0x6c/0x218 [rt3070sta])
[Mon Jul 15 14:32:35.389 2013] [<bf083cc4>] (RTMPAllocTxRxRingMemory+0x6c/0x218 [rt3070sta]) from [<bf045084>] (RTMPAllocAdapterBlock+0x1cc/0x2f0 [rt3070sta])
[Mon Jul 15 14:32:35.436 2013] [<bf045084>] (RTMPAllocAdapterBlock+0x1cc/0x2f0 [rt3070sta]) from [<bf08f1a0>] (rtusb_probe+0x84/0x314 [rt3070sta])
[Mon Jul 15 14:32:35.499 2013] [<bf08f1a0>] (rtusb_probe+0x84/0x314 [rt3070sta]) from [<c0206e38>] (usb_probe_interface+0xc4/0x104)
[Mon Jul 15 14:32:35.545 2013] [<c0206e38>] (usb_probe_interface+0xc4/0x104) from [<c01d560c>] (driver_probe_device+0xb0/0x16c)
[Mon Jul 15 14:32:35.561 2013] [<c01d560c>] (driver_probe_device+0xb0/0x16c) from [<c01d4b8c>] (bus_for_each_drv+0x44/0x80)
[Mon Jul 15 14:32:35.608 2013] [<c01d4b8c>] (bus_for_each_drv+0x44/0x80) from [<c01d5800>] (device_attach+0x50/0x68)
[Mon Jul 15 14:32:35.639 2013] [<c01d5800>] (device_attach+0x50/0x68) from [<c01d4a04>] (bus_probe_device+0x24/0x44)
[Mon Jul 15 14:32:35.639 2013] [<c01d4a04>] (bus_probe_device+0x24/0x44) from [<c01d3588>] (device_add+0x308/0x474)
[Mon Jul 15 14:32:35.748 2013] [<c01d3588>] (device_add+0x308/0x474) from [<c02061d4>] (usb_set_configuration+0x514/0x5ac)
[Mon Jul 15 14:32:35.779 2013] [<c02061d4>] (usb_set_configuration+0x514/0x5ac) from [<c020c7b0>] (generic_probe+0x4c/0x80)
[Mon Jul 15 14:32:35.811 2013] [<c020c7b0>] (generic_probe+0x4c/0x80) from [<c0206488>] (usb_probe_device+0x18/0x1c)
[Mon Jul 15 14:32:35.811 2013] [<c0206488>] (usb_probe_device+0x18/0x1c) from [<c01d560c>] (driver_probe_device+0xb0/0x16c)
[Mon Jul 15 14:32:35.842 2013] [<c01d560c>] (driver_probe_device+0xb0/0x16c) from [<c01d4b8c>] (bus_for_each_drv+0x44/0x80)
[Mon Jul 15 14:32:35.873 2013] [<c01d4b8c>] (bus_for_each_drv+0x44/0x80) from [<c01d5800>] (device_attach+0x50/0x68)
[Mon Jul 15 14:32:35.904 2013] [<c01d5800>] (device_attach+0x50/0x68) from [<c01d4a04>] (bus_probe_device+0x24/0x44)
[Mon Jul 15 14:32:35.920 2013] [<c01d4a04>] (bus_probe_device+0x24/0x44) from [<c01d3588>] (device_add+0x308/0x474)
[Mon Jul 15 14:32:35.935 2013] [<c01d3588>] (device_add+0x308/0x474) from [<c01ffd70>] (usb_new_device+0xd0/0x12c)
[Mon Jul 15 14:32:35.935 2013] [<c01ffd70>] (usb_new_device+0xd0/0x12c) from [<c0200f48>] (hub_thread+0x86c/0xca4)
[Mon Jul 15 14:32:35.951 2013] [<c0200f48>] (hub_thread+0x86c/0xca4) from [<c0053eb4>] (kthread+0x84/0x8c)
[Mon Jul 15 14:32:35.967 2013] [<c0053eb4>] (kthread+0x84/0x8c) from [<c0027fc0>] (kernel_thread_exit+0x0/0x8)
[Mon Jul 15 14:32:35.982 2013] Mem-info:
[Mon Jul 15 14:32:35.982 2013] DMA per-cpu:
[Mon Jul 15 14:32:35.982 2013] CPU 0: hi: 0, btch: 1 usd: 0
[Mon Jul 15 14:32:35.982 2013] active_anon:826 inactive_anon:2 isolated_anon:0
[Mon Jul 15 14:32:35.982 2013] active_file:636 inactive_file:2172 isolated_file:0
[Mon Jul 15 14:32:35.998 2013] unevictable:0 dirty:50 writeback:0 unstable:0
[Mon Jul 15 14:32:35.998 2013] free:457 slab_reclaimable:118 slab_unreclaimable:333
[Mon Jul 15 14:32:35.998 2013] mapped:248 shmem:6 pagetables:44 bounce:0
[Mon Jul 15 14:32:36.013 2013] DMA free:1828kB min:696kB low:868kB high:1044kB active_anon:3304kB inactive_anon:8kB active_file:2544kB inactive_file:8688kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:30480kB mlocked:0kB dirty:200kB writeback:0kB mapped:992kB shmem:24kB slab_reclaimable:472kB slab_unreclaimable:1332kB kernel_stack:464kB pagetables:176kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
[Mon Jul 15 14:32:36.185 2013] lowmem_reserve[]: 0 0 0
[Mon Jul 15 14:32:36.185 2013] DMA: 9*4kB 8*8kB 30*16kB 13*32kB 6*64kB 2*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1636kB
[Mon Jul 15 14:32:36.247 2013] 2884 total pagecache pages
[Mon Jul 15 14:32:36.294 2013] 7680 pages of RAM
[Mon Jul 15 14:32:36.294 2013] 454 free pages
[Mon Jul 15 14:32:36.388 2013] 1111 reserved pages
[Mon Jul 15 14:32:36.388 2013] 352 slab pages
[Mon Jul 15 14:32:36.388 2013] 3561 pages shared
[Mon Jul 15 14:32:36.403 2013] 0 pages swap cached
[Mon Jul 15 14:32:36.403 2013] <-- ERROR in Alloc Bulk buffer for HTTxContext!
[Mon Jul 15 14:32:36.419 2013] ---> RTMPFreeTxRxRingMemory
[Mon Jul 15 14:32:36.419 2013] <--- RTMPFreeTxRxRingMemory
[Mon Jul 15 14:32:36.419 2013] ERROR!!! Failed to allocate memory - TxRxRing
[Mon Jul 15 14:32:36.435 2013] <-- RTMPAllocAdapterBlock, Status=3
[Mon Jul 15 14:32:36.435 2013] rt2870: probe of 1-1:1.0 failed with error -1
[Mon Jul 15 14:32:39.929 2013] <NetSetup>Sync done [3/-1]. <------------ network interface enabling fails...
Can the random USB disconnect/reconnect event have a software explanation ?
How to address such problem ?
Any clue about this isssue is welcome.
Thank you for your attention.