2002-01-10 10:59:40

by Andris Pavenis

[permalink] [raw]
Subject: i810_audio driver v0.19 still freezes machine

I found that i810_audio driver v0.19 from
http://people.redhat.com/dledford/i810_audio.c.gz
still freezes machine after /dev/dsp is being closed
(printk at end of i810_release()). It doesn't happen always though.

I did tests under KDE. artsd is setup to close /dev/dsp after being idle
for 5 seconds. System rather often (but not always) freezes
after that.

Earlier v0.14 from
http://www.infosys.tuwien.ac.at/Staff/tom/SiS7012/i810_audio-020105.c
doen't cause similar problems for me

Andris


2002-01-10 18:17:09

by Doug Ledford

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

Andris Pavenis wrote:

> I found that i810_audio driver v0.19 from
> http://people.redhat.com/dledford/i810_audio.c.gz
> still freezes machine after /dev/dsp is being closed
> (printk at end of i810_release()). It doesn't happen always though.


I'm unable to duplicate this (the current 0.19 driver doesn't hang at all on
me now under any of my tests). Try to find a way to duplicate it (either by
playing a specific wav file using the play command, or by doing something in
particular to make artsd do it, or something else). If you can find a way
to duplicate it, then I can see about getting a proper fix for it.


> I did tests under KDE. artsd is setup to close /dev/dsp after being idle
> for 5 seconds. System rather often (but not always) freezes
> after that.
>
> Earlier v0.14 from
> http://www.infosys.tuwien.ac.at/Staff/tom/SiS7012/i810_audio-020105.c
> doen't cause similar problems for me
>
> Andris
>
>



--

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

2002-01-10 19:24:39

by Alan

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

> I'm unable to duplicate this (the current 0.19 driver doesn't hang at all on
> me now under any of my tests). Try to find a way to duplicate it (either by
> playing a specific wav file using the play command, or by doing something in
> particular to make artsd do it, or something else). If you can find a way
> to duplicate it, then I can see about getting a proper fix for it.

Make sure you test with both apic and non apic Doug. The previous hangs I
fixed up were specific to APIC mode because the APIC means the irq arrival
is later and more asynchronous

2002-01-10 19:27:09

by Doug Ledford

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

Alan Cox wrote:

>>I'm unable to duplicate this (the current 0.19 driver doesn't hang at all on
>>me now under any of my tests). Try to find a way to duplicate it (either by
>>playing a specific wav file using the play command, or by doing something in
>>particular to make artsd do it, or something else). If you can find a way
>>to duplicate it, then I can see about getting a proper fix for it.
>>
>
> Make sure you test with both apic and non apic Doug. The previous hangs I
> fixed up were specific to APIC mode because the APIC means the irq arrival
> is later and more asynchronous
>
>

I can't. APIC makes my test machine (my only i810 machine) hang on boot :-(

--

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

2002-01-10 21:34:23

by Doug Ledford

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

--- 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);


Attachments:
test.patch (822.00 B)

2002-01-11 07:44:15

by Andris Pavenis

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

On Thursday 10 January 2002 21:26, Doug Ledford wrote:
> Alan Cox wrote:
> > Make sure you test with both apic and non apic Doug. The previous hangs I
> > fixed up were specific to APIC mode because the APIC means the irq
> > arrival is later and more asynchronous
>
> I can't. APIC makes my test machine (my only i810 machine) hang on boot

I have both 'Local APIC support on uniprocessors' and
'IO_APIC support on uniprocessors' enabled in kernel configuration.
Should I try i810_audio.c v0.19 after disabling APIC support in
kernel (v2.4.17)?

Andris


2002-01-11 08:44:35

by Doug Ledford

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

Andris Pavenis wrote:

> On Thursday 10 January 2002 21:26, Doug Ledford wrote:
>
>>Alan Cox wrote:
>>
>>>Make sure you test with both apic and non apic Doug. The previous hangs I
>>>fixed up were specific to APIC mode because the APIC means the irq
>>>arrival is later and more asynchronous
>>>
>>I can't. APIC makes my test machine (my only i810 machine) hang on boot
>>
>
> I have both 'Local APIC support on uniprocessors' and
> 'IO_APIC support on uniprocessors' enabled in kernel configuration.
> Should I try i810_audio.c v0.19 after disabling APIC support in
> kernel (v2.4.17)?
>
> Andris
>
>
>

No, just try the 0.20 version that I have up in the normal place. It should
solve your problem.

--

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

2002-01-11 09:29:30

by Martin Dalecki

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

Doug Ledford wrote:

> Andris Pavenis wrote:
>
>> I found that i810_audio driver v0.19 from
>> http://people.redhat.com/dledford/i810_audio.c.gz
>> still freezes machine after /dev/dsp is being closed (printk at end
>> of i810_release()). It doesn't happen always though.
>
>
>
> I'm unable to duplicate this (the current 0.19 driver doesn't hang at
> all on me now under any of my tests). Try to find a way to duplicate
> it (either by playing a specific wav file using the play command, or
> by doing something in particular to make artsd do it, or something
> else). If you can find a way to duplicate it, then I can see about
> getting a proper fix for it.

Just for the record:
18 works for me even in the context of KDE and artsd without any flaws.
(SiS735 board).

>
>



2002-01-11 11:47:51

by Andris Pavenis

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

