]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ALSA: line6: fix control and interrupt message timeouts
authorJohan Hovold <johan@kernel.org>
Mon, 25 Oct 2021 12:11:42 +0000 (14:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:35:58 +0000 (11:35 +0100)
commit f4000b58b64344871d7b27c05e73932f137cfef6 upstream.

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

Fixes: 705ececd1c60 ("Staging: add line6 usb driver")
Cc: stable@vger.kernel.org # 2.6.30
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20211025121142.6531-3-johan@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/line6/driver.c
sound/usb/line6/driver.h
sound/usb/line6/podhd.c
sound/usb/line6/toneport.c

index 2163fd6dce6648024558f886201a0a29edfd2948..67d74218d861bbeb5a20c740e3e80b8f0824ba92 100644 (file)
@@ -117,12 +117,12 @@ static int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
                        retval = usb_interrupt_msg(line6->usbdev,
                                                usb_sndintpipe(line6->usbdev, properties->ep_ctrl_w),
                                                (char *)frag_buf, frag_size,
-                                               &partial, LINE6_TIMEOUT * HZ);
+                                               &partial, LINE6_TIMEOUT);
                } else {
                        retval = usb_bulk_msg(line6->usbdev,
                                                usb_sndbulkpipe(line6->usbdev, properties->ep_ctrl_w),
                                                (char *)frag_buf, frag_size,
-                                               &partial, LINE6_TIMEOUT * HZ);
+                                               &partial, LINE6_TIMEOUT);
                }
 
                if (retval) {
@@ -365,7 +365,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
        ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
                              USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
                              (datalen << 8) | 0x21, address,
-                             NULL, 0, LINE6_TIMEOUT * HZ);
+                             NULL, 0, LINE6_TIMEOUT);
 
        if (ret < 0) {
                dev_err(line6->ifcdev, "read request failed (error %d)\n", ret);
@@ -380,7 +380,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
                                      USB_TYPE_VENDOR | USB_RECIP_DEVICE |
                                      USB_DIR_IN,
                                      0x0012, 0x0000, len, 1,
-                                     LINE6_TIMEOUT * HZ);
+                                     LINE6_TIMEOUT);
                if (ret < 0) {
                        dev_err(line6->ifcdev,
                                "receive length failed (error %d)\n", ret);
@@ -408,7 +408,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
        ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67,
                              USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
                              0x0013, 0x0000, data, datalen,
-                             LINE6_TIMEOUT * HZ);
+                             LINE6_TIMEOUT);
 
        if (ret < 0)
                dev_err(line6->ifcdev, "read failed (error %d)\n", ret);
@@ -440,7 +440,7 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data,
        ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
                              USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
                              0x0022, address, data, datalen,
-                             LINE6_TIMEOUT * HZ);
+                             LINE6_TIMEOUT);
 
        if (ret < 0) {
                dev_err(line6->ifcdev,
@@ -456,7 +456,7 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data,
                                      USB_TYPE_VENDOR | USB_RECIP_DEVICE |
                                      USB_DIR_IN,
                                      0x0012, 0x0000,
-                                     status, 1, LINE6_TIMEOUT * HZ);
+                                     status, 1, LINE6_TIMEOUT);
 
                if (ret < 0) {
                        dev_err(line6->ifcdev,
index 650d909c9c4ff86a41a4a61f4cd7528e1748514d..d2d786eadfde1012c57dee8afe20d164a9b2123a 100644 (file)
@@ -31,7 +31,7 @@
 #define LINE6_FALLBACK_INTERVAL 10
 #define LINE6_FALLBACK_MAXPACKETSIZE 16
 
-#define LINE6_TIMEOUT 1
+#define LINE6_TIMEOUT 1000
 #define LINE6_BUFSIZE_LISTEN 64
 #define LINE6_MIDI_MESSAGE_MAXLEN 256
 
index da627b015b32b9c9e14a5ab6c615dc46b53b062d..2806808d8108740fa54d9186325a3bcd059581e8 100644 (file)
@@ -236,7 +236,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)
        ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0),
                                        0x67, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
                                        0x11, 0,
-                                       NULL, 0, LINE6_TIMEOUT * HZ);
+                                       NULL, 0, LINE6_TIMEOUT);
        if (ret < 0) {
                dev_err(pod->line6.ifcdev, "read request failed (error %d)\n", ret);
                goto exit;
@@ -246,7 +246,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)
        ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67,
                                        USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
                                        0x11, 0x0,
-                                       init_bytes, 3, LINE6_TIMEOUT * HZ);
+                                       init_bytes, 3, LINE6_TIMEOUT);
        if (ret < 0) {
                dev_err(pod->line6.ifcdev,
                        "receive length failed (error %d)\n", ret);
@@ -266,7 +266,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)
                                        USB_REQ_SET_FEATURE,
                                        USB_TYPE_STANDARD | USB_RECIP_DEVICE | USB_DIR_OUT,
                                        1, 0,
-                                       NULL, 0, LINE6_TIMEOUT * HZ);
+                                       NULL, 0, LINE6_TIMEOUT);
 exit:
        kfree(init_bytes);
        return ret;
index 7e39083f8f76ac7a6cdb064203d3a199725f17cd..cbb2e66be32f288458f79c73679fa24d5c4ffaec 100644 (file)
@@ -130,7 +130,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2)
 
        ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
                              USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
-                             cmd1, cmd2, NULL, 0, LINE6_TIMEOUT * HZ);
+                             cmd1, cmd2, NULL, 0, LINE6_TIMEOUT);
 
        if (ret < 0) {
                dev_err(&usbdev->dev, "send failed (error %d)\n", ret);