rtl8187: fix control-message timeouts
authorJohan Hovold <johan@kernel.org>
Mon, 25 Oct 2021 12:05:21 +0000 (14:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:40:23 +0000 (11:40 +0100)
commit 2e9be536a213e838daed6ba42024dd68954ac061 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.c

index e6668ffb77e65841c909e3d87d1fa17712b5108f..49fb8bba3d91a4721604a2037cb7d08827687b8f 100644 (file)
@@ -31,7 +31,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);
@@ -48,7 +48,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);
@@ -65,7 +65,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);
@@ -82,7 +82,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);
 }
@@ -96,7 +96,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);
 }
@@ -110,7 +110,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);
 }
@@ -186,7 +186,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);