Skip to content

Commit 3c7a3f2

Browse files
jhovoldgregkh
authored andcommitted
ALSA: line6: fix control and interrupt message timeouts
commit f4000b5 upstream. USB control and interrupt message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 705ecec ("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>
1 parent 21f9c02 commit 3c7a3f2

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎sound/usb/line6/driver.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
113113
retval = usb_interrupt_msg(line6->usbdev,
114114
usb_sndintpipe(line6->usbdev, properties->ep_ctrl_w),
115115
(char *)frag_buf, frag_size,
116-
&partial, LINE6_TIMEOUT * HZ);
116+
&partial, LINE6_TIMEOUT);
117117
} else {
118118
retval = usb_bulk_msg(line6->usbdev,
119119
usb_sndbulkpipe(line6->usbdev, properties->ep_ctrl_w),
120120
(char *)frag_buf, frag_size,
121-
&partial, LINE6_TIMEOUT * HZ);
121+
&partial, LINE6_TIMEOUT);
122122
}
123123

124124
if (retval) {
@@ -347,7 +347,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
347347
ret = usb_control_msg_send(usbdev, 0, 0x67,
348348
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
349349
(datalen << 8) | 0x21, address, NULL, 0,
350-
LINE6_TIMEOUT * HZ, GFP_KERNEL);
350+
LINE6_TIMEOUT, GFP_KERNEL);
351351
if (ret) {
352352
dev_err(line6->ifcdev, "read request failed (error %d)\n", ret);
353353
goto exit;
@@ -360,7 +360,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
360360
ret = usb_control_msg_recv(usbdev, 0, 0x67,
361361
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
362362
0x0012, 0x0000, &len, 1,
363-
LINE6_TIMEOUT * HZ, GFP_KERNEL);
363+
LINE6_TIMEOUT, GFP_KERNEL);
364364
if (ret) {
365365
dev_err(line6->ifcdev,
366366
"receive length failed (error %d)\n", ret);
@@ -387,7 +387,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
387387
/* receive the result: */
388388
ret = usb_control_msg_recv(usbdev, 0, 0x67,
389389
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
390-
0x0013, 0x0000, data, datalen, LINE6_TIMEOUT * HZ,
390+
0x0013, 0x0000, data, datalen, LINE6_TIMEOUT,
391391
GFP_KERNEL);
392392
if (ret)
393393
dev_err(line6->ifcdev, "read failed (error %d)\n", ret);
@@ -417,7 +417,7 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data,
417417

418418
ret = usb_control_msg_send(usbdev, 0, 0x67,
419419
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
420-
0x0022, address, data, datalen, LINE6_TIMEOUT * HZ,
420+
0x0022, address, data, datalen, LINE6_TIMEOUT,
421421
GFP_KERNEL);
422422
if (ret) {
423423
dev_err(line6->ifcdev,
@@ -430,7 +430,7 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data,
430430

431431
ret = usb_control_msg_recv(usbdev, 0, 0x67,
432432
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
433-
0x0012, 0x0000, status, 1, LINE6_TIMEOUT * HZ,
433+
0x0012, 0x0000, status, 1, LINE6_TIMEOUT,
434434
GFP_KERNEL);
435435
if (ret) {
436436
dev_err(line6->ifcdev,

‎sound/usb/line6/driver.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define LINE6_FALLBACK_INTERVAL 10
2828
#define LINE6_FALLBACK_MAXPACKETSIZE 16
2929

30-
#define LINE6_TIMEOUT 1
30+
#define LINE6_TIMEOUT 1000
3131
#define LINE6_BUFSIZE_LISTEN 64
3232
#define LINE6_MIDI_MESSAGE_MAXLEN 256
3333

‎sound/usb/line6/podhd.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)
190190
ret = usb_control_msg_send(usbdev, 0,
191191
0x67, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
192192
0x11, 0,
193-
NULL, 0, LINE6_TIMEOUT * HZ, GFP_KERNEL);
193+
NULL, 0, LINE6_TIMEOUT, GFP_KERNEL);
194194
if (ret) {
195195
dev_err(pod->line6.ifcdev, "read request failed (error %d)\n", ret);
196196
goto exit;
@@ -200,7 +200,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)
200200
ret = usb_control_msg_recv(usbdev, 0, 0x67,
201201
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
202202
0x11, 0x0,
203-
init_bytes, 3, LINE6_TIMEOUT * HZ, GFP_KERNEL);
203+
init_bytes, 3, LINE6_TIMEOUT, GFP_KERNEL);
204204
if (ret) {
205205
dev_err(pod->line6.ifcdev,
206206
"receive length failed (error %d)\n", ret);
@@ -220,7 +220,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)
220220
USB_REQ_SET_FEATURE,
221221
USB_TYPE_STANDARD | USB_RECIP_DEVICE | USB_DIR_OUT,
222222
1, 0,
223-
NULL, 0, LINE6_TIMEOUT * HZ, GFP_KERNEL);
223+
NULL, 0, LINE6_TIMEOUT, GFP_KERNEL);
224224
exit:
225225
return ret;
226226
}

‎sound/usb/line6/toneport.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2)
128128

129129
ret = usb_control_msg_send(usbdev, 0, 0x67,
130130
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
131-
cmd1, cmd2, NULL, 0, LINE6_TIMEOUT * HZ,
131+
cmd1, cmd2, NULL, 0, LINE6_TIMEOUT,
132132
GFP_KERNEL);
133133

134134
if (ret) {

0 commit comments

Comments
 (0)