[alsa-devel] [PATCH v2] ALSA: snd-usb-audio: set the timeout for usb control set messages to 5000 ms
Daniel Mack
zonque at gmail.com
Sat Apr 20 21:09:11 CEST 2013
On 20.04.2013 20:58, Daniel Schürmann wrote:
> Thank you Daniel for review.
> Here is an updated version of the patch against
> https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/
> 581cbef46ae60073252208fc1f26dd1044f6e215
>
> Set the timeout for USB control set messages according to the USB 2 spec
> §9.2.6.4 to 5000 ms.
> To avoid new issues, the get timeout is unchanged at 1000 ms, though it
> is 500 ms in the spec.
> This patch is required to run the Hercules RMX2 which needs a timeout >
> 1240 ms
>
> Signed-off-by: Daniel Schürmann <daschuer at mixxx.org
> <mailto:daschuer at mixxx.org>>
> ---
> diff --git a/sound/usb/helper.c b/sound/usb/helper.c
> index c1db28f..c1caae4 100644
> --- a/sound/usb/helper.c
> +++ b/sound/usb/helper.c
> @@ -23,6 +23,11 @@
> #include "helper.h"
> #include "quirks.h"
>
> +/* Value from 9.2.6.4 USB 2 spec */
> +#define USB_MSG_SET_TIMEOUT 5000
> +/* Value from spec is 500 but we pick 1000 for legacy reasons */
> +#define USB_MSG_GET_TIMEOUT 1000
> +
> /*
> * combine bytes and get an integer value
> */
> @@ -86,14 +91,19 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned
> int pipe, __u8 request,
> {
> int err;
> void *buf = NULL;
> + int timeout;
>
> if (size > 0) {
> buf = kmemdup(data, size, GFP_KERNEL);
> if (!buf)
> return -ENOMEM;
> }
Blank line please.
> + if (requesttype & USB_DIR_IN)
> + timeout = USB_MSG_GET_TIMEOUT;
> + else
> + timeout = USB_MSG_SET_TIMEOUT;
Dito.
Also, the patch does not apply to Takashi's for-next branch, but I
believe that's just because your mailer mangled the patch. Could you
resend using 'git send-email'?
Thanks,
Daniel
More information about the Alsa-devel
mailing list