FYI, If you are interested in where I have gotten with this, let me explain: I have the TL-WN721N plugged into a self powered hub. I am running on a Freescale iMX50_rd3 EVM. I have found that the usb disconnect callback does not always get called, for instance on shutdown. When the device is in the Unresponsive state, I get the folling state output on module load: usb 2-1.3: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272 ath9k_htc 2-1.3:1.0: ath9k_htc: Target is unresponsive Failed to initialize the device usb 2-1.3: ath9k_hif_usb_dev_deinit:1065 ath9k_hif_usb_dev_deinit:1066 usb 2-1.3: ath9k_htc: USB State 7, unplugged = 0, hif_dev->flags = 0 usb 2-1.3: ath9k_htc: USB layer deinitialized I added the log statement to get the state just before the if statement gating the call to reboot: As you can see the unplugged if false but HIF_USB_START is not true, therefore the reboot is not called. I am stuck in this state until I unplug the device. The problem is that I cannot call reboot until hif_usb_start is called. I tried simplifying the conditional to: dev_info(&udev->dev, "ath9k_htc: USB State %d, unplugged = %d, hif_dev->flags = %d\n", udev->state, unplugged, hif_dev->flags); if (!unplugged){ ath9k_hif_usb_reboot(udev); } but that just got me: usb 2-1.3: ath9k_htc: USB State 7, unplugged = 0, hif_dev->flags = 0 ath9k_htc: ath9k_hif_usb_reboot:1200 usb 2-1.3: ath9k_htc: USB reboot failed usb 2-1.3: ath9k_htc: USB layer deinitialized So, it may be that the device is not capable of processing the reboot command in this state. I appologize for my inexperience with the usb apis. /*----------------------------------------*/ Bob Bouterse Senior Software Engineer Multimedia Development Center D&M Holdings Inc. http://www.dm-holdings.com ________________________________________ From: Sujith Manoharan [c_manoha@xxxxxxxxxxxxxxxx] Sent: Monday, May 14, 2012 5:19 AM To: Bouterse, Robert Cc: linux-wireless@xxxxxxxxxxxxxxx Subject: Re: ath9k_htc fails with Robert Bouterse wrote: > I seem to running into this same issue, mine is that the driver emits the > "Target unresponsive" error if the unit is powered-up with the TL-WN721N plugged > in already. I think my issue is that the USB subsytem event is not recieved by > the atk9k_htc driver, and therefore the hardware is not reset. > > Has this ben fixed already? Can you give me the commit sha1 in wireless-testing? > I am using compat-wireless, so I am lagging master a bit. > > If not, can you point me at where in the driver code the reset happens? Maybe I > can come up with a patch. You can play around with the function ath9k_hif_usb_disconnect() in drivers/net/wireless/ath/ath9k/hif_usb.c which has the deinit/reboot code. :) Sujith ÿôèº{.nÇ+?·?®??+%?Ëÿ±éݶ¥?wÿº{.nÇ+?·¥?{±ÿ«zW¬³ø§¶?¡Ü¨}©?²Æ zÚ&j:+v?¨þø¯ù®w¥þ?à2?Þ?¨èÚ&¢)ß¡«a¶Úÿÿûàz¿äz¹Þ?ú+?ù???Ý¢jÿ?wèþf