OSDN Git Service

usb: gadget: u_audio: update hw_ptr in iso_complete after data copied
authorJoshua Frkuska <joshua_frkuska@mentor.com>
Thu, 21 Jun 2018 15:22:48 +0000 (17:22 +0200)
committerAjay Agarwal <ajaya@codeaurora.org>
Thu, 20 Dec 2018 15:11:17 +0000 (20:41 +0530)
commit06e25fbb83b34f3ca4db69d7ebf7ce1d8f4da65b
tree3385cc5c3180b3ed1f135fcda4f0b4aa36d94713
parent2eb1ffe38317b32ff2498d00eb2aca3d3495c153
usb: gadget: u_audio: update hw_ptr in iso_complete after data copied

In u_audio_iso_complete, the runtime hw_ptr is updated before the
data is actually copied over to/from the buffer/dma area. When
ALSA uses this hw_ptr, the data may not actually be available to
be used. This causes trash/stale audio to play/record. This
patch updates the hw_ptr after the data has been copied to avoid
this.

Change-Id: I94736e4ea899ac781076e9c425dda65eed7cc319
Fixes: 132fcb460839 ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Joshua Frkuska <joshua_frkuska@mentor.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 6b37bd78d30c890e575a1bda22978d1d2a233362
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
drivers/usb/gadget/function/u_audio.c