Skip to content

Commit

Permalink
most: fix control-message timeouts
Browse files Browse the repository at this point in the history
commit 63b3e81 upstream.

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

Use the common control-message timeout defines for the five-second
timeouts.

Fixes: 97a6f77 ("drivers: most: add USB adapter driver")
Cc: stable@vger.kernel.org      # 5.9
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20211025115811.5410-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
jhovold authored and gregkh committed Nov 18, 2021
1 parent 8b09d36 commit 2fbf746
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/most/most_usb.c
Expand Up @@ -149,7 +149,8 @@ static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf)
retval = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
DRCI_READ_REQ, req_type,
0x0000,
reg, dma_buf, sizeof(*dma_buf), 5 * HZ);
reg, dma_buf, sizeof(*dma_buf),
USB_CTRL_GET_TIMEOUT);
*buf = le16_to_cpu(*dma_buf);
kfree(dma_buf);

Expand All @@ -176,7 +177,7 @@ static inline int drci_wr_reg(struct usb_device *dev, u16 reg, u16 data)
reg,
NULL,
0,
5 * HZ);
USB_CTRL_SET_TIMEOUT);
}

static inline int start_sync_ep(struct usb_device *usb_dev, u16 ep)
Expand Down

0 comments on commit 2fbf746

Please sign in to comment.