From: Daniel Mack <zonque@gmail.com>
To: "Daniel Schürmann" <daschuer@mixxx.org>
Cc: Takashi Iwai <tiwai@suse.de>,
alsa-devel@alsa-project.org, Clemens Ladisch <clemens@ladisch.de>,
"Gabriel M. Beddingfield" <gabrbedd@gmail.com>
Subject: Re: [PATCH] ALSA: snd-usb-audio: set the timeout for usb control set messages to 5000 ms
Date: Sat, 20 Apr 2013 00:50:11 +0200 [thread overview]
Message-ID: <5171CA23.1000407@gmail.com> (raw)
In-Reply-To: <5171B980.6050501@mixxx.org>
Hi Daniel,
On 19.04.2013 23:39, Daniel Schürmann wrote:
> This is a patch against
> https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/
> 581cbef46ae60073252208fc1f26dd1044f6e215
Yeah, we're getting there :)
> 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@mixxx.org>
> ---
> diff --git a/sound/usb/helper.c b/sound/usb/helper.c
> index c1db28f..b4f3876 100644
> --- a/sound/usb/helper.c
> +++ b/sound/usb/helper.c
> @@ -21,7 +21,11 @@
>
> #include "usbaudio.h"
> #include "helper.h"
> -#include "quirks.h"
That is a stray change which shouldn't be part of this patch.
> +
> +/* 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 +90,24 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned
> int pipe, __u8 request,
> {
> int err;
> void *buf = NULL;
> + int timeout;
Can be unsigned, but that's a minor.
>
> if (size > 0) {
> buf = kmemdup(data, size, GFP_KERNEL);
> if (!buf)
> return -ENOMEM;
> }
> +
> + if (requesttype & USB_DIR_IN) {
> + /* Get Request */
> + timeout = USB_MSG_GET_TIMEOUT;
> + } else {
> + /* Set Request */
> + timeout = USB_MSG_SET_TIMEOUT;
> + }
You can omit the comments, they don't add any value for someone who's
reading the code. And you don't need the curly braces.
Other than that, looks good to me.
Can you send an updated version?
Thanks,
Daniel
> err = usb_control_msg(dev, pipe, request, requesttype,
> - value, index, buf, size, 1000);
> + value, index, buf, size, timeout);
> +
> if (size > 0) {
> memcpy(data, buf, size);
> kfree(buf);
>
prev parent reply other threads:[~2013-04-19 22:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 22:04 Solved Hercules RMX2 Daniel Schürmann
2013-04-16 14:10 ` Gabriel M. Beddingfield
2013-04-16 15:12 ` Daniel Schürmann
2013-04-16 15:35 ` Gabriel M. Beddingfield
2013-04-16 16:05 ` Daniel Mack
2013-04-16 19:14 ` Daniel Schürmann
2013-04-16 19:23 ` Daniel Mack
2013-04-16 19:24 ` Daniel Mack
[not found] ` <CABVYHNiUu+Bm=uVNHu+d6LUENAfr0FxnwE2HvmUGyzt7a1UYVg@mail.gmail.com>
2013-04-17 6:32 ` Fwd: " Daniel Schürmann
2013-04-17 13:36 ` Daniel Mack
2013-04-19 21:39 ` [PATCH] ALSA: snd-usb-audio: set the timeout for usb control set messages to 5000 ms Daniel Schürmann
2013-04-19 22:50 ` Daniel Mack [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5171CA23.1000407@gmail.com \
--to=zonque@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
--cc=daschuer@mixxx.org \
--cc=gabrbedd@gmail.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.