NetBSD Problem Report #33581

From www@NetBSD.org  Mon May 29 01:23:58 2006
Return-Path: <www@NetBSD.org>
Received: by narn.NetBSD.org (Postfix, from userid 31301)
	id 98D3663B88E; Mon, 29 May 2006 01:23:58 +0000 (UTC)
Message-Id: <20060529012358.98D3663B88E@narn.NetBSD.org>
Date: Mon, 29 May 2006 01:23:58 +0000 (UTC)
From: djb_netbsd@charter.net
Reply-To: djb_netbsd@charter.net
To: gnats-bugs@NetBSD.org
Subject: Z Com XI-325H / SMC2532W-B PC Card wedges system and overheats card
X-Send-Pr-Version: www-1.0

>Number:         33581
>Category:       kern
>Synopsis:       Z Com XI-325H / SMC2532W-B PC Card wedges system and overheats card
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 29 01:25:00 +0000 2006
>Last-Modified:  Mon May 29 23:50:00 +0000 2006
>Originator:     Dave J. Barnes
>Release:        NetBSD 3.0
>Organization:
>Environment:
NetBSD anchovy 3.0 NetBSD 3.0 (2006/05/28 DJB Multia/alpha) #0: Sun May 28 15:17:41 CDT 2006  root@anchovy:/usr/NetBSD_src/usr/src/sys/arch/alpha/compile/DJB alpha
>Description:
Inserting a PCMCIA card based on the Z Com XI-325 series wedges the system when power is enabled to the card.  The system is in a tight loop constantly accessing the card which causes the interface chip, an Intersil ISL3873B, to overheat.  If the card is left inserted, the card will be damaged.  The interface chip temperature was observed to be over 150 degrees F - too hot to touch!  

Problem area was found to be in dev/ic/i82365.c in subroutine pcic_chip_socket_enable().

NOTE: Other systems could have the same problem with the XI-325 PC Cards.  However, the card works fine in my IBM Z50 running hpcmips version 3.0.  Don't have anything else here to test with.  Other PC Cards in my junk box that claim to be Prism 2.5 using the ISL3873B were in fact using the older HFA3842 MAC chip (I looked inside). Problem may be with all Prism 2.5/ISL3873B based cards and not just XI-325.
>How-To-Repeat:
Run GENERIC kernel, or any custom Multia kernel without the patch below;
insert SMC3532W-B (which is a XI-325H); 
observe system hang; 
remove PC Card; 
card is very hot.
>Fix:
Apply diff below.

dmesg fragment:
wi0 at pcmcia0 function 0: <SMC, SMC2532W-B EliteConnect Wireless Adapter, , >
pcic0: port 0x300-0x33f
wi0: 802.11 address 00:04:e2:80:29:8b
wi0: using RF:PRISM2.5 MAC:ISL3873B(PCMCIA)
wi0: Intersil Firmware: Primary (1.1.1), Station (1.8.4)
wi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

Diff:
===============
--- dev/ic/i82365.c.orig	2006-05-28 12:52:53.000000000 -0500
+++ dev/ic/i82365.c	2006-05-28 12:53:11.000000000 -0500
@@ -1382,11 +1382,14 @@
 	intr &= PCIC_INTR_ENABLE;
 	pcic_write(h, PCIC_INTR, intr);

+	
 	/* zero out the address windows */
 	pcic_write(h, PCIC_ADDRWIN_ENABLE, 0);

+	/* XXXX NO! Don't assert output enable until card is ready */
 	/* power off; assert output enable bit */
-	power = PCIC_PWRCTL_OE;
+	/* power = PCIC_PWRCTL_OE; */
+        power = 0;
 	pcic_write(h, PCIC_PWRCTL, power);

 	/*
@@ -1444,6 +1448,10 @@
 	 */
 	pcic_delay(h, 20, "pccen2");

+        /* XXXX Card should be ready so now turn on output enable */
+	power |=  PCIC_PWRCTL_OE;
+        pcic_write(h, PCIC_PWRCTL, power);
+
 #ifdef DIAGNOSTIC
 	reg = pcic_read(h, PCIC_IF_STATUS);
 	if ((reg & PCIC_IF_STATUS_POWERACTIVE) == 0)

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: djb_netbsd@charter.net
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/33581: Z Com XI-325H / SMC2532W-B PC Card wedges system and overheats card
Date: Mon, 29 May 2006 09:48:34 +0200

 On Mon, May 29, 2006 at 01:25:00AM +0000, djb_netbsd@charter.net wrote:
 > +	/* XXXX NO! Don't assert output enable until card is ready */
 >  	/* power off; assert output enable bit */
 > -	power = PCIC_PWRCTL_OE;
 > +	/* power = PCIC_PWRCTL_OE; */
 > +        power = 0;
 >  	pcic_write(h, PCIC_PWRCTL, power);

 Ouch, the old code certainly is wrong.
 Other pcmcia bridge drivers do the OE after the ~200 ms Vcc rising time,
 i.e. between the

    pcic_delay(h, 200 + 1, "pccen1"); 

 and the negate RESET - could you test if that works for your case too?
 Otherwise we probably would have to audit all pcmcia bridge drivers and
 adapt them.

 Martin

From: <djb_netbsd@charter.net>
To: gnats-admin@netbsd.org, gnats-bugs@netbsd.org,
	netbsd-bugs@netbsd.org, kern-bug-people@netbsd.org
Cc: Martin Husemann <martin@duskware.de>
Subject: Re: kern/33581: Z Com XI-325H / SMC2532W-B PC Card wedges system
 and overheats card
Date: Mon, 29 May 2006 12:40:40 -0700

 >  Ouch, the old code certainly is wrong.
 >  Other pcmcia bridge drivers do the OE after the ~200 ms Vcc rising time,
 >  i.e. between the
 >  
 >     pcic_delay(h, 200 + 1, "pccen1"); 
 >  
 >  and the negate RESET - could you test if that works for your case too?

 YES It works OK.  Here's what I did....

 	 * some machines require some more time to be settled
 	 * (100ms is added here).
 	 */
 	pcic_delay(h, 200 + 1, "pccen1");

         /* XXXX Card should be ready so now turn on output enable */
         power |=  PCIC_PWRCTL_OE;
         pcic_write(h, PCIC_PWRCTL, power);

 	/* negate RESET */
 	intr |= PCIC_INTR_RESET;
 	pcic_write(h, PCIC_INTR, intr);

 	/*
 	 * RESET Setup Time (Tsu (RESET)) = 20ms
 	 */
 	pcic_delay(h, 20, "pccen2");

         /* XXXX Card should be ready so now turn on output enable */
 /*	power |=  PCIC_PWRCTL_OE;
         pcic_write(h, PCIC_PWRCTL, power);
 */

 -----

 >  Otherwise we probably would have to audit all pcmcia bridge drivers and
 >  adapt them.

 Looks like moving the PCIC_PWRCTL_OE might break the Ricoh and/or Vadem power
 hacks.  Looks like that is why the OE was moved up.

 It would certainly be safer to wait until after the reset setup time to enable
 the card output.  The XI-325 powers up "ugly" but seems to reset OK.  If there is a
 card that resets "ugly" then there could be problems again. 

 Changing the PCMCIA interface code can be a can or worms.  OTOH moving the
 OE in all of the PCMCIA bridge drivers might fix some obscure problems elsewhere.  

 djb

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.