Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k_htc: reboot firmware if it was loaded

Currently ath9k_htc will reboot firmware only if interface was
ever started. Which lead to the problem in case where interface
was never started but module need to be reloaded.

This patch will partially fix bug "ath9k_htc: Target is unresponsive"
https://github.com/qca/open-ath9k-htc-firmware/issues/1

Reproduction case:
- plug adapter
- make sure nothing will touch it. Stop Networkmanager or blacklist mac address of this adapter.
- rmmod ath9k_htc; sleep 1; modprobe ath9k_htc

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Oleksij Rempel and committed by
John W. Linville
4928bd2e dc2a87f5

+3 -1
+3 -1
drivers/net/wireless/ath/ath9k/hif_usb.c
··· 1295 1295 1296 1296 usb_set_intfdata(interface, NULL); 1297 1297 1298 - if (!unplugged && (hif_dev->flags & HIF_USB_START)) 1298 + /* If firmware was loaded we should drop it 1299 + * go back to first stage bootloader. */ 1300 + if (!unplugged && (hif_dev->flags & HIF_USB_READY)) 1299 1301 ath9k_hif_usb_reboot(udev); 1300 1302 1301 1303 kfree(hif_dev);