ashaffer/rt3573sta

Driver exhausts usb device and forces reconnect

Opened this issue · 3 comments

Hi,

I'm having an issue when using the driver with kernel versions > 3.19.0-43 (Ubuntu 14.04). I can compile and install the driver without problems on the later versions but I keep getting disconnects when I'm using the module in conjunction with higher kernel versions. When using it with 3.19.0-43 I don't get any disconnects.

Here some info from dmesg (Running in kernel 3.19.0-51):

[ 1292.265749] ===>rt_ioctl_giwscan. 14(14) BSS returned, data->length = 3292
[ 1307.003370] Bulk In Failed. Status=-71, BIIdx=0x1, BIRIdx=0x1, actual_length= 0x0
[ 1307.003397] usb 3-1: USB disconnect, device number 2
[ 1307.003505] rtusb_disconnect
[ 1307.003507] rtusb_disconnect: unregister usbnet usb-0000:06:00.0-1
[ 1307.003510] RtmpOSNetDevDetach(): RtmpOSNetDeviceDetach(), dev->name=ra0!
[ 1307.003524] MainVirtualIF_close
[ 1307.003526] calling rt28xx_close from CMD_RTPRIV_IOCTL_VIRTUAL_INF_DOWN!
[ 1307.003527] ===> rt28xx_close
[ 1307.003529] ERROR!!! RTMPDrvClose called, setting halt in progress flag!
[ 1307.008536] ERROR!!! BBP read R4=0xffffffff fail
[ 1307.008540] ERROR!!! BBP write R4=0xffffffff fail
[ 1307.008543] ERROR!!! BBP read R1=0xffff8804 fail
[ 1307.008545] ERROR!!! BBP write R1=0xffffffff fail
[ 1307.008567] ERROR!!! BBP write R3=0xffffffff fail
[ 1307.013349] CMDTHREAD_RESET_BULK_IN: Cannot do bulk in because flags(0x300a0542) on !
[ 1307.018563] Retry count exhausted or device removed!!!
[ 1307.018564] Retry count exhausted or device removed!!!
[ 1307.018566] Retry count exhausted or device removed!!!
[ 1307.018567] Retry count exhausted or device removed!!!
[ 1307.068209] --->RTUSBCancelPendingBulkInIRP
[ 1307.068210] RTUSBCancelPendingBulkOut called!
[ 1307.068261] ERROR!!! RtmpOSTaskWait returned false in MlmeThread, setting halt in progress flag!
[ 1307.068333] ERROR!!! RtmpOSTaskWait returned false in RTUSBCmdThread, setting halt in progress flag!
[ 1307.068366] ERROR!!! RtmpOSTaskWait returned false, setting fRTMP_ADAPTER_HALT_IN_PROGRESS flag
[ 1307.068403] RTMPResetTxRxRingMemory called!
[ 1307.103772] ---> RTMPFreeTxRxRingMemory
[ 1307.103775] RTMPFreeUsbBulkBufStruct called
[ 1307.103778] RTMPFreeUsbBulkBufStruct called
[ 1307.103780] RTMPFreeUsbBulkBufStruct called
[ 1307.103781] RTMPFreeUsbBulkBufStruct called
[ 1307.103782] RTMPFreeUsbBulkBufStruct called
[ 1307.103784] RTMPFreeUsbBulkBufStruct called
[ 1307.103785] RTMPFreeUsbBulkBufStruct called
[ 1307.103786] RTMPFreeUsbBulkBufStruct called
[ 1307.103787] RTMPFreeUsbBulkBufStruct called
[ 1307.103789] RTMPFreeUsbBulkBufStruct called
[ 1307.103791] RTMPFreeUsbBulkBufStruct called
[ 1307.103792] RTMPFreeUsbBulkBufStruct called
[ 1307.103793] RTMPFreeUsbBulkBufStruct called
[ 1307.103795] RTMPFreeUsbBulkBufStruct called
[ 1307.103797] <--- RTMPFreeTxRxRingMemory
[ 1307.103828] RTUSB disconnect successfully
[ 1307.343629] usb 3-1: new high-speed USB device number 4 using xhci_hcd
[ 1307.489182] usb 3-1: New USB device found, idVendor=0b05, idProduct=17ad
[ 1307.489196] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1307.489199] usb 3-1: Product: 802.11 n WLAN
[ 1307.489201] usb 3-1: Manufacturer: Ralink
[ 1307.489203] usb 3-1: SerialNumber: 1.0

The driver somehow exhausts the device and forces it to reconnect the USB as it was removed and inserted again. These reconnections come regularly with some minutes apart.

The error doesn't appear in kernel version 3.19.0-43 (x64) but in 49 and up it appears. I have an Asus USB-N66 wireless usb.

Can you please take a look at this?

BR / No-0n3

Hey, thanks for the info. Unfortunately i'm no longer using this device myself so I can't really debug it very easily. I'd be happy to accept a pull request if you manage to track it down though.

I'd suggest maybe narrowing it down to the most specific kernel version that you can, and then combing over the changelogs and diffs of network/hardware related code to see if you can spot something that seems like the culprit. You can also search for all these prints in the code itself, it's actually somewhat reasonably well documented.

Sorry I can't be of more help on this.

Hi,

The error "Bulk In Failed. Status=-71, BIIdx=0x1, BIRIdx=0x1, actual_length= 0x0" is raised in the file os/linux/rt_usb.c:429, where any or several flags in the if statement are true.

The origin of the error can be with line 392 when Status-variable is set with the status code gotten from pUrb.

When the error occurs it gets the status -71 from pUrb. I could use some guidence so you know.

I'm checking what -71 status means right now in the includes.

Couldn't find any info... status triggers to run the else statement and some of the flags in RTMP_TEST_FLAG are set to true which triggers the code that executes the reset of the device.

I can't do so much more, don't know so much about this chip.