From e769fc13744ecc62c08db858027254f6417c7bb1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 3 May 2013 13:58:55 -0700 Subject: [PATCH] 3.4-stable patches added patches: alsa-snd-usb-try-harder-to-find-usb_dt_cs_endpoint.patch alsa-usb-audio-disable-autopm-for-midi-devices.patch alsa-usb-audio-fix-autopm-error-during-probing.patch arm-7702-1-set-the-page-table-freeing-ceiling-to-task_size.patch --- ...ry-harder-to-find-usb_dt_cs_endpoint.patch | 52 +++++++++++ ...udio-disable-autopm-for-midi-devices.patch | 87 +++++++++++++++++++ ...udio-fix-autopm-error-during-probing.patch | 43 +++++++++ ...e-table-freeing-ceiling-to-task_size.patch | 54 ++++++++++++ queue-3.4/series | 4 + 5 files changed, 240 insertions(+) create mode 100644 queue-3.4/alsa-snd-usb-try-harder-to-find-usb_dt_cs_endpoint.patch create mode 100644 queue-3.4/alsa-usb-audio-disable-autopm-for-midi-devices.patch create mode 100644 queue-3.4/alsa-usb-audio-fix-autopm-error-during-probing.patch create mode 100644 queue-3.4/arm-7702-1-set-the-page-table-freeing-ceiling-to-task_size.patch diff --git a/queue-3.4/alsa-snd-usb-try-harder-to-find-usb_dt_cs_endpoint.patch b/queue-3.4/alsa-snd-usb-try-harder-to-find-usb_dt_cs_endpoint.patch new file mode 100644 index 00000000000..d619a803c94 --- /dev/null +++ b/queue-3.4/alsa-snd-usb-try-harder-to-find-usb_dt_cs_endpoint.patch @@ -0,0 +1,52 @@ +From ebfc594c02148b6a85c2f178cf167a44a3c3ce10 Mon Sep 17 00:00:00 2001 +From: Daniel Mack +Date: Wed, 24 Apr 2013 19:38:42 +0200 +Subject: ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT + +From: Daniel Mack + +commit ebfc594c02148b6a85c2f178cf167a44a3c3ce10 upstream. + +The USB_DT_CS_ENDPOINT class-specific endpoint descriptor is usually +stuffed directly after the standard USB endpoint descriptor, and this is +where the driver currently expects it to be. + +There are, however, devices in the wild that have it the other way +around in their descriptor sets, so the USB_DT_CS_ENDPOINT comes +*before* the standard enpoint. Devices known to implement it that way +are "Sennheiser BTD-500" and Plantronics USB headsets. + +When the driver can't find the USB_DT_CS_ENDPOINT, it won't be able to +change sample rates, as the bitmask for the validity of this command is +storen in bmAttributes of that descriptor. + +Fix this by searching the entire interface instead of just the extra +bytes of the first endpoint, in case the latter fails. + +Signed-off-by: Daniel Mack +Reported-and-tested-by: Torstein Hegge +Reported-and-tested-by: Yves G +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/stream.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/sound/usb/stream.c ++++ b/sound/usb/stream.c +@@ -168,6 +168,14 @@ static int parse_uac_endpoint_attributes + if (!csep && altsd->bNumEndpoints >= 2) + csep = snd_usb_find_desc(alts->endpoint[1].extra, alts->endpoint[1].extralen, NULL, USB_DT_CS_ENDPOINT); + ++ /* ++ * If we can't locate the USB_DT_CS_ENDPOINT descriptor in the extra ++ * bytes after the first endpoint, go search the entire interface. ++ * Some devices have it directly *before* the standard endpoint. ++ */ ++ if (!csep) ++ csep = snd_usb_find_desc(alts->extra, alts->extralen, NULL, USB_DT_CS_ENDPOINT); ++ + if (!csep || csep->bLength < 7 || + csep->bDescriptorSubtype != UAC_EP_GENERAL) { + snd_printk(KERN_WARNING "%d:%u:%d : no or invalid" diff --git a/queue-3.4/alsa-usb-audio-disable-autopm-for-midi-devices.patch b/queue-3.4/alsa-usb-audio-disable-autopm-for-midi-devices.patch new file mode 100644 index 00000000000..86b98f680a3 --- /dev/null +++ b/queue-3.4/alsa-usb-audio-disable-autopm-for-midi-devices.patch @@ -0,0 +1,87 @@ +From cbc200bca4b51a8e2406d4b654d978f8503d430b Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Mon, 15 Apr 2013 15:59:51 +0200 +Subject: ALSA: usb-audio: disable autopm for MIDI devices + +From: Clemens Ladisch + +commit cbc200bca4b51a8e2406d4b654d978f8503d430b upstream. + +Commit 88a8516a2128 (ALSA: usbaudio: implement USB autosuspend) +introduced autopm for all USB audio/MIDI devices. However, many MIDI +devices, such as synthesizers, do not merely transmit MIDI messages but +use their MIDI inputs to control other functions. With autopm, these +devices would get powered down as soon as the last MIDI port device is +closed on the host. + +Even some plain MIDI interfaces could get broken: they automatically +send Active Sensing messages while powered up, but as soon as these +messages cease, the receiving device would interpret this as an +accidental disconnection. + +Commit f5f165418cab (ALSA: usb-audio: Fix missing autopm for MIDI input) +introduced another regression: some devices (e.g. the Roland GAIA SH-01) +are self-powered but do a reset whenever the USB interface's power state +changes. + +To work around all this, just disable autopm for all USB MIDI devices. + +Reported-by: Laurens Holst +Signed-off-by: Clemens Ladisch +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/midi.c | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +--- a/sound/usb/midi.c ++++ b/sound/usb/midi.c +@@ -126,7 +126,6 @@ struct snd_usb_midi { + struct snd_usb_midi_in_endpoint *in; + } endpoints[MIDI_MAX_ENDPOINTS]; + unsigned long input_triggered; +- bool autopm_reference; + unsigned int opened[2]; + unsigned char disconnected; + unsigned char input_running; +@@ -1040,7 +1039,6 @@ static int substream_open(struct snd_raw + { + struct snd_usb_midi* umidi = substream->rmidi->private_data; + struct snd_kcontrol *ctl; +- int err; + + down_read(&umidi->disc_rwsem); + if (umidi->disconnected) { +@@ -1051,13 +1049,6 @@ static int substream_open(struct snd_raw + mutex_lock(&umidi->mutex); + if (open) { + if (!umidi->opened[0] && !umidi->opened[1]) { +- err = usb_autopm_get_interface(umidi->iface); +- umidi->autopm_reference = err >= 0; +- if (err < 0 && err != -EACCES) { +- mutex_unlock(&umidi->mutex); +- up_read(&umidi->disc_rwsem); +- return -EIO; +- } + if (umidi->roland_load_ctl) { + ctl = umidi->roland_load_ctl; + ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; +@@ -1080,8 +1071,6 @@ static int substream_open(struct snd_raw + snd_ctl_notify(umidi->card, + SNDRV_CTL_EVENT_MASK_INFO, &ctl->id); + } +- if (umidi->autopm_reference) +- usb_autopm_put_interface(umidi->iface); + } + } + mutex_unlock(&umidi->mutex); +@@ -2256,6 +2245,8 @@ int snd_usbmidi_create(struct snd_card * + return err; + } + ++ usb_autopm_get_interface_no_resume(umidi->iface); ++ + list_add_tail(&umidi->list, midi_list); + return 0; + } diff --git a/queue-3.4/alsa-usb-audio-fix-autopm-error-during-probing.patch b/queue-3.4/alsa-usb-audio-fix-autopm-error-during-probing.patch new file mode 100644 index 00000000000..7c9d7195247 --- /dev/null +++ b/queue-3.4/alsa-usb-audio-fix-autopm-error-during-probing.patch @@ -0,0 +1,43 @@ +From 60af3d037eb8c670dcce31401501d1271e7c5d95 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 25 Apr 2013 07:38:15 +0200 +Subject: ALSA: usb-audio: Fix autopm error during probing + +From: Takashi Iwai + +commit 60af3d037eb8c670dcce31401501d1271e7c5d95 upstream. + +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 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/card.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/sound/usb/card.c ++++ b/sound/usb/card.c +@@ -611,7 +611,9 @@ int snd_usb_autoresume(struct snd_usb_au + 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); + diff --git a/queue-3.4/arm-7702-1-set-the-page-table-freeing-ceiling-to-task_size.patch b/queue-3.4/arm-7702-1-set-the-page-table-freeing-ceiling-to-task_size.patch new file mode 100644 index 00000000000..a4e7760b57e --- /dev/null +++ b/queue-3.4/arm-7702-1-set-the-page-table-freeing-ceiling-to-task_size.patch @@ -0,0 +1,54 @@ +From 6aaa189f8712471a250bfdf8fc8d08277258b8ab Mon Sep 17 00:00:00 2001 +From: Catalin Marinas +Date: Tue, 23 Apr 2013 11:21:44 +0100 +Subject: ARM: 7702/1: Set the page table freeing ceiling to TASK_SIZE + +From: Catalin Marinas + +commit 6aaa189f8712471a250bfdf8fc8d08277258b8ab upstream. + +ARM processors with LPAE enabled use 3 levels of page tables, with an +entry in the top level (pgd) covering 1GB of virtual space. Because of +the branch relocation limitations on ARM, the loadable modules are +mapped 16MB below PAGE_OFFSET, making the corresponding 1GB pgd shared +between kernel modules and user space. + +If free_pgtables() is called with the default ceiling 0, +free_pgd_range() (and subsequently called functions) also frees the page +table shared between user space and kernel modules (which is normally +handled by the ARM-specific pgd_free() function). This patch changes +defines the ARM USER_PGTABLES_CEILING to TASK_SIZE when CONFIG_ARM_LPAE +is enabled. + +Note that the pgd_free() function already checks the presence of the +shared pmd page allocated by pgd_alloc() and frees it, though with +ceiling 0 this wasn't necessary. + +Signed-off-by: Catalin Marinas +Cc: Hugh Dickins +Cc: Andrew Morton +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/include/asm/pgtable.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/arch/arm/include/asm/pgtable.h ++++ b/arch/arm/include/asm/pgtable.h +@@ -70,6 +70,15 @@ extern void __pgd_error(const char *file + #endif + + /* ++ * Use TASK_SIZE as the ceiling argument for free_pgtables() and ++ * free_pgd_range() to avoid freeing the modules pmd when LPAE is enabled (pmd ++ * page shared between user and kernel). ++ */ ++#ifdef CONFIG_ARM_LPAE ++#define USER_PGTABLES_CEILING TASK_SIZE ++#endif ++ ++/* + * The pgprot_* and protection_map entries will be fixed up in runtime + * to include the cachable and bufferable bits based on memory policy, + * as well as any architecture dependent bits like global/ASID and SMP diff --git a/queue-3.4/series b/queue-3.4/series index 1c385ec82aa..1724e37a457 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -32,3 +32,7 @@ wrong-asm-register-contraints-in-the-futex-implementation.patch wrong-asm-register-contraints-in-the-kvm-implementation.patch fs-fscache-stats.c-fix-memory-leak.patch mm-allow-arch-code-to-control-the-user-page-table-ceiling.patch +alsa-snd-usb-try-harder-to-find-usb_dt_cs_endpoint.patch +alsa-usb-audio-disable-autopm-for-midi-devices.patch +alsa-usb-audio-fix-autopm-error-during-probing.patch +arm-7702-1-set-the-page-table-freeing-ceiling-to-task_size.patch -- 2.47.3