Skip to contentSkip to conversation

wireless: fix control-message timeouts

PATCH In review Johan Hovold 2 participants 7 messages Oct 25, 2021 – Oct 28, 2021

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

cover wireless: fix control-message timeouts

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(-)
Signature · 1 line
2.32.0
#1 lore raw

PATCH 1/4 ath10k: fix control-message timeout

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

Fixes 4db66499df91 ("ath10k: add initial USB support")
Cc Erik Stromdahl <[email protected]>
---
 drivers/net/wireless/ath/ath10k/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/usb.c +1 -1
index 19b9c27e30e2..6d831b098cbb 100644
@@ -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",
Signature · 1 line
2.32.0
#2 lore raw

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

Quoted 8 lines · Johan Hovold

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

Fixes 4db66499df91 ("ath10k: add initial USB support")
Cc Erik Stromdahl <[email protected]>

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

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

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw

PATCH 2/4 ath6kl: fix control-message timeout

In reply to Johan Hovold

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")
---
 drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath6kl/usb.c +1 -1
index 5372e948e761..bd367b79a4d3 100644
@@ -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);
Signature · 1 line
2.32.0
#4 lore raw

PATCH 3/4 rtl8187: fix control-message timeouts

In reply to Johan Hovold

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

Fixes 605bebe23bf6 ("[PATCH] Add rtl8187 wireless driver")
Cc [email protected] # 2.6.23
---
 .../net/wireless/realtek/rtl818x/rtl8187/rtl8225.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.c +7 -7
index 585784258c66..4efab907a3ac 100644
@@ -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);
 
Signature · 1 line
2.32.0
#5 lore raw

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

Quoted 6 lines · Johan Hovold

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

Fixes 605bebe23bf6 ("[PATCH] Add rtl8187 wireless driver")
Cc [email protected] # 2.6.23

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

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

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#6 lore raw

PATCH 4/4 rsi: fix control-message timeout

In reply to Johan Hovold

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")
---
 drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/rsi/rsi_91x_usb.c +1 -1
index 416976f09888..e97f92915ed9 100644
@@ -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,
Signature · 1 line
2.32.0