From alsa-devel-owner@alsa.jcu.cz  Thu Jul  9 22:54:52 1998
Received: from altrade.nijmegen.inter.nl.net (altrade.nijmegen.inter.nl.net [193.67.237.6])
	by marvin.jcu.cz (8.8.8/8.8.8) with ESMTP id WAA31629;
	Thu, 9 Jul 1998 22:52:42 +0200
Received: from obelix.fvdpol.inter.nl.net by altrade.nijmegen.inter.nl.net
	via bd99-13.Breda.NL.net [193.79.246.238] with ESMTP
	id WAA17308 (8.8.8/3.28); Thu, 9 Jul 1998 22:52:40 +0200 (MET DST)
Received: (from frank@localhost) by obelix.fvdpol.inter.nl.net (8.8.7/8.7.3) id AAA00247; Thu, 9 Jul 1998 00:43:25 +0200
From: Frank van de Pol <F.K.W.van.de.Pol@inter.nl.net>
Message-Id: <199807082243.AAA00247@obelix.fvdpol.inter.nl.net>
Subject: Re: Lockups with GUS MIDI
To: perex@jcu.cz (Jaroslav Kysela)
Date: Thu, 9 Jul 1998 00:43:25 +0200 (MET DST)
Cc: alsa-devel@jcu.cz (alsa)
In-Reply-To: <Pine.LNX.3.95.980706215758.17334A-100000@marvin.jcu.cz> from "Jaroslav Kysela" at Jul 6, 98 10:01:26 pm
Content-Type: text
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list


Jaroslav Kysela wrote:
> 
> On Mon, 6 Jul 1998, Frank van de Pol wrote:
> >
> > I've run into another case where the GUS MIDI seems to cause lockups. With
> > this lockup the machine freezes completely, even the alt-sysreq doesn't work
> > anymore (interrupts disabled?).  I'm using a Gravis Ultrasound MAX card,
> > ALSA driver 0.1.3, kernel 2.1.96. The next test program shows the behaviour.
> > Please make sure you sync'ed your filesystems before running it!
> 
> OK.. Here is very small and clean fix (let me know if it helps):
> 
> ============================= cut here
> --- ../../1/alsa-driver/kernel/rawmidi.c        Tue Apr 28 17:34:29 1998
> +++ rawmidi.c   Mon Jul  6 21:54:13 1998
> @@ -652,7 +652,8 @@
>    }
>    if ( !rmidi -> output.u.s.used ) {
>      snd_spin_unlock( rmidi, output, &flags );
> -    snd_rawmidi_trigger_output( rmidi, 0 );
> +    if ( !result )
> +      snd_rawmidi_trigger_output( rmidi, 0 );
>      if ( rmidi -> output.flags & (SND_RAWMIDI_FLG_FLUSH|SND_RAWMIDI_FLG_SLEEP) )
>        snd_wakeup( rmidi, output );
>    } else if ( (rmidi -> output.flags & SND_RAWMIDI_FLG_SLEEP) && snd_rawmidi_output_ok( rmidi ) ) {
> ============================= cut here
> 
> Thanks for testing..

You're welcome :)

I implemented the patch, and gave the test program a try. Here are the
results:

- the system didn't freeze anymore as it did in my 2nd GUS MIDI problem ==>
	Patch works OK, yet another problem soved. Thanks

- the GUS MIDI problem I reported in the 1st place (crash, with page fault
  from irq handler) does still occour. It happens when the MIDI device is
  opened O_RDONLY, and (any) MIDI data is send to the GUS MIDI input port. 
  Could it true that the GUS uart generates interrupts on reception, but
  these interrupts are not handled properly (eg. writing to input queue that
  is not in place (==NULL???) ).  

  I tried it a few times, but was not able to read the console, it fast
  scrolled some oops data for a few seconds, sometimes dumping garbage to
  the console screen, and eventually automaticly performing a reboot. 
  Neat eh, automatic reboot on kernel crash without a watchdog :-( 

  Modify the test program to open the device O_RDONLY instead of O_RDWR to
  let this progam crash your system if data is send to the GUS MIDI input.

  Perhaps this helps you to find the cause of the crashes.


Regards,
Frank.


+---- --- -- -  -   -    - 
|Frank van de Pol                  -o)
|F.K.W.van.de.Pol@inter.NL.net     /\\
|                                 _\_v
|Linux - Why use Windows, since there is a door?

