lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080706171548.GA9962@vespa.holoscopio.com>
Date:	Sun, 6 Jul 2008 14:15:56 -0300
From:	Thadeu Lima de Souza Cascardo <cascardo@...aslivre.org>
To:	linux-kernel@...r.kernel.org
Cc:	tiwai@...e.de
Subject: [PATCH] Wait for all codecs to be ready if doing a cold reset

If AC97_POWER_SAVE is enabled, intel8x0 does a cold reset when
initializing the codecs. While resuming, it does not wait for all codecs
to be active. Sound card does not work after a resume without it,
however. This patch fixes it.
---
 sound/pci/intel8x0.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 048d99e..7228a0a 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2335,16 +2335,6 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
 				   igetdword(chip, ICHREG(GLOB_STA)));
 			return -EIO;
 		}
-
-		/* wait for other codecs ready status. */
-		end_time = jiffies + HZ / 4;
-		while (status != chip->codec_isr_bits &&
-		       time_after_eq(end_time, jiffies)) {
-			schedule_timeout_uninterruptible(1);
-			status |= igetdword(chip, ICHREG(GLOB_STA)) &
-				chip->codec_isr_bits;
-		}
-
 	} else {
 		/* resume phase */
 		int i;
@@ -2363,6 +2353,20 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
 		} while (time_after_eq(end_time, jiffies));
 	}
 
+#ifndef CONFIG_SND_AC97_POWER_SAVE
+	if (probing)
+#endif
+	{
+		/* wait for other codecs ready status. */
+		end_time = jiffies + HZ / 4;
+		while (status != chip->codec_isr_bits &&
+		       time_after_eq(end_time, jiffies)) {
+			schedule_timeout_uninterruptible(1);
+			status |= igetdword(chip, ICHREG(GLOB_STA)) &
+				chip->codec_isr_bits;
+		}
+	}
+
 	if (chip->device_type == DEVICE_SIS) {
 		/* unmute the output on SIS7012 */
 		iputword(chip, 0x4c, igetword(chip, 0x4c) | 1);
-- 
1.5.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