# \[PATCH 0/4\] wireless: fix control-message timeouts

- Subsystems: ATHEROS ATH GENERIC UTILITIES, ATHEROS ATH6KL WIRELESS DRIVER, QUALCOMM ATHEROS ATH10K WIRELESS DRIVER, REDPINE WIRELESS DRIVER, RTL8187 WIRELESS DRIVER, THE REST
- Maintainers: Jeff Johnson, Hin-Tak Leung, Linus Torvalds
- Series: 4 patches touching 4 files, +10/-10
- Status: LANDED
- Landed in mainline.
- List: linux-usb
- 7 messages, 2 authors
- Page: https://ratatoskr.run/linux-usb/2021/10/1552421/t

## \[PATCH 0/4\] wireless: fix control-message timeouts

- From: Johan Hovold \<johan@kernel.org\>
- Date: 2021-10-25 12:06:30 
- Message: https://ratatoskr.run/linux-usb/2021/10/1552421.md

```text
A number of drivers throughout the tree were incorrectly specifying USB
message timeout values in jiffies instead of milliseconds.

This series fixes the wireless drivers that got it wrong.

Johan


Johan Hovold (4):
  ath10k: fix control-message timeout
  ath6kl: fix control-message timeout
  rtl8187: fix control-message timeouts
  rsi: fix control-message timeout

 drivers/net/wireless/ath/ath10k/usb.c              |  2 +-
 drivers/net/wireless/ath/ath6kl/usb.c              |  2 +-
 .../net/wireless/realtek/rtl818x/rtl8187/rtl8225.c | 14 +++++++-------
 drivers/net/wireless/rsi/rsi_91x_usb.c             |  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.32.0

```

## \[PATCH 1/4\] ath10k: fix control-message timeout

- From: Johan Hovold \<johan@kernel.org\>
- Date: 2021-10-25 12:05:54 
- Message: https://ratatoskr.run/linux-usb/2021/10/1552418.md

```text
USB control-message timeouts are specified in milliseconds and should
specifically not vary with CONFIG_HZ.

Fixes: 4db66499df91 ("ath10k: add initial USB support")
Cc: <redacted>      # 4.14
Cc: Erik Stromdahl <redacted>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/ath/ath10k/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c
index 19b9c27e30e2..6d831b098cbb 100644
--- a/drivers/net/wireless/ath/ath10k/usb.c
+++ b/drivers/net/wireless/ath/ath10k/usb.c
@@ -525,7 +525,7 @@ static int ath10k_usb_submit_ctrl_in(struct ath10k *ar,
 			      req,
 			      USB_DIR_IN | USB_TYPE_VENDOR |
 			      USB_RECIP_DEVICE, value, index, buf,
-			      size, 2 * HZ);
+			      size, 2000);
 
 	if (ret < 0) {
 		ath10k_warn(ar, "Failed to read usb control message: %d\n",
-- 
2.32.0

```

## \[PATCH 4/4\] rsi: fix control-message timeout

- From: Johan Hovold \<johan@kernel.org\>
- Date: 2021-10-25 12:06:03 
- Message: https://ratatoskr.run/linux-usb/2021/10/1552419.md

```text
USB control-message timeouts are specified in milliseconds and should
specifically not vary with CONFIG_HZ.

Use the common control-message timeout define for the five-second
timeout.

Fixes: dad0d04fa7ba ("rsi: Add RS9113 wireless driver")
Cc: <redacted>      # 3.15
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index 416976f09888..e97f92915ed9 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -61,7 +61,7 @@ static int rsi_usb_card_write(struct rsi_hw *adapter,
 			      (void *)seg,
 			      (int)len,
 			      &transfer,
-			      HZ * 5);
+			      USB_CTRL_SET_TIMEOUT);
 
 	if (status < 0) {
 		rsi_dbg(ERR_ZONE,
-- 
2.32.0

```

## \[PATCH 3/4\] rtl8187: fix control-message timeouts

- From: Johan Hovold \<johan@kernel.org\>
- Date: 2021-10-25 12:06:11 
- Message: https://ratatoskr.run/linux-usb/2021/10/1552420.md

