Re: i810_audio driver v0.19 still freezes machine

Doug Ledford
2002-01-10T21:34:23Z

[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]

Mark Hahn wrote:

>>So it hangs with artsd then? Get me the output of ps ax | grep artsd and
>>that will tell me the artsd configuration on both machines. Also, just
>>using artsd is all you are doing, not anything else to trigger the lockup?
>>
>
> to be honest, I haven't a clue - I've never looked at audio
> stuff much. on the bad machine, it plays a few silly kde
> sound effects, and then everything stops. (RH 7.2, 2.4.18-pre2
> and your i810.c)

Duh!!! All of the reports thus far have been artsd. My guess is that we
are getting a signal during drain_dac() and returning with -ERESTARTSYS on
close. Well, as it turns out i810_release() isn't checking the return value
of drain_dac() and if we take a signal in drain_dac() then i810_release()
releases the card's data structs without actually shutting down the card:
Lockup. So, try this patch and see if it doesn't solve your problem.

--

Doug Ledford <dledford@redhat.com> http://people.redhat.com/dledford
Please check my web site for aic7xxx updates/answers before
e-mailing me about problems

[-- Attachment #2: test.patch --]
[-- Type: text/plain, Size: 822 bytes --]

--- i810_audio.c.19 Wed Jan 9 04:58:41 2002
+++ i810_audio.c.20 Thu Jan 10 16:32:29 2002
@@ -1739,7 +1739,8 @@ static int i810_ioctl(struct inode *inod
#endif
if (dmabuf->enable != DAC_RUNNING || file->f_flags & O_NONBLOCK)
return 0;
- drain_dac(state);
+ if(val = drain_dac(state))
+ return val;
dmabuf->total_bytes = 0;
return 0;

@@ -2417,12 +2418,16 @@ static int i810_release(struct inode *in
struct i810_card *card = state->card;
struct dmabuf *dmabuf = &state->dmabuf;
unsigned long flags;
+ int ret;

lock_kernel();

/* stop DMA state machine and free DMA buffers/channels */
if(dmabuf->trigger & PCM_ENABLE_OUTPUT) {
- drain_dac(state);
+ if(ret = drain_dac(state)) {
+ unlock_kernel();
+ return ret;
+ }
}
if(dmabuf->trigger & PCM_ENABLE_INPUT) {
stop_adc(state);