From: lizf@kernel.org
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Clemens Ladisch <clemens@ladisch.de>,
Takashi Iwai <tiwai@suse.de>, Zefan Li <lizefan@huawei.com>
Subject: [PATCH 3.4 047/125] ALSA: usb-audio: prevent CH345 multiport output SysEx corruption
Date: Wed, 12 Oct 2016 20:32:43 +0800 [thread overview]
Message-ID: <1476275641-4697-47-git-send-email-lizf@kernel.org> (raw)
In-Reply-To: <1476275600-4626-1-git-send-email-lizf@kernel.org>
From: Clemens Ladisch <clemens@ladisch.de>
3.4.113-rc1 review patch. If anyone has any objections, please let me know.
------------------
commit 1ca8b201309d842642f221db7f02f71c0af5be2d upstream.
The CH345 USB MIDI chip has two output ports. However, they are
multiplexed through one pin, and the number of ports cannot be reduced
even for hardware that implements only one connector, so for those
devices, data sent to either port ends up on the same hardware output.
This becomes a problem when both ports are used at the same time, as
longer MIDI commands (such as SysEx messages) are likely to be
interrupted by messages from the other port, and thus to get lost.
It would not be possible for the driver to detect how many ports the
device actually has, except that in practice, _all_ devices built with
the CH345 have only one port. So we can just ignore the device's
descriptors, and hardcode one output port.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Zefan Li <lizefan@huawei.com>
---
sound/usb/midi.c | 3 +++
sound/usb/quirks-table.h | 11 +++++++++++
sound/usb/quirks.c | 1 +
sound/usb/usbaudio.h | 1 +
4 files changed, 16 insertions(+)
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index 11d324a..01c4982 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -2215,6 +2215,9 @@ int snd_usbmidi_create(struct snd_card *card,
err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
break;
+ case QUIRK_MIDI_CH345:
+ err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
+ break;
default:
snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
err = -ENXIO;
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 4cebbf7..862ed16 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2689,6 +2689,17 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.idProduct = 0x1020,
},
+/* QinHeng devices */
+{
+ USB_DEVICE(0x1a86, 0x752d),
+ .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+ .vendor_name = "QinHeng",
+ .product_name = "CH345",
+ .ifnum = 1,
+ .type = QUIRK_MIDI_CH345
+ }
+},
+
/* KeithMcMillen Stringport */
{
USB_DEVICE(0x1f38, 0x0001),
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 9c82f8b..b01d3cf 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -311,6 +311,7 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
[QUIRK_MIDI_CME] = create_any_midi_quirk,
[QUIRK_MIDI_AKAI] = create_any_midi_quirk,
[QUIRK_MIDI_FTDI] = create_any_midi_quirk,
+ [QUIRK_MIDI_CH345] = create_any_midi_quirk,
[QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
[QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
[QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk,
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 6c805a5..5e0e58a 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -81,6 +81,7 @@ enum quirk_type {
QUIRK_MIDI_AKAI,
QUIRK_MIDI_US122L,
QUIRK_MIDI_FTDI,
+ QUIRK_MIDI_CH345,
QUIRK_AUDIO_STANDARD_INTERFACE,
QUIRK_AUDIO_FIXED_ENDPOINT,
QUIRK_AUDIO_EDIROL_UAXX,
--
1.9.1
next prev parent reply other threads:[~2016-10-12 12:46 UTC|newest]
Thread overview: 142+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 12:33 [PATCH 3.4 000/125] 3.4.113-rc1 review lizf
2016-10-12 12:31 ` [PATCH 3.4 001/125] mac80211: fix driver RSSI event calculations lizf
2016-10-12 12:31 ` [PATCH 3.4 002/125] wm831x_power: Use IRQF_ONESHOT to request threaded IRQs lizf
2016-10-12 12:31 ` [PATCH 3.4 003/125] mwifiex: fix mwifiex_rdeeprom_read() lizf
2016-10-12 12:32 ` [PATCH 3.4 004/125] devres: fix a for loop bounds check lizf
2016-10-12 12:32 ` [PATCH 3.4 005/125] ARM: pxa: remove incorrect __init annotation on pxa27x_set_pwrmode lizf
2016-10-12 12:32 ` [PATCH 3.4 006/125] MIPS: atomic: Fix comment describing atomic64_add_unless's return value lizf
2016-10-12 12:32 ` [PATCH 3.4 007/125] recordmcount: Fix endianness handling bug for nop_mcount lizf
2016-10-12 13:10 ` Steven Rostedt
2016-10-13 1:06 ` Zefan Li
2016-10-12 12:32 ` [PATCH 3.4 008/125] ipv6: fix tunnel error handling lizf
2016-10-12 12:32 ` [PATCH 3.4 009/125] scsi: restart list search after unlock in scsi_remove_target lizf
2016-10-12 12:32 ` [PATCH 3.4 010/125] net: fix a race in dst_release() lizf
2016-10-12 12:32 ` [PATCH 3.4 011/125] FS-Cache: Increase reference of parent after registering, netfs success lizf
2016-10-12 12:32 ` [PATCH 3.4 012/125] FS-Cache: Don't override netfs's primary_index if registering failed lizf
2016-10-12 12:32 ` [PATCH 3.4 013/125] FS-Cache: Handle a write to the page immediately beyond the EOF marker lizf
2016-10-12 12:32 ` [PATCH 3.4 014/125] HID: core: Avoid uninitialized buffer access lizf
2016-10-12 12:32 ` [PATCH 3.4 015/125] mtd: mtdpart: fix add_mtd_partitions error path lizf
2016-10-12 12:32 ` [PATCH 3.4 016/125] iommu/vt-d: Fix ATSR handling for Root-Complex integrated endpoints lizf
2016-10-12 12:32 ` [PATCH 3.4 017/125] ext4, jbd2: ensure entering into panic after recording an error in superblock lizf
2016-10-12 12:32 ` [PATCH 3.4 018/125] Bluetooth: ath3k: Add support of AR3012 0cf3:817b device lizf
2016-10-12 12:32 ` [PATCH 3.4 019/125] staging: rtl8712: Add device ID for Sitecom WLA2100 lizf
2016-10-12 12:32 ` [PATCH 3.4 020/125] ACPI: Use correct IRQ when uninstalling ACPI interrupt handler lizf
2016-10-12 12:32 ` [PATCH 3.4 021/125] ALSA: hda - Disable 64bit address for Creative HDA controllers lizf
2016-10-12 12:32 ` [PATCH 3.4 022/125] megaraid_sas: Do not use PAGE_SIZE for max_sectors lizf
2016-10-12 12:32 ` [PATCH 3.4 023/125] Revert "dm mpath: fix stalls when handling invalid ioctls" lizf
2016-10-12 12:32 ` [PATCH 3.4 024/125] crypto: algif_hash - Only export and import on sockets with data lizf
2016-10-12 12:32 ` [PATCH 3.4 025/125] megaraid_sas : SMAP restriction--do not access user memory from IOCTL code lizf
2016-10-12 12:32 ` [PATCH 3.4 026/125] ALSA: hda - Apply pin fixup for HP ProBook 6550b lizf
2016-10-12 12:32 ` [PATCH 3.4 027/125] firewire: ohci: fix JMicron JMB38x IT context discovery lizf
2016-10-12 13:08 ` Stefan Richter
2016-10-12 12:32 ` [PATCH 3.4 028/125] x86/cpu: Call verify_cpu() after having entered long mode too lizf
2016-10-12 12:32 ` [PATCH 3.4 029/125] Btrfs: fix race leading to BUG_ON when running delalloc for nodatacow lizf
2016-10-12 12:32 ` [PATCH 3.4 030/125] perf: Fix inherited events vs. tracepoint filters lizf
2016-10-12 12:32 ` [PATCH 3.4 031/125] scsi_sysfs: Fix queue_ramp_up_period return code lizf
2016-10-12 12:32 ` [PATCH 3.4 032/125] binfmt_elf: Don't clobber passed executable's file header lizf
2016-10-12 12:32 ` [PATCH 3.4 033/125] sctp: translate host order to network order when setting a hmacid lizf
2016-10-12 12:32 ` [PATCH 3.4 034/125] usb: musb: core: fix order of arguments to ulpi write callback lizf
2016-10-12 12:32 ` [PATCH 3.4 035/125] net: fix __netdev_update_features return on ndo_set_features failure lizf
2016-10-12 12:32 ` [PATCH 3.4 036/125] mac80211: mesh: fix call_rcu() usage lizf
2016-10-12 12:32 ` [PATCH 3.4 037/125] macvlan: fix leak in macvlan_handle_frame lizf
2016-10-12 12:32 ` [PATCH 3.4 038/125] tcp: md5: fix lockdep annotation lizf
2016-10-12 12:32 ` [PATCH 3.4 039/125] usblp: do not set TASK_INTERRUPTIBLE before lock lizf
2016-10-12 12:32 ` [PATCH 3.4 040/125] ip6mr: call del_timer_sync() in ip6mr_free_table() lizf
2016-10-12 12:32 ` [PATCH 3.4 041/125] net: ip6mr: fix static mfc/dev leaks on table destruction lizf
2016-10-12 12:32 ` [PATCH 3.4 042/125] broadcom: fix PHY_ID_BCM5481 entry in the id table lizf
2016-10-12 12:32 ` [PATCH 3.4 043/125] ring-buffer: Update read stamp with first real commit on page lizf
2016-10-12 12:32 ` [PATCH 3.4 044/125] net/neighbour: fix crash at dumping device-agnostic proxy entries lizf
2016-10-12 12:32 ` [PATCH 3.4 045/125] iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock lizf
2016-10-12 12:32 ` [PATCH 3.4 046/125] ALSA: usb-audio: add packet size quirk for the Medeli DD305 lizf
2016-10-12 12:32 ` lizf [this message]
2016-10-12 12:32 ` [PATCH 3.4 048/125] ALSA: usb-audio: work around CH345 input SysEx corruption lizf
2016-10-12 12:32 ` [PATCH 3.4 049/125] USB: serial: option: add support for Novatel MiFi USB620L lizf
2016-10-12 12:32 ` [PATCH 3.4 050/125] ASoC: wm8962: correct addresses for HPF_C_0/1 lizf
2016-10-12 12:32 ` [PATCH 3.4 051/125] USB: option: add XS Stick W100-2 from 4G Systems lizf
2016-10-12 12:32 ` [PATCH 3.4 052/125] mac: validate mac_partition is within sector lizf
2016-10-12 12:32 ` [PATCH 3.4 053/125] can: sja1000: clear interrupts on start lizf
2016-10-12 12:32 ` [PATCH 3.4 054/125] vfs: Make sendfile(2) killable even better lizf
2016-10-12 12:32 ` [PATCH 3.4 055/125] vfs: Avoid softlockups with sendfile(2) lizf
2016-10-12 12:32 ` [PATCH 3.4 056/125] nfs: if we have no valid attrs, then don't declare the attribute cache valid lizf
2016-10-12 12:32 ` [PATCH 3.4 057/125] wan/x25: Fix use-after-free in x25_asy_open_tty() lizf
2016-10-12 12:32 ` [PATCH 3.4 058/125] sched/core: Clear the root_domain cpumasks in init_rootdomain() lizf
2016-10-12 12:32 ` [PATCH 3.4 059/125] x86/signal: Fix restart_syscall number for x32 tasks lizf
2016-10-12 12:32 ` [PATCH 3.4 060/125] fix sysvfs symlinks lizf
2016-10-12 12:32 ` [PATCH 3.4 061/125] fuse: break infinite loop in fuse_fill_write_pages() lizf
2016-10-12 12:32 ` [PATCH 3.4 062/125] USB: cp210x: Remove CP2110 ID from compatibility list lizf
2016-10-12 12:32 ` [PATCH 3.4 063/125] ext4: Fix handling of extended tv_sec lizf
2016-10-12 12:33 ` [PATCH 3.4 064/125] jbd2: Fix unreclaimed pages after truncate in data=journal mode lizf
2016-10-12 12:33 ` [PATCH 3.4 065/125] drm/ttm: Fixed a read/write lock imbalance lizf
2016-10-12 13:04 ` Thomas Hellstrom
2016-10-13 2:48 ` Zefan Li
2016-10-12 12:33 ` [PATCH 3.4 066/125] AHCI: Fix softreset failed issue of Port Multiplier lizf
2016-10-12 12:33 ` [PATCH 3.4 067/125] sata_sil: disable trim lizf
2016-10-12 12:33 ` [PATCH 3.4 068/125] USB: whci-hcd: add check for dma mapping error lizf
2016-10-12 12:33 ` [PATCH 3.4 069/125] dm btree: fix leak of bufio-backed block in btree_split_sibling error path lizf
2016-10-12 12:33 ` [PATCH 3.4 070/125] usb: xhci: fix config fail of FS hub behind a HS hub with MTT lizf
2016-10-12 12:33 ` [PATCH 3.4 071/125] ALSA: rme96: Fix unexpected volume reset after rate changes lizf
2016-10-12 12:33 ` [PATCH 3.4 072/125] sctp: start t5 timer only when peer rwnd is 0 and local state is SHUTDOWN_PENDING lizf
2016-10-12 12:33 ` [PATCH 3.4 073/125] 9p: ->evict_inode() should kick out ->i_data, not ->i_mapping lizf
2016-10-12 12:33 ` [PATCH 3.4 074/125] crypto: skcipher - Copy iv from desc even for 0-len walks lizf
2016-10-12 12:33 ` [PATCH 3.4 075/125] rfkill: copy the name into the rfkill struct lizf
2016-10-12 12:33 ` [PATCH 3.4 076/125] dm btree: fix bufio buffer leaks in dm_btree_del() error path lizf
2016-10-12 12:33 ` [PATCH 3.4 077/125] ses: Fix problems with simple enclosures lizf
2016-10-12 12:33 ` [PATCH 3.4 078/125] vgaarb: fix signal handling in vga_get() lizf
2016-10-12 12:33 ` [PATCH 3.4 079/125] ses: fix additional element traversal bug lizf
2016-10-12 12:33 ` [PATCH 3.4 080/125] parisc iommu: fix panic due to trying to allocate too large region lizf
2016-10-12 12:33 ` [PATCH 3.4 081/125] mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress lizf
2016-10-12 13:29 ` Michal Hocko
2016-10-13 2:49 ` Zefan Li
2016-10-12 12:33 ` [PATCH 3.4 082/125] mm: hugetlb: call huge_pte_alloc() only if ptep is null lizf
2016-10-12 12:33 ` [PATCH 3.4 083/125] tty: Fix GPF in flush_to_ldisc() lizf
2016-10-12 12:33 ` [PATCH 3.4 084/125] genirq: Prevent chip buslock deadlock lizf
2016-10-12 12:33 ` [PATCH 3.4 085/125] sh_eth: fix TX buffer byte-swapping lizf
2016-10-12 12:33 ` [PATCH 3.4 086/125] ARM: 8471/1: need to save/restore arm register(r11) when it is corrupted lizf
2016-10-12 12:33 ` [PATCH 3.4 087/125] mISDN: fix a loop count lizf
2016-10-12 12:33 ` [PATCH 3.4 088/125] ser_gigaset: fix deallocation of platform device structure lizf
2016-10-12 12:52 ` Paul Bolle
2016-10-13 2:52 ` Zefan Li
2016-10-13 8:11 ` Paul Bolle
2016-10-13 8:50 ` Zefan Li
2016-10-12 12:33 ` [PATCH 3.4 089/125] spi: fix parent-device reference leak lizf
2016-10-12 12:33 ` [PATCH 3.4 090/125] scripts: recordmcount: break hardlinks lizf
2016-10-12 12:33 ` [PATCH 3.4 091/125] ftrace/scripts: Have recordmcount copy the object file lizf
2016-10-12 12:33 ` [PATCH 3.4 092/125] xen: Add RING_COPY_REQUEST() lizf
2016-10-12 12:33 ` [PATCH 3.4 093/125] xen-netback: don't use last request to determine minimum Tx credit lizf
2016-10-12 12:33 ` [PATCH 3.4 094/125] xen-netback: use RING_COPY_REQUEST() throughout lizf
2016-10-12 12:33 ` [PATCH 3.4 095/125] xen-blkback: only read request operation from shared ring once lizf
2016-10-12 12:33 ` [PATCH 3.4 096/125] xen/pciback: Save xen_pci_op commands before processing it lizf
2016-10-12 12:59 ` Konrad Rzeszutek Wilk
2016-10-13 2:48 ` Zefan Li
2016-10-12 12:33 ` [PATCH 3.4 097/125] xen/pciback: Return error on XEN_PCI_OP_enable_msi when device has MSI or MSI-X enabled lizf
2016-10-12 12:33 ` [PATCH 3.4 098/125] xen/pciback: Return error on XEN_PCI_OP_enable_msix " lizf
2016-10-12 12:33 ` [PATCH 3.4 099/125] xen/pciback: Do not install an IRQ handler for MSI interrupts lizf
2016-10-12 12:33 ` [PATCH 3.4 100/125] xen/pciback: For XEN_PCI_OP_disable_msi[|x] only disable if device has MSI(X) enabled lizf
2016-10-12 12:33 ` [PATCH 3.4 101/125] xen/pciback: Don't allow MSI-X ops if PCI_COMMAND_MEMORY is not set lizf
2016-10-12 12:33 ` [PATCH 3.4 102/125] USB: ipaq.c: fix a timeout loop lizf
2016-10-12 12:33 ` [PATCH 3.4 103/125] USB: fix invalid memory access in hub_activate() lizf
2016-10-12 12:33 ` [PATCH 3.4 104/125] KEYS: Fix race between read and revoke lizf
2016-10-12 12:33 ` [PATCH 3.4 105/125] parisc: Fix syscall restarts lizf
2016-10-12 12:33 ` [PATCH 3.4 106/125] ipv6/addrlabel: fix ip6addrlbl_get() lizf
2016-10-12 12:33 ` [PATCH 3.4 107/125] ocfs2: fix BUG when calculate new backup super lizf
2016-10-12 12:33 ` [PATCH 3.4 108/125] mm/memory_hotplug.c: check for missing sections in test_pages_in_a_zone() lizf
2016-10-12 12:33 ` [PATCH 3.4 109/125] ftrace/scripts: Fix incorrect use of sprintf in recordmcount lizf
2016-10-12 12:33 ` [PATCH 3.4 110/125] net: possible use after free in dst_release lizf
2016-10-12 12:33 ` [PATCH 3.4 111/125] af_unix: fix a fatal race with bit fields lizf
2016-10-12 12:33 ` [PATCH 3.4 112/125] USB: ti_usb_3410_502: Fix ID table size lizf
2016-10-12 12:33 ` [PATCH 3.4 113/125] net: Fix skb csum races when peeking lizf
2016-10-12 12:33 ` [PATCH 3.4 114/125] udp: properly support MSG_PEEK with truncated buffers lizf
2016-10-12 12:33 ` [PATCH 3.4 115/125] drm/radeon: fix hotplug race at startup lizf
2016-10-12 12:33 ` [PATCH 3.4 116/125] sctp: Prevent soft lockup when sctp_accept() is called during a timeout event lizf
2016-10-12 12:33 ` [PATCH 3.4 117/125] ipv6: update ip6_rt_last_gc every time GC is run lizf
2016-10-12 12:33 ` [PATCH 3.4 118/125] ipv6: don't call fib6_run_gc() until routing is ready lizf
2016-10-12 12:33 ` [PATCH 3.4 119/125] ipv6: fix handling of blackhole and prohibit routes lizf
2016-10-12 12:33 ` [PATCH 3.4 120/125] Fix incomplete backport of commit 423f04d63cf4 lizf
2016-10-12 12:33 ` [PATCH 3.4 121/125] Fix incomplete backport of commit 0f792cf949a0 lizf
2016-10-12 12:33 ` [PATCH 3.4 122/125] Revert "USB: Add device quirk for ASUS T100 Base Station keyboard" lizf
2016-10-12 12:33 ` [PATCH 3.4 123/125] Revert "USB: Add OTG PET device to TPL" lizf
2016-10-12 12:34 ` [PATCH 3.4 124/125] tcp: make challenge acks less predictable lizf
2016-10-12 12:34 ` [PATCH 3.4 125/125] time: Prevent early expiry of hrtimers[CLOCK_REALTIME] at the leap second edge lizf
2016-10-12 16:56 ` [PATCH 3.4 000/125] 3.4.113-rc1 review Guenter Roeck
2016-10-13 1:06 ` Zefan Li
2016-10-13 21:15 ` Christoph Biedl
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=1476275641-4697-47-git-send-email-lizf@kernel.org \
--to=lizf@kernel.org \
--cc=clemens@ladisch.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--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;
as well as URLs for NNTP newsgroup(s).