Subject: kern/9445: PCMCIA is severely broken after recent changes
To: None <gnats-bugs@gnats.netbsd.org>
From: None <root@ihack.net>
List: netbsd-bugs
Date: 02/19/2000 09:22:20
>Number:         9445
>Category:       kern
>Synopsis:       PCMCIA is severely broken after recent changes
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 18 22:15:00 2000
>Last-Modified:
>Originator:     Charles M. Hannum
>Organization:
	Internetwork Hacker
>Release:        -current as of 20000218
>Environment:
	Toshiba Satellite 2550CDT, IBM WorkPad z50
System: NetBSD lop-nor.ihack.net 1.4T NetBSD 1.4T (LOP-NOR) #39: Thu Feb 17 22:05:07 EST 2000 mycroft@lop-nor.ihack.net:/usr/src/sys/arch/i386/compile/LOP-NOR i386


>Description:
	Two recent changes have *SEVERELY* broken PCMCIA support:

	* Changing the power-up delay() to a tsleep().  This creates a serious
	  race condition between socket event threads that can completely trash
	  the PCMCIA controller state -- especially at boot time when multiple
	  cards are present.

	* Moving the initial probe for PCMCIA cards into the event thread has
	  caused a problem with wdc_pcmcia to become much more evident.  It is
	  no longer possible to use a PCMCIA or CF memory card *at all* in most
	  machines -- whether it's inserted at boot time or later.

>How-To-Repeat:
	See above.

>Fix:
	The first problem can be solved either by locking between threads, or
	by using only a single thread per pcic.  The latter is probably best.

	The second problem is due to the hackish way the wdc/wd probe is done.
	It either needs to be rearranged to use interrupts, or it needs to
	avoid screwing up its own state by enabling the interrupt handler
	before it's ready to be used.

>Audit-Trail:
>Unformatted: