From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20130518021649.801782113@goodmis.org> Date: Fri, 17 May 2013 22:16:47 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Takashi Iwai Subject: [ 050/136 ] ALSA: usb-audio: Fix autopm error during probing References: <20130518021557.139113314@goodmis.org> Content-Disposition: inline; filename=0050-ALSA-usb-audio-Fix-autopm-error-during-probing.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.4 stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai [ Upstream commit 60af3d037eb8c670dcce31401501d1271e7c5d95 ] We've got strange errors in get_ctl_value() in mixer.c during probing, e.g. on Hercules RMX2 DJ Controller: ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4 ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4 .... It turned out that the culprit is autopm: snd_usb_autoresume() returns -ENODEV when called during card->probing = 1. Since the call itself during card->probing = 1 is valid, let's fix the return value of snd_usb_autoresume() as success. Reported-and-tested-by: Daniel Schürmann Cc: Signed-off-by: Takashi Iwai Signed-off-by: Steven Rostedt --- sound/usb/card.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/usb/card.c b/sound/usb/card.c index b3f5ad4..aa25e04 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -619,7 +619,9 @@ int snd_usb_autoresume(struct snd_usb_audio *chip) int err = -ENODEV; down_read(&chip->shutdown_rwsem); - if (!chip->shutdown && !chip->probing) + if (chip->probing) + err = 0; + else if (!chip->shutdown) err = usb_autopm_get_interface(chip->pm_intf); up_read(&chip->shutdown_rwsem); -- 1.7.10.4