On 03/11/2013 04:41 PM, Kalle Valo wrote: > Julien Massot writes: > >>> Julien reported that ar6004 usb device fails to initialise >>> after host has been rebooted and power is still on for the ar6004 device. He >>> found out that doing a cold reset fixes the issue. >>> >>> I wasn't sure what would be the best way to detect if target needs a reset so I >>> settled on checking a timeout from htc_wait_recv_ctrl_message(). >>> >>> Reported-by: Julien Massot >>> Signed-off-by: Kalle Valo >>> --- >> >> This patch fix the issue, now my adapter works after a soft reboot. >> The log are also better: (here is what happen on soft reboot) >> >> [ 17.328029] ath6kl: htc pipe control receive timeout! >> [ 17.328033] ath6kl: htc wait target timed out, resetting device >> [ 17.332178] ath6kl: Failed to start hardware: -110 >> [ 17.332208] ath6kl: Failed to init ath6kl core: -110 >> [ 17.332270] ath6kl_usb: probe of 2-1:1.0 failed with error -110 >> [ 17.332306] usbcore: registered new interface driver ath6kl_usb >> [ 19.040315] ath6kl: ar6004 hw 1.3 usb fw 3.5.0.2356\x01 api 3 > > Oh, I also need to fix that \x01 in the firmware version, the null > termination is incorrect. But this is a separate issue. > >> Tested-by: Julien Massot > > Thank you. I add that to the patch. > Kalle, attached the internally suggested patch with CL explanation, not rebased. During host crashes or some unexpected reasons causing driver reload without unload first, the target firmware will fail to upload again since it never power down or reset by host. We check the host app area to check target status and reset target if needed. -- thanks, shafi