aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorAnthony Romano <anthony.romano@coreos.com>2016-11-27 23:27:57 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2016-12-01 06:18:33 -0500
commit982a6151f6f1296725de241a17932a3ecdd359d2 (patch)
treea908fa1f18bd61ca8688a7fc5c8bb86640c64e43 /drivers/net/wireless/ath
parent8ca5a6078d6d09ac50d9c39c214df3284f0d2efb (diff)
ath9k_htc: don't use HZ for usb msg timeouts
The usb_*_msg() functions expect a timeout in msecs but are given HZ, which is ticks per second. If HZ=100, firmware download often times out when there is modest USB utilization and the device fails to initialize. Replaces HZ in usb_*_msg timeouts with 1000 msec since HZ is one second for timeouts in jiffies. Signed-off-by: Anthony Romano <anthony.romano@coreos.com> Acked-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index e1c338cb9cb5..de2d212f39ec 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -997,7 +997,8 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
997 err = usb_control_msg(hif_dev->udev, 997 err = usb_control_msg(hif_dev->udev,
998 usb_sndctrlpipe(hif_dev->udev, 0), 998 usb_sndctrlpipe(hif_dev->udev, 0),
999 FIRMWARE_DOWNLOAD, 0x40 | USB_DIR_OUT, 999 FIRMWARE_DOWNLOAD, 0x40 | USB_DIR_OUT,
1000 addr >> 8, 0, buf, transfer, HZ); 1000 addr >> 8, 0, buf, transfer,
1001 USB_MSG_TIMEOUT);
1001 if (err < 0) { 1002 if (err < 0) {
1002 kfree(buf); 1003 kfree(buf);
1003 return err; 1004 return err;
@@ -1020,7 +1021,7 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
1020 err = usb_control_msg(hif_dev->udev, usb_sndctrlpipe(hif_dev->udev, 0), 1021 err = usb_control_msg(hif_dev->udev, usb_sndctrlpipe(hif_dev->udev, 0),
1021 FIRMWARE_DOWNLOAD_COMP, 1022 FIRMWARE_DOWNLOAD_COMP,
1022 0x40 | USB_DIR_OUT, 1023 0x40 | USB_DIR_OUT,
1023 firm_offset >> 8, 0, NULL, 0, HZ); 1024 firm_offset >> 8, 0, NULL, 0, USB_MSG_TIMEOUT);
1024 if (err) 1025 if (err)
1025 return -EIO; 1026 return -EIO;
1026 1027
@@ -1249,7 +1250,7 @@ static int send_eject_command(struct usb_interface *interface)
1249 1250
1250 dev_info(&udev->dev, "Ejecting storage device...\n"); 1251 dev_info(&udev->dev, "Ejecting storage device...\n");
1251 r = usb_bulk_msg(udev, usb_sndbulkpipe(udev, bulk_out_ep), 1252 r = usb_bulk_msg(udev, usb_sndbulkpipe(udev, bulk_out_ep),
1252 cmd, 31, NULL, 2000); 1253 cmd, 31, NULL, 2 * USB_MSG_TIMEOUT);
1253 kfree(cmd); 1254 kfree(cmd);
1254 if (r) 1255 if (r)
1255 return r; 1256 return r;
@@ -1314,7 +1315,7 @@ static void ath9k_hif_usb_reboot(struct usb_device *udev)
1314 return; 1315 return;
1315 1316
1316 ret = usb_interrupt_msg(udev, usb_sndintpipe(udev, USB_REG_OUT_PIPE), 1317 ret = usb_interrupt_msg(udev, usb_sndintpipe(udev, USB_REG_OUT_PIPE),
1317 buf, 4, NULL, HZ); 1318 buf, 4, NULL, USB_MSG_TIMEOUT);
1318 if (ret) 1319 if (ret)
1319 dev_err(&udev->dev, "ath9k_htc: USB reboot failed\n"); 1320 dev_err(&udev->dev, "ath9k_htc: USB reboot failed\n");
1320 1321
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h
index 7c2ef7ecd98b..7846916aa01d 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.h
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.h
@@ -71,6 +71,8 @@ extern int htc_use_dev_fw;
71#define USB_REG_IN_PIPE 3 71#define USB_REG_IN_PIPE 3
72#define USB_REG_OUT_PIPE 4 72#define USB_REG_OUT_PIPE 4
73 73
74#define USB_MSG_TIMEOUT 1000 /* (ms) */
75
74#define HIF_USB_MAX_RXPIPES 2 76#define HIF_USB_MAX_RXPIPES 2
75#define HIF_USB_MAX_TXPIPES 4 77#define HIF_USB_MAX_TXPIPES 4
76 78