From 3b1c91d1b52205f7639826e330dfdf1e59c75641 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 12 Dec 2012 11:10:49 +0100 Subject: [PATCH] --- yaml --- r: 342999 b: refs/heads/master c: cc5ede3efdf1c3777efdf92124e7572c1024a7f0 h: refs/heads/master i: 342997: 5de3cfbe2963c1d4c638937c4241b8939b9d38e2 342995: ea9a49ff1468f53b20d34ad0a9a2b79a3a91a144 342991: 738897131881bc82f0e55b24dbff0e9a67c860ab v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_intel.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 45c78b43cb7b..187a2a488849 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fa348da53b6ffd3dcebae288d4072a4571755d35 +refs/heads/master: cc5ede3efdf1c3777efdf92124e7572c1024a7f0 diff --git a/trunk/sound/pci/hda/hda_intel.c b/trunk/sound/pci/hda/hda_intel.c index d00dea0eb7f9..eb88c528e120 100644 --- a/trunk/sound/pci/hda/hda_intel.c +++ b/trunk/sound/pci/hda/hda_intel.c @@ -799,7 +799,12 @@ static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) spin_lock_irq(&chip->reg_lock); /* add command to corb */ - wp = azx_readb(chip, CORBWP); + wp = azx_readw(chip, CORBWP); + if (wp == 0xffff) { + /* something wrong, controller likely turned to D3 */ + spin_unlock_irq(&chip->reg_lock); + return -1; + } wp++; wp %= ICH6_MAX_CORB_ENTRIES; @@ -821,7 +826,12 @@ static void azx_update_rirb(struct azx *chip) unsigned int addr; u32 res, res_ex; - wp = azx_readb(chip, RIRBWP); + wp = azx_readw(chip, RIRBWP); + if (wp == 0xffff) { + /* something wrong, controller likely turned to D3 */ + return; + } + if (wp == chip->rirb.wp) return; chip->rirb.wp = wp;