Subject: RE: funny PCMCIA card irq allocations on an IBM ThinkPad 560E
To: 'Jason Thorpe' <thorpej@nas.nasa.gov>
From: Allen D. Ball <ball@impression-technology.com>
List: port-i386
Date: 04/26/1999 17:43:28
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason's patch worked for me.  It also had the side-affect of removing the
"stray interrupt" kernel messages.

Jason, thank you.

Any hope of getting this into 1.4?

- -----Original Message-----
From: port-i386-owner@netbsd.org [mailto:port-i386-owner@netbsd.org]On
Behalf Of Jason Thorpe
Sent: Friday, April 23, 1999 4:01 PM
To: Thorsten Frueauf
Cc: ball@impression-technology.com; danw@MIT.EDU; port-i386@netbsd.org
Subject: Re: funny PCMCIA card irq allocations on an IBM ThinkPad 560E 


On Sat, 24 Apr 1999 00:49:16 +0200 (MET DST) 
 Thorsten Frueauf <s_frueau@ira.uka.de> wrote:

 > Of course, here it is again:
 > 
 > --- snip ---
 > --- src/sys/dev/pcmcia/aic_pcmcia.c	Fri Nov 20 03:12:15 1998
 > +++ /src/sys/dev/pcmcia/aic_pcmcia.c	Fri Apr 23 22:16:02 1999
 > @@ -182,6 +182,8 @@
 >  	printf(": %s\n", app->app_name);
 >  
 >  	aicattach(sc);
 > +
 > +	aic_pcmcia_enable (psc, 1);
 >  }

This patch is not correct.  It defeats the entire purpose of power management.
The SCSI code will automatically call this as soon as the reference count
on the bus goes non-zero (i.e. "someone opened a device on the bus").

I would suggest the following, more correct patch, to disable power management
in the driver, until the real bug can be tracked down:

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>

Index: aic_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/aic_pcmcia.c,v
retrieving revision 1.8
diff -c -r1.8 aic_pcmcia.c
*** aic_pcmcia.c	1998/11/20 02:12:15	1.8
- --- aic_pcmcia.c	1999/04/23 23:00:19
***************
*** 170,175 ****
- --- 170,176 ----
  		panic("aic_pcmcia_attach: impossible");
  	}
  
+ #if 0	/* XXX power management broken somehow. */
  	/* We can enable and disable the controller. */
  	sc->sc_adapter.scsipi_enable = aic_pcmcia_enable;
  
***************
*** 180,185 ****
- --- 181,197 ----
  	pcmcia_function_disable(pf);
  
  	printf(": %s\n", app->app_name);
+ #else
+ 	printf(": %s\n", app->app_name);
+ 
+ 	psc->sc_ih = pcmcia_intr_establish(psc->sc_pf, IPL_BIO,
+ 	    aicintr, &psc->sc_aic);
+ 	if (psc->sc_ih == NULL) {
+ 		printf("%s: couldn't establish interrupt handler\n",
+ 		    psc->sc_aic.sc_dev.dv_xname);
+ 		return;
+ 	}
+ #endif
  
  	aicattach(sc);
  }

-----BEGIN PGP SIGNATURE-----
Version: PGP for Business Security 5.5

iQA/AwUBNyUIMNtAFf3qaxFUEQKP5ACgvP1NK+/y3QB4dG4NHFSbjKVyRqAAn2vC
byiBIXit6V53I5/ZqTKMws6e
=m4r8
-----END PGP SIGNATURE-----