diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-07-09 04:13:22 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-07-28 06:22:13 -0400 |
commit | ef21ca24faf28df6d06939e77d5032a313490289 (patch) | |
tree | 1c6c719f4671b803f1288eb8cdca18587ec2eb62 /sound/pci/ens1370.c | |
parent | 072c01194df6e4843582d09380b780987f642d6d (diff) |
[ALSA] sound/pci: fix-up sleeping paths
ENS1370/1+ driver,ES1968 driver,Intel8x0 driver,VIA82xx driver
VIA82xx-modem driver,AC97 Codec,ALI5451 driver,CS46xx driver
MIXART driver,RME HDSP driver,Trident driver,YMFPCI driver
Description: Fix-up sleeping in sound/pci. These changes fall under the
following two categories:
1) Replace schedule_timeout() with msleep() to guarantee the
task delays as expected. This also involved replacing/removing
custom sleep functions.
2) Do not assume jiffies will only increment by one if you
request a 1 jiffy sleep, i.e. use time_after/time_before in
while loops.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/ens1370.c')
-rw-r--r-- | sound/pci/ens1370.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index d4287338c042..78a81f3912a1 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -2018,21 +2018,11 @@ static int __devinit snd_ensoniq_create(snd_card_t * card, | |||
2018 | if (pci->vendor == es1371_ac97_reset_hack[idx].vid && | 2018 | if (pci->vendor == es1371_ac97_reset_hack[idx].vid && |
2019 | pci->device == es1371_ac97_reset_hack[idx].did && | 2019 | pci->device == es1371_ac97_reset_hack[idx].did && |
2020 | ensoniq->rev == es1371_ac97_reset_hack[idx].rev) { | 2020 | ensoniq->rev == es1371_ac97_reset_hack[idx].rev) { |
2021 | unsigned long tmo; | ||
2022 | signed long tmo2; | ||
2023 | |||
2024 | ensoniq->cssr |= ES_1371_ST_AC97_RST; | 2021 | ensoniq->cssr |= ES_1371_ST_AC97_RST; |
2025 | outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); | 2022 | outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); |
2026 | /* need to delay around 20ms(bleech) to give | 2023 | /* need to delay around 20ms(bleech) to give |
2027 | some CODECs enough time to wakeup */ | 2024 | some CODECs enough time to wakeup */ |
2028 | tmo = jiffies + (HZ / 50) + 1; | 2025 | msleep(20); |
2029 | while (1) { | ||
2030 | tmo2 = tmo - jiffies; | ||
2031 | if (tmo2 <= 0) | ||
2032 | break; | ||
2033 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
2034 | schedule_timeout(tmo2); | ||
2035 | } | ||
2036 | break; | 2026 | break; |
2037 | } | 2027 | } |
2038 | /* AC'97 warm reset to start the bitclk */ | 2028 | /* AC'97 warm reset to start the bitclk */ |