```text
USB control-message timeouts are specified in milliseconds and should
specifically not vary with CONFIG_HZ.

Fixes: 605bebe23bf6 ("[PATCH] Add rtl8187 wireless driver")
Cc: <redacted>      # 2.6.23
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 .../net/wireless/realtek/rtl818x/rtl8187/rtl8225.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.c b/drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.c
index 585784258c66..4efab907a3ac 100644
--- a/drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.c
+++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.c
@@ -28,7 +28,7 @@ u8 rtl818x_ioread8_idx(struct rtl8187_priv *priv,
 	usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0),
 			RTL8187_REQ_GET_REG, RTL8187_REQT_READ,
 			(unsigned long)addr, idx & 0x03,
-			&priv->io_dmabuf->bits8, sizeof(val), HZ / 2);
+			&priv->io_dmabuf->bits8, sizeof(val), 500);
 
 	val = priv->io_dmabuf->bits8;
 	mutex_unlock(&priv->io_mutex);
@@ -45,7 +45,7 @@ u16 rtl818x_ioread16_idx(struct rtl8187_priv *priv,
 	usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0),
 			RTL8187_REQ_GET_REG, RTL8187_REQT_READ,
 			(unsigned long)addr, idx & 0x03,
-			&priv->io_dmabuf->bits16, sizeof(val), HZ / 2);
+			&priv->io_dmabuf->bits16, sizeof(val), 500);
 
 	val = priv->io_dmabuf->bits16;
 	mutex_unlock(&priv->io_mutex);
@@ -62,7 +62,7 @@ u32 rtl818x_ioread32_idx(struct rtl8187_priv *priv,
 	usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0),
 			RTL8187_REQ_GET_REG, RTL8187_REQT_READ,
 			(unsigned long)addr, idx & 0x03,
-			&priv->io_dmabuf->bits32, sizeof(val), HZ / 2);
+			&priv->io_dmabuf->bits32, sizeof(val), 500);
 
 	val = priv->io_dmabuf->bits32;
 	mutex_unlock(&priv->io_mutex);
@@ -79,7 +79,7 @@ void rtl818x_iowrite8_idx(struct rtl8187_priv *priv,
 	usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0),
 			RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE,
 			(unsigned long)addr, idx & 0x03,
-			&priv->io_dmabuf->bits8, sizeof(val), HZ / 2);
+			&priv->io_dmabuf->bits8, sizeof(val), 500);
 
 	mutex_unlock(&priv->io_mutex);
 }
@@ -93,7 +93,7 @@ void rtl818x_iowrite16_idx(struct rtl8187_priv *priv,
 	usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0),
 			RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE,
 			(unsigned long)addr, idx & 0x03,
-			&priv->io_dmabuf->bits16, sizeof(val), HZ / 2);
+			&priv->io_dmabuf->bits16, sizeof(val), 500);
 
 	mutex_unlock(&priv->io_mutex);
 }
@@ -107,7 +107,7 @@ void rtl818x_iowrite32_idx(struct rtl8187_priv *priv,
 	usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0),
 			RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE,
 			(unsigned long)addr, idx & 0x03,
-			&priv->io_dmabuf->bits32, sizeof(val), HZ / 2);
+			&priv->io_dmabuf->bits32, sizeof(val), 500);
 
 	mutex_unlock(&priv->io_mutex);
 }
@@ -183,7 +183,7 @@ static void rtl8225_write_8051(struct ieee80211_hw *dev, u8 addr, __le16 data)
 	usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0),
 			RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE,
 			addr, 0x8225, &priv->io_dmabuf->bits16, sizeof(data),
-			HZ / 2);
+			500);
 
 	mutex_unlock(&priv->io_mutex);
 
-- 
2.32.0

```

## \[PATCH 2/4\] ath6kl: fix control-message timeout

- From: Johan Hovold \<johan@kernel.org\>
- Date: 2021-10-25 12:06:32 
- Message: https://ratatoskr.run/linux-usb/2021/10/1552422.md

```text
USB control-message timeouts are specified in milliseconds and should
specifically not vary with CONFIG_HZ.

Fixes: 241b128b6b69 ("ath6kl: add back beginnings of USB support")
Cc: <redacted>      # 3.4
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
index 5372e948e761..bd367b79a4d3 100644
--- a/drivers/net/wireless/ath/ath6kl/usb.c
+++ b/drivers/net/wireless/ath/ath6kl/usb.c
@@ -907,7 +907,7 @@ static int ath6kl_usb_submit_ctrl_in(struct ath6kl_usb *ar_usb,
 				 req,
 				 USB_DIR_IN | USB_TYPE_VENDOR |
 				 USB_RECIP_DEVICE, value, index, buf,
-				 size, 2 * HZ);
+				 size, 2000);
 
 	if (ret < 0) {
 		ath6kl_warn("Failed to read usb control message: %d\n", ret);
-- 
2.32.0

```

## Re: \[PATCH 1/4\] ath10k: fix control-message timeout

- From: Kalle Valo \<hidden\>
- Date: 2021-10-28 07:33:34 
- Message: https://ratatoskr.run/linux-usb/2021/10/1556529.md

```text
Johan Hovold [ref] wrote:

> USB control-message timeouts are specified in milliseconds and should
> specifically not vary with CONFIG_HZ.
> 
> Fixes: 4db66499df91 ("ath10k: add initial USB support")
> Cc: <redacted>      # 4.14
> Cc: Erik Stromdahl <redacted>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> Signed-off-by: Kalle Valo <redacted>

2 patches applied to ath-next branch of ath.git, thanks.

528613232423 ath10k: fix control-message timeout
a066d28a7e72 ath6kl: fix control-message timeout

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211025120522.6045-2-johan@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

```

## Re: \[PATCH 3/4\] rtl8187: fix control-message timeouts

- From: Kalle Valo \<hidden\>
- Date: 2021-10-28 13:26:54 
- Message: https://ratatoskr.run/linux-usb/2021/10/1556861.md

```text
Johan Hovold [ref] wrote:

> USB control-message timeouts are specified in milliseconds and should
> specifically not vary with CONFIG_HZ.
> 
> Fixes: 605bebe23bf6 ("[PATCH] Add rtl8187 wireless driver")
> Cc: <redacted>      # 2.6.23
> Signed-off-by: Johan Hovold <johan@kernel.org>

2 patches applied to wireless-drivers-next.git, thanks.

2e9be536a213 rtl8187: fix control-message timeouts
541fd20c3ce5 rsi: fix control-message timeout

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211025120522.6045-4-johan@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

```
