linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* i810_audio driver v0.19 still freezes machine
@ 2002-01-10 10:58 Andris Pavenis
  2002-01-10 18:16 ` Doug Ledford
  0 siblings, 1 reply; 13+ messages in thread
From: Andris Pavenis @ 2002-01-10 10:58 UTC (permalink / raw)
  To: dledford, tom; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-10 10:58 i810_audio driver v0.19 still freezes machine Andris Pavenis
@ 2002-01-10 18:16 ` Doug Ledford
  2002-01-10 19:35   ` Alan Cox
  2002-01-11  9:28   ` i810_audio driver v0.19 still freezes machine Martin Dalecki
  0 siblings, 2 replies; 13+ messages in thread
From: Doug Ledford @ 2002-01-10 18:16 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: tom, linux-kernel

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 <dledford@redhat.com>  http://people.redhat.com/dledford
       Please check my web site for aic7xxx updates/answers before
                       e-mailing me about problems


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-10 19:35   ` Alan Cox
@ 2002-01-10 19:26     ` Doug Ledford
  2002-01-11  7:42       ` Andris Pavenis
  0 siblings, 1 reply; 13+ messages in thread
From: Doug Ledford @ 2002-01-10 19:26 UTC (permalink / raw)
  To: Alan Cox; +Cc: Andris Pavenis, tom, linux-kernel

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 <dledford@redhat.com>  http://people.redhat.com/dledford
       Please check my web site for aic7xxx updates/answers before
                       e-mailing me about problems


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-10 18:16 ` Doug Ledford
@ 2002-01-10 19:35   ` Alan Cox
  2002-01-10 19:26     ` Doug Ledford
  2002-01-11  9:28   ` i810_audio driver v0.19 still freezes machine Martin Dalecki
  1 sibling, 1 reply; 13+ messages in thread
From: Alan Cox @ 2002-01-10 19:35 UTC (permalink / raw)
  To: Doug Ledford; +Cc: Andris Pavenis, tom, linux-kernel

> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-10 19:26     ` Doug Ledford
@ 2002-01-11  7:42       ` Andris Pavenis
  2002-01-11  8:44         ` Doug Ledford
  0 siblings, 1 reply; 13+ messages in thread
From: Andris Pavenis @ 2002-01-11  7:42 UTC (permalink / raw)
  To: Doug Ledford, Alan Cox; +Cc: tom, linux-kernel

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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-11  7:42       ` Andris Pavenis
@ 2002-01-11  8:44         ` Doug Ledford
  2002-01-11 11:47           ` Andris Pavenis
  0 siblings, 1 reply; 13+ messages in thread
From: Doug Ledford @ 2002-01-11  8:44 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: Alan Cox, tom, linux-kernel

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 <dledford@redhat.com>  http://people.redhat.com/dledford
       Please check my web site for aic7xxx updates/answers before
                       e-mailing me about problems


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-10 18:16 ` Doug Ledford
  2002-01-10 19:35   ` Alan Cox
@ 2002-01-11  9:28   ` Martin Dalecki
  1 sibling, 0 replies; 13+ messages in thread
From: Martin Dalecki @ 2002-01-11  9:28 UTC (permalink / raw)
  To: Doug Ledford; +Cc: Andris Pavenis, tom, linux-kernel

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

>
>




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-11  8:44         ` Doug Ledford
@ 2002-01-11 11:47           ` Andris Pavenis
  2002-01-11 15:54             ` Doug Ledford
  0 siblings, 1 reply; 13+ messages in thread
From: Andris Pavenis @ 2002-01-11 11:47 UTC (permalink / raw)
  To: Doug Ledford; +Cc: tom, linux-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-11 11:47           ` Andris Pavenis
@ 2002-01-11 15:54             ` Doug Ledford
  2002-01-11 18:25               ` Andris Pavenis
  2002-01-13 22:54               ` i810_audio driver v0.20 Thomas Gschwind
  0 siblings, 2 replies; 13+ messages in thread
From: Doug Ledford @ 2002-01-11 15:54 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: tom, linux-kernel, mozgy, linux

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 <dledford@redhat.com>  http://people.redhat.com/dledford
       Please check my web site for aic7xxx updates/answers before
                       e-mailing me about problems


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
  2002-01-11 15:54             ` Doug Ledford
@ 2002-01-11 18:25               ` Andris Pavenis
  2002-01-13 22:54               ` i810_audio driver v0.20 Thomas Gschwind
  1 sibling, 0 replies; 13+ messages in thread
From: Andris Pavenis @ 2002-01-11 18:25 UTC (permalink / raw)
  To: Doug Ledford; +Cc: tom, linux-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* i810_audio driver v0.20
  2002-01-11 15:54             ` Doug Ledford
  2002-01-11 18:25               ` Andris Pavenis
@ 2002-01-13 22:54               ` Thomas Gschwind
  2002-01-14 18:27                 ` Doug Ledford
  1 sibling, 1 reply; 13+ messages in thread
From: Thomas Gschwind @ 2002-01-13 22:54 UTC (permalink / raw)
  To: Doug Ledford; +Cc: Andris Pavenis, linux-kernel, mozgy, linux

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: tom@infosys.tuwien.ac.at
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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.20
  2002-01-13 22:54               ` i810_audio driver v0.20 Thomas Gschwind
@ 2002-01-14 18:27                 ` Doug Ledford
  0 siblings, 0 replies; 13+ messages in thread
From: Doug Ledford @ 2002-01-14 18:27 UTC (permalink / raw)
  To: Thomas Gschwind; +Cc: Andris Pavenis, linux-kernel, mozgy, linux

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 <dledford@redhat.com>  http://people.redhat.com/dledford
       Please check my web site for aic7xxx updates/answers before
                       e-mailing me about problems


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: i810_audio driver v0.19 still freezes machine
       [not found] <Pine.LNX.4.33.0201101513410.31079-100000@coffee.psychology.mcmaster.ca>
@ 2002-01-10 21:34 ` Doug Ledford
  0 siblings, 0 replies; 13+ messages in thread
From: Doug Ledford @ 2002-01-10 21:34 UTC (permalink / raw)
  To: Mark Hahn; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-01-14 18:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-10 10:58 i810_audio driver v0.19 still freezes machine Andris Pavenis
2002-01-10 18:16 ` Doug Ledford
2002-01-10 19:35   ` Alan Cox
2002-01-10 19:26     ` Doug Ledford
2002-01-11  7:42       ` Andris Pavenis
2002-01-11  8:44         ` Doug Ledford
2002-01-11 11:47           ` Andris Pavenis
2002-01-11 15:54             ` Doug Ledford
2002-01-11 18:25               ` Andris Pavenis
2002-01-13 22:54               ` i810_audio driver v0.20 Thomas Gschwind
2002-01-14 18:27                 ` Doug Ledford
2002-01-11  9:28   ` i810_audio driver v0.19 still freezes machine Martin Dalecki
     [not found] <Pine.LNX.4.33.0201101513410.31079-100000@coffee.psychology.mcmaster.ca>
2002-01-10 21:34 ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).