summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-20 11:17:17 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-12 08:33:56 +0100
commit3bcce5c0d931bf623adc5974200e4d7636b10bef (patch)
tree0174be815bfcf29033effad302171275756dbab9 /sound/pci/hda/hda_codec.c
parentaa88a3553eebdcc3ce6801aabb4ed0223bfa198e (diff)
downloadop-kernel-dev-3bcce5c0d931bf623adc5974200e4d7636b10bef.zip
op-kernel-dev-3bcce5c0d931bf623adc5974200e4d7636b10bef.tar.gz
ALSA: hda - Check CORB overflow
Add an overflow check of CORB in HD-audio controller and codec drivers so that flood of sequential writes would work properly. In the controller side, add a check of CORB read-pointer to make returning -EAGAIN when it's full. Meanwhile in the codec side, when -EAGAIN error is received, it retries the write after flushing the pending verbs (calling get_response() essentially does it). Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 3207e5c..afc3ccd 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -222,8 +222,14 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
again:
snd_hda_power_up(codec);
mutex_lock(&bus->cmd_mutex);
- trace_hda_send_cmd(codec, cmd);
- err = bus->ops.command(bus, cmd);
+ for (;;) {
+ trace_hda_send_cmd(codec, cmd);
+ err = bus->ops.command(bus, cmd);
+ if (err != -EAGAIN)
+ break;
+ /* process pending verbs */
+ bus->ops.get_response(bus, codec->addr);
+ }
if (!err && res) {
*res = bus->ops.get_response(bus, codec->addr);
trace_hda_get_response(codec, *res);
OpenPOWER on IntegriCloud