[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>
This commit is contained in:

committed by
Jaroslav Kysela

parent
072c01194d
commit
ef21ca24fa
@@ -2018,21 +2018,11 @@ static int __devinit snd_ensoniq_create(snd_card_t * card,
|
||||
if (pci->vendor == es1371_ac97_reset_hack[idx].vid &&
|
||||
pci->device == es1371_ac97_reset_hack[idx].did &&
|
||||
ensoniq->rev == es1371_ac97_reset_hack[idx].rev) {
|
||||
unsigned long tmo;
|
||||
signed long tmo2;
|
||||
|
||||
ensoniq->cssr |= ES_1371_ST_AC97_RST;
|
||||
outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
|
||||
/* need to delay around 20ms(bleech) to give
|
||||
some CODECs enough time to wakeup */
|
||||
tmo = jiffies + (HZ / 50) + 1;
|
||||
while (1) {
|
||||
tmo2 = tmo - jiffies;
|
||||
if (tmo2 <= 0)
|
||||
break;
|
||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||
schedule_timeout(tmo2);
|
||||
}
|
||||
msleep(20);
|
||||
break;
|
||||
}
|
||||
/* AC'97 warm reset to start the bitclk */
|
||||
|
Reference in New Issue
Block a user