From 3cc3ec11c98d3cad9b56a3f0078521d27a0ac460 Mon Sep 17 00:00:00 2001 From: dann frazier Date: Mon, 15 May 2006 05:47:42 +0000 Subject: [PATCH] * cs4281 - Fix the check of timeout in probe to deal with variable HZ. (closes: #361197) svn path=/dists/sid/linux-2.6/; revision=6568 --- debian/changelog | 6 +- debian/patches/cs4281-probe-timeout.patch | 100 ++++++++++++++++++++++ debian/patches/series/14 | 1 + 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 debian/patches/cs4281-probe-timeout.patch diff --git a/debian/changelog b/debian/changelog index 95edae850..8250005b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,7 +9,11 @@ linux-2.6 (2.6.16-14) UNRELEASED; urgency=low * [m68k] Add cross-compile instructions. * [6m8k] Enable INPUT_EVDEV for yaird. - -- Christian T. Steigies Sun, 14 May 2006 19:46:29 +0200 + [ dann frazier ] + * cs4281 - Fix the check of timeout in probe to deal with variable HZ. + (closes: #361197) + + -- dann frazier Mon, 15 May 2006 00:43:43 -0500 linux-2.6 (2.6.16-13) unstable; urgency=low diff --git a/debian/patches/cs4281-probe-timeout.patch b/debian/patches/cs4281-probe-timeout.patch new file mode 100644 index 000000000..870887bb6 --- /dev/null +++ b/debian/patches/cs4281-probe-timeout.patch @@ -0,0 +1,100 @@ +From: Takashi Iwai +Date: Wed, 29 Mar 2006 10:33:38 +0000 (+0200) +Subject: [ALSA] cs4281 - Fix the check of timeout in probe +X-Git-Tag: v2.6.17-rc1 +X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=38223daa1aa98d0a6f35ba7addcfefc756a04f5e + +[ALSA] cs4281 - Fix the check of timeout in probe + +Fix the check of timeout in probe routines to work properly +reagrdless of HZ (ALSA bug#1976). + +Signed-off-by: Takashi Iwai +--- + +--- a/sound/pci/cs4281.c ++++ b/sound/pci/cs4281.c +@@ -1416,7 +1416,7 @@ static int __devinit snd_cs4281_create(s + static int snd_cs4281_chip_init(struct cs4281 *chip) + { + unsigned int tmp; +- int timeout; ++ unsigned long end_time; + int retry_count = 2; + + /* Having EPPMC.FPDN=1 prevent proper chip initialisation */ +@@ -1496,7 +1496,7 @@ static int snd_cs4281_chip_init(struct c + /* + * Wait for the DLL ready signal from the clock logic. + */ +- timeout = 100; ++ end_time = jiffies + HZ; + do { + /* + * Read the AC97 status register to see if we've seen a CODEC +@@ -1504,8 +1504,8 @@ static int snd_cs4281_chip_init(struct c + */ + if (snd_cs4281_peekBA0(chip, BA0_CLKCR1) & BA0_CLKCR1_DLLRDY) + goto __ok0; +- msleep(1); +- } while (timeout-- > 0); ++ schedule_timeout_uninterruptible(1); ++ } while (time_after_eq(end_time, jiffies)); + + snd_printk(KERN_ERR "DLLRDY not seen\n"); + return -EIO; +@@ -1522,7 +1522,7 @@ static int snd_cs4281_chip_init(struct c + /* + * Wait for the codec ready signal from the AC97 codec. + */ +- timeout = 100; ++ end_time = jiffies + HZ; + do { + /* + * Read the AC97 status register to see if we've seen a CODEC +@@ -1530,20 +1530,20 @@ static int snd_cs4281_chip_init(struct c + */ + if (snd_cs4281_peekBA0(chip, BA0_ACSTS) & BA0_ACSTS_CRDY) + goto __ok1; +- msleep(1); +- } while (timeout-- > 0); ++ schedule_timeout_uninterruptible(1); ++ } while (time_after_eq(end_time, jiffies)); + + snd_printk(KERN_ERR "never read codec ready from AC'97 (0x%x)\n", snd_cs4281_peekBA0(chip, BA0_ACSTS)); + return -EIO; + + __ok1: + if (chip->dual_codec) { +- timeout = 100; ++ end_time = jiffies + HZ; + do { + if (snd_cs4281_peekBA0(chip, BA0_ACSTS2) & BA0_ACSTS_CRDY) + goto __codec2_ok; +- msleep(1); +- } while (timeout-- > 0); ++ schedule_timeout_uninterruptible(1); ++ } while (time_after_eq(end_time, jiffies)); + snd_printk(KERN_INFO "secondary codec doesn't respond. disable it...\n"); + chip->dual_codec = 0; + __codec2_ok: ; +@@ -1561,7 +1561,7 @@ static int snd_cs4281_chip_init(struct c + * the codec is pumping ADC data across the AC-link. + */ + +- timeout = 100; ++ end_time = jiffies + HZ; + do { + /* + * Read the input slot valid register and see if input slots 3 +@@ -1569,8 +1569,8 @@ static int snd_cs4281_chip_init(struct c + */ + if ((snd_cs4281_peekBA0(chip, BA0_ACISV) & (BA0_ACISV_SLV(3) | BA0_ACISV_SLV(4))) == (BA0_ACISV_SLV(3) | BA0_ACISV_SLV(4))) + goto __ok2; +- msleep(1); +- } while (timeout-- > 0); ++ schedule_timeout_uninterruptible(1); ++ } while (time_after_eq(end_time, jiffies)); + + if (--retry_count > 0) + goto __retry; diff --git a/debian/patches/series/14 b/debian/patches/series/14 index 0d32f5cf9..4e25625e7 100644 --- a/debian/patches/series/14 +++ b/debian/patches/series/14 @@ -1 +1,2 @@ + 2.6.16.16 ++ cs4281-probe-timeout.patch