rtl8187: fix control-message timeouts
authorJohan Hovold <johan@kernel.org>
Mon, 25 Oct 2021 12:05:21 +0000 (14:05 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 28 Oct 2021 13:26:18 +0000 (16:26 +0300)
USB control-message timeouts are specified in milliseconds and should
specifically not vary with CONFIG_HZ.

Fixes: 605bebe23bf6 ("[PATCH] Add rtl8187 wireless driver")
Cc: stable@vger.kernel.org # 2.6.23
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211025120522.6045-4-johan@kernel.org
drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.c

index 5857842..4efab90 100644 (file)
@@ -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);