From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Clemens Ladisch <clemens@ladisch.de>,
Takashi Iwai <tiwai@suse.de>
Subject: [ 27/46] ALSA: usb-audio: disable autopm for MIDI devices
Date: Mon, 6 May 2013 15:58:33 -0700 [thread overview]
Message-ID: <20130506225823.511197895@linuxfoundation.org> (raw)
In-Reply-To: <20130506225820.628893970@linuxfoundation.org>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <clemens@ladisch.de>
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 <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/midi.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -125,7 +125,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;
@@ -1023,7 +1022,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) {
@@ -1034,13 +1032,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;
@@ -1063,8 +1054,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);
@@ -2228,6 +2217,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;
}
next prev parent reply other threads:[~2013-05-06 23:08 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 22:58 [ 00/46] 3.0.77-stable review Greg Kroah-Hartman
2013-05-06 22:58 ` [ 01/46] powerpc: Add isync to copy_and_flush Greg Kroah-Hartman
2013-05-06 22:58 ` [ 02/46] powerpc/spufs: Initialise inode->i_ino in spufs_new_inode() Greg Kroah-Hartman
2013-05-06 22:58 ` [ 03/46] USB: serial: option: Added support Olivetti Olicard 145 Greg Kroah-Hartman
2013-05-06 22:58 ` [ 04/46] USB: option: add a D-Link DWM-156 variant Greg Kroah-Hartman
2013-05-06 22:58 ` [ 05/46] usb/misc/appledisplay: Add 24" LED Cinema display Greg Kroah-Hartman
2013-05-06 22:58 ` [ 06/46] USB: add ftdi_sio USB ID for GDM Boost V1.x Greg Kroah-Hartman
2013-05-06 22:58 ` [ 07/46] USB: ftdi_sio: correct ST Micro Connect Lite PIDs Greg Kroah-Hartman
2013-05-06 22:58 ` [ 08/46] usbfs: Always allow ctrl requests with USB_RECIP_ENDPOINT on the ctrl ep Greg Kroah-Hartman
2013-05-06 22:58 ` [ 09/46] usb-storage: CY7C68300A chips do not support Cypress ATACB Greg Kroah-Hartman
2013-05-06 22:58 ` [ 10/46] s390/memory hotplug: prevent offline of active memory increments Greg Kroah-Hartman
2013-05-06 22:58 ` [ 11/46] xen/time: Fix kasprintf splat when allocating timer%d IRQ line Greg Kroah-Hartman
2013-05-06 22:58 ` [ 12/46] serial_core.c: add put_device() after device_find_child() Greg Kroah-Hartman
2013-05-06 22:58 ` [ 13/46] tty: fix up atime/mtime mess, take three Greg Kroah-Hartman
2013-05-06 22:58 ` [ 14/46] fbcon: when font is freed, clear also vc_font.data Greg Kroah-Hartman
2013-05-06 22:58 ` [ 15/46] tracing: Use stack of calling function for stack tracer Greg Kroah-Hartman
2013-05-06 22:58 ` [ 16/46] tracing: Fix stack tracer with fentry use Greg Kroah-Hartman
2013-05-06 22:58 ` [ 17/46] tracing: Remove most or all of stack tracer stack size from stack_max_size Greg Kroah-Hartman
2013-05-06 22:58 ` [ 18/46] tracing: Fix off-by-one on allocating stat->pages Greg Kroah-Hartman
2013-05-06 22:58 ` [ 19/46] tracing: Check return value of tracing_init_dentry() Greg Kroah-Hartman
2013-05-06 22:58 ` [ 20/46] tracing: Reset ftrace_graph_filter_enabled if count is zero Greg Kroah-Hartman
2013-05-06 22:58 ` [ 21/46] i2c: xiic: must always write 16-bit words to TX_FIFO Greg Kroah-Hartman
2013-05-06 22:58 ` [ 22/46] Fix initialization of CMCI/CMCP interrupts Greg Kroah-Hartman
2013-05-06 22:58 ` [ 23/46] PCI / ACPI: Dont query OSC support with all possible controls Greg Kroah-Hartman
2013-05-06 22:58 ` [ 24/46] Wrong asm register contraints in the futex implementation Greg Kroah-Hartman
2013-05-06 22:58 ` [ 25/46] Wrong asm register contraints in the kvm implementation Greg Kroah-Hartman
2013-05-06 22:58 ` [ 26/46] fs/fscache/stats.c: fix memory leak Greg Kroah-Hartman
2013-05-06 22:58 ` Greg Kroah-Hartman [this message]
2013-05-06 22:58 ` [ 28/46] ALSA: usb-audio: Fix autopm error during probing Greg Kroah-Hartman
2013-05-06 22:58 ` [ 29/46] ASoC: max98088: Fix logging of hardware revision Greg Kroah-Hartman
2013-05-06 22:58 ` [ 30/46] hrtimer: Fix ktime_add_ns() overflow on 32bit architectures Greg Kroah-Hartman
2013-05-06 22:58 ` [ 31/46] hrtimer: Add expiry time overflow check in hrtimer_interrupt Greg Kroah-Hartman
2013-05-06 22:58 ` [ 32/46] drivers/rtc/rtc-cmos.c: dont disable hpet emulation on suspend Greg Kroah-Hartman
2013-05-06 22:58 ` [ 33/46] cgroup: fix an off-by-one bug which may trigger BUG_ON() Greg Kroah-Hartman
2013-05-06 22:58 ` [ 34/46] clockevents: Set dummy handler on CPU_DEAD shutdown Greg Kroah-Hartman
2013-05-06 22:58 ` [ 35/46] LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot Greg Kroah-Hartman
2013-05-06 22:58 ` [ 36/46] NFSv4: Handle NFS4ERR_DELAY and NFS4ERR_GRACE in nfs4_open_delegation_recall Greg Kroah-Hartman
2013-05-06 22:58 ` [ 37/46] nfsd4: dont close read-write opens too soon Greg Kroah-Hartman
2013-05-06 22:58 ` [ 38/46] nfsd: Decode and send 64bit time values Greg Kroah-Hartman
2013-05-06 22:58 ` [ 39/46] wireless: regulatory: fix channel disabling race condition Greg Kroah-Hartman
2013-05-06 22:58 ` [ 40/46] ipc: sysv shared memory limited to 8TiB Greg Kroah-Hartman
2013-05-06 22:58 ` [ 41/46] ext4: fix Kconfig documentation for CONFIG_EXT4_DEBUG Greg Kroah-Hartman
2013-05-06 22:58 ` [ 42/46] x86: Eliminate irq_mis_count counted in arch_irq_stat Greg Kroah-Hartman
2013-05-06 22:58 ` [ 43/46] mmc: core: Fix bit width test failing on old eMMC cards Greg Kroah-Hartman
2013-05-06 22:58 ` [ 44/46] mfd: adp5520: Restore mode bits on resume Greg Kroah-Hartman
2013-05-06 22:58 ` [ 45/46] s390: move dummy io_remap_pfn_range() to asm/pgtable.h Greg Kroah-Hartman
2013-05-06 22:58 ` [ 46/46] Revert :can: sja1000: fix handling on dt properties on little endian systems" Greg Kroah-Hartman
[not found] ` <CAKocOOM7rXbFbD73ZZ2zmS6SGgaytmWd-36uV+G2OVO88Zb=Og@mail.gmail.com>
2013-05-07 19:14 ` [ 00/46] 3.0.77-stable review Shuah Khan
2013-05-07 19:26 ` gregkh
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=20130506225823.511197895@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=clemens@ladisch.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox