sound: fix USB message timeouts
Subsystems (3)
cover sound: fix USB message timeouts
A number of drivers throughout the tree were incorrectly specifying USB message timeout values in jiffies instead of milliseconds.
This series fixes the two sound drivers that got it wrong.
Johan
Johan Hovold (2):
sound: 6fire: fix control and bulk message timeouts
sound: line6: fix control and interrupt message timeouts
sound/usb/6fire/comm.c | 2 +- sound/usb/6fire/firmware.c | 6 +++--- sound/usb/line6/driver.c | 14 +++++++------- sound/usb/line6/driver.h | 2 +- sound/usb/line6/podhd.c | 6 +++--- sound/usb/line6/toneport.c | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-)
Signature · 1 line
2.32.0
PATCH 1/2 sound: 6fire: fix control and bulk message timeouts
USB control and bulk message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ.
--- sound/usb/6fire/comm.c | 2 +- sound/usb/6fire/firmware.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
sound/usb/6fire/comm.c +1 -1
@@ -95,7 +95,7 @@ static int usb6fire_comm_send_buffer(u8 *buffer, struct usb_device *dev)int actual_len; ret =usb_interrupt_msg (dev,usb_sndintpipe (dev,COMM_EP ), - buffer, buffer[1 ] +2 , &actual_len,HZ ); + buffer, buffer[1 ] +2 , &actual_len,1000 );if (ret <0 )return ret;else if (actual_len != buffer[1 ] +2 )
sound/usb/6fire/firmware.c +3 -3
@@ -160,7 +160,7 @@ static int usb6fire_fw_ezusb_write(struct usb_device *device, {return usb_control_msg_send (device,0 , type,USB_DIR_OUT |USB_TYPE_VENDOR |USB_RECIP_DEVICE , - value,0 , data, len,HZ ,GFP_KERNEL ); + value,0 , data, len,1000 ,GFP_KERNEL ); } static int usb6fire_fw_ezusb_read(struct usb_device *device,
@@ -168,7 +168,7 @@ static int usb6fire_fw_ezusb_read(struct usb_device *device, {return usb_control_msg_recv (device,0 , type,USB_DIR_IN |USB_TYPE_VENDOR |USB_RECIP_DEVICE , - value,0 , data, len,HZ ,GFP_KERNEL ); + value,0 , data, len,1000 ,GFP_KERNEL ); } static int usb6fire_fw_fpga_write(struct usb_device *device,
@@ -178,7 +178,7 @@ static int usb6fire_fw_fpga_write(struct usb_device *device,int ret; ret =usb_bulk_msg (device,usb_sndbulkpipe (device,FPGA_EP ), data, len, - &actual_len,HZ ); + &actual_len,1000 );if (ret <0 )return ret;else if (actual_len != len)
Signature · 1 line
2.32.0
PATCH 2/2 sound: line6: fix control and interrupt message timeouts
In reply to Johan HovoldUSB control and interrupt message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ.
--- sound/usb/line6/driver.c | 14 +++++++------- sound/usb/line6/driver.h | 2 +- sound/usb/line6/podhd.c | 6 +++--- sound/usb/line6/toneport.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-)
sound/usb/line6/driver.c +7 -7
@@ -113,12 +113,12 @@ 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) {
@@ -347,7 +347,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data, ret =usb_control_msg_send (usbdev,0 ,0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_OUT , (datalen <<8 ) |0x21 , address,NULL ,0 , -LINE6_TIMEOUT *HZ ,GFP_KERNEL ); +LINE6_TIMEOUT ,GFP_KERNEL );if (ret) {dev_err (line6->ifcdev,"read request failed (error %d)\n" , ret); goto exit;
@@ -360,7 +360,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data, ret =usb_control_msg_recv (usbdev,0 ,0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_IN ,0x0012 ,0x0000 , &len,1 , -LINE6_TIMEOUT *HZ ,GFP_KERNEL ); +LINE6_TIMEOUT ,GFP_KERNEL );if (ret) {dev_err (line6->ifcdev,"receive length failed (error %d)\n" , ret);
@@ -387,7 +387,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,/* receive the result: */ ret =usb_control_msg_recv (usbdev,0 ,0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_IN , -0x0013 ,0x0000 , data, datalen,LINE6_TIMEOUT *HZ , +0x0013 ,0x0000 , data, datalen,LINE6_TIMEOUT ,GFP_KERNEL );if (ret)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, ret =usb_control_msg_send (usbdev,0 ,0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_OUT , -0x0022 , address, data, datalen,LINE6_TIMEOUT *HZ , +0x0022 , address, data, datalen,LINE6_TIMEOUT ,GFP_KERNEL );if (ret) { dev_err(line6->ifcdev,
@@ -430,7 +430,7 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data, ret =usb_control_msg_recv (usbdev,0 ,0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_IN , -0x0012 ,0x0000 , status,1 ,LINE6_TIMEOUT *HZ , +0x0012 ,0x0000 , status,1 ,LINE6_TIMEOUT ,GFP_KERNEL );if (ret) { dev_err(line6->ifcdev,
sound/usb/line6/driver.h +1 -1
@@ -27,7 +27,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
sound/usb/line6/podhd.c +3 -3
@@ -190,7 +190,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod) ret =usb_control_msg_send (usbdev,0 ,0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_OUT ,0x11 ,0 , -NULL ,0 ,LINE6_TIMEOUT *HZ ,GFP_KERNEL ); +NULL ,0 ,LINE6_TIMEOUT ,GFP_KERNEL );if (ret) {dev_err (pod->line6.ifcdev,"read request failed (error %d)\n" , ret); goto exit;
@@ -200,7 +200,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod) ret =usb_control_msg_recv (usbdev,0 ,0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_IN ,0x11 ,0x0 , - init_bytes,3 ,LINE6_TIMEOUT *HZ ,GFP_KERNEL ); + init_bytes,3 ,LINE6_TIMEOUT ,GFP_KERNEL );if (ret) {dev_err (pod->line6.ifcdev,"receive length failed (error %d)\n" , ret);
@@ -220,7 +220,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, GFP_KERNEL); + NULL, 0, LINE6_TIMEOUT, GFP_KERNEL); exit:return ret; }
sound/usb/line6/toneport.c +1 -1
@@ -128,7 +128,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2) ret =usb_control_msg_send (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 ,GFP_KERNEL );if (ret) {
Signature · 1 line
2.32.0
Takashi Iwai
AppliedQuoted 4 lines · Johan Hovold
A number of drivers throughout the tree were incorrectly specifying USB message timeout values in jiffies instead of milliseconds.
Quoted 8 lines
This series fixes the two sound drivers that got it wrong.
Johan
Johan Hovold (2):
sound: 6fire: fix control and bulk message timeouts
sound: line6: fix control and interrupt message timeouts
Applied both patches now. Thanks!
Takashi