From: Oleksij Rempel <fishor@gmx.net>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH] ath9k_htc: don't use HZ for usb msg timeouts
Date: Mon, 28 Nov 2016 16:34:12 +0100 [thread overview]
Message-ID: <a433d14f-d762-fc53-ba7a-da616ac670ca@gmx.net> (raw)
In-Reply-To: <20161128042757.8609-1-anthony.romano@coreos.com>
Hi Anthony,
Am 28.11.2016 um 05:27 schrieb Anthony Romano:
> 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.
wow..
This fix allow you use 4 adapter at same time?
> Signed-off-by: Anthony Romano <anthony.romano@coreos.com>
> ---
> drivers/net/wireless/ath/ath9k/hif_usb.c | 9 +++++----
> drivers/net/wireless/ath/ath9k/hif_usb.h | 2 ++
> 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)
> err = usb_control_msg(hif_dev->udev,
> usb_sndctrlpipe(hif_dev->udev, 0),
> FIRMWARE_DOWNLOAD, 0x40 | USB_DIR_OUT,
> - addr >> 8, 0, buf, transfer, HZ);
> + addr >> 8, 0, buf, transfer,
> + USB_MSG_TIMEOUT);
> if (err < 0) {
> kfree(buf);
> return err;
> @@ -1020,7 +1021,7 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
> err = usb_control_msg(hif_dev->udev, usb_sndctrlpipe(hif_dev->udev, 0),
> FIRMWARE_DOWNLOAD_COMP,
> 0x40 | USB_DIR_OUT,
> - firm_offset >> 8, 0, NULL, 0, HZ);
> + firm_offset >> 8, 0, NULL, 0, USB_MSG_TIMEOUT);
> if (err)
> return -EIO;
>
> @@ -1249,7 +1250,7 @@ static int send_eject_command(struct usb_interface *interface)
>
> dev_info(&udev->dev, "Ejecting storage device...\n");
> r = usb_bulk_msg(udev, usb_sndbulkpipe(udev, bulk_out_ep),
> - cmd, 31, NULL, 2000);
> + cmd, 31, NULL, 2 * USB_MSG_TIMEOUT);
> kfree(cmd);
> if (r)
> return r;
> @@ -1314,7 +1315,7 @@ static void ath9k_hif_usb_reboot(struct usb_device *udev)
> return;
>
> ret = usb_interrupt_msg(udev, usb_sndintpipe(udev, USB_REG_OUT_PIPE),
> - buf, 4, NULL, HZ);
> + buf, 4, NULL, USB_MSG_TIMEOUT);
> if (ret)
> dev_err(&udev->dev, "ath9k_htc: USB reboot failed\n");
>
> 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;
> #define USB_REG_IN_PIPE 3
> #define USB_REG_OUT_PIPE 4
>
> +#define USB_MSG_TIMEOUT 1000 /* (ms) */
> +
> #define HIF_USB_MAX_RXPIPES 2
> #define HIF_USB_MAX_TXPIPES 4
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20161128/dae0a7aa/attachment.pgp
next prev parent reply other threads:[~2016-11-28 15:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 4:33 [ath9k-devel] [PATCH] ath9k_htc: don't use HZ for usb msg timeouts Anthony Romano
2016-11-28 15:34 ` Oleksij Rempel [this message]
2016-11-29 9:52 ` Anthony Romano
2016-11-29 15:12 ` Oleksij Rempel
2016-12-01 11:20 ` [ath9k-devel] " Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a433d14f-d762-fc53-ba7a-da616ac670ca@gmx.net \
--to=fishor@gmx.net \
--cc=ath9k-devel@lists.ath9k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).