On Friday 11 January 2002 10:44, Doug Ledford wrote:
> Andris Pavenis wrote:
> > On Thursday 10 January 2002 21:26, Doug Ledford wrote:
> >>Alan Cox wrote:
> >>>Make sure you test with both apic and non apic Doug. The previous hangs
> >>> I fixed up were specific to APIC mode because the APIC means the irq
> >>> arrival is later and more asynchronous
> >>
> >>I can't. APIC makes my test machine (my only i810 machine) hang on boot
> >
> > I have both 'Local APIC support on uniprocessors' and
> > 'IO_APIC support on uniprocessors' enabled in kernel configuration.
> > Should I try i810_audio.c v0.19 after disabling APIC support in
> > kernel (v2.4.17)?
>
> No, just try the 0.20 version that I have up in the normal place. It
> should solve your problem.

Tried. I haven't been able to freeze box after some not very long torturing
with artsd, but there is another new trouble:

For test I'm letting artsd to play some WAV file and after that give some
time for it to close /dev/dsp. After some times there is no more sound and
I'm getting a message that /dev/dsp is busy when trying to restart artsd.
Anyway I can reload i810_audio driver and restart artsd to get sound working
again. 'fuser /dev/dsp' also doesn't show that it is opened

Andris

2002-01-11 15:54:28

by Doug Ledford

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

Andris Pavenis wrote:


> Tried. I haven't been able to freeze box after some not very long torturing
> with artsd, but there is another new trouble:
>
> For test I'm letting artsd to play some WAV file and after that give some
> time for it to close /dev/dsp. After some times there is no more sound and
> I'm getting a message that /dev/dsp is busy when trying to restart artsd.
> Anyway I can reload i810_audio driver and restart artsd to get sound working
> again. 'fuser /dev/dsp' also doesn't show that it is opened


Actually, as a couple people have pointed out to me, the version on my site
was somehow a .19 version. I've placed the real .20 on my site as of a few
minutes ago, so please try with it (and the real .20 should solve the
problem you are related Andris in that it won't allow the driver to accept
signals during close, which is why /dev/dsp would quit working for you).




--

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

2002-01-11 18:26:17

by Andris Pavenis

[permalink] [raw]
Subject: Re: i810_audio driver v0.19 still freezes machine

On Friday 11 January 2002 17:54, Doug Ledford wrote:
> Andris Pavenis wrote:
> > Tried. I haven't been able to freeze box after some not very long
> > torturing with artsd, but there is another new trouble:
> >
> > For test I'm letting artsd to play some WAV file and after that give some
> > time for it to close /dev/dsp. After some times there is no more sound
> > and I'm getting a message that /dev/dsp is busy when trying to restart
> > artsd. Anyway I can reload i810_audio driver and restart artsd to get
> > sound working again. 'fuser /dev/dsp' also doesn't show that it is opened
>
> Actually, as a couple people have pointed out to me, the version on my site
> was somehow a .19 version. I've placed the real .20 on my site as of a few
> minutes ago, so please try with it (and the real .20 should solve the
> problem you are related Andris in that it won't allow the driver to accept
> signals during close, which is why /dev/dsp would quit working for you).

Thanks

Earlier today I didn't take v0.19 today from You're page, but patched
previous v0.19 with Your patch posted to linux-kernel mailing list yesterday
evening.

Now about v0.20. Seems that it survives following torture:

- setup artsd to close /dev/dsp after 1 second idle

- running something like
while true; do artsplay beep.wav; sleep 3s; done

Kernel version 2.4.18-pre3

Only one purely cosmetical patch to avoid unnecessary warning from gcc
(I used gcc-2.95.3):

--- i810_audio.c-0.20 Fri Jan 11 15:48:32 2002
+++ i810_audio.c Fri Jan 11 19:54:05 2002
@@ -1739,7 +1739,7 @@
#endif
if (dmabuf->enable != DAC_RUNNING || file->f_flags & O_NONBLOCK)
return 0;
- if(val = drain_dac(state, 1))
+ if((val = drain_dac(state, 1)))
return val;
dmabuf->total_bytes = 0;
return 0;


Andris

2002-01-13 23:02:49

by Thomas Gschwind

[permalink] [raw]
Subject: i810_audio driver v0.20

Doug,

On Fri, Jan 11, 2002 at 10:54:08AM -0500, Doug Ledford wrote:
> Actually, as a couple people have pointed out to me, the version on my site
> was somehow a .19 version. I've placed the real .20 on my site as of a few
> minutes ago, so please try with it (and the real .20 should solve the
> problem you are related Andris in that it won't allow the driver to accept
> signals during close, which is why /dev/dsp would quit working for you).

Sorry, haven't had much time the last few days. I downloaded the
latest version of the i810 driver. It works perfectly fine on my
K7S5A board exce. Both playback and recording.

I also looked at the code. What do think of replacing udelay(1); with
if(offset == 0) udelay(1); in i810_get_dma_addr since the mentioned
picb problem can only occur if picb == 0?

Thomas
--
Thomas Gschwind Email: [email protected]
Technische Universit?t Wien
Argentinierstra?e 8/E1841 Tel: +43 (1) 58801 ext. 18412
A-1040 Wien, Austria, Europe Fax: +43 (1) 58801 ext. 18491

2002-01-14 18:28:22

by Doug Ledford

[permalink] [raw]
Subject: Re: i810_audio driver v0.20

Thomas Gschwind wrote:


> I also looked at the code. What do think of replacing udelay(1); with
> if(offset == 0) udelay(1); in i810_get_dma_addr since the mentioned
> picb problem can only occur if picb == 0?


Sure, that should be fine.





--

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