From owner-freebsd-mobile@FreeBSD.ORG Wed Jan 12 19:39:30 2005 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E6DA16A4CE; Wed, 12 Jan 2005 19:39:30 +0000 (GMT) Received: from fearlessleader.lhr-its.com (fearlessleader.lhr-its.com [64.204.249.98]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0458643D39; Wed, 12 Jan 2005 19:39:30 +0000 (GMT) (envelope-from chris@vindaloo.com) Received: from yavin.vindaloo.com (unknown [172.24.144.34]) by fearlessleader.lhr-its.com (Postfix) with ESMTP id 06A773B3; Wed, 12 Jan 2005 14:39:20 -0500 (EST) Received: by yavin.vindaloo.com (Postfix, from userid 1001) id 3C5E9253A6; Wed, 12 Jan 2005 14:39:18 -0500 (EST) Date: Wed, 12 Jan 2005 14:39:18 -0500 From: Christopher Sean Hilton To: "M. Warner Losh" Message-ID: <20050112193918.GA17164@yavin.vindaloo.com> References: <41E19C0E.6030400@root.org> <41E48E70.30807@vindaloo.com> <41E4BC93.40608@root.org> <20050112.072948.89901373.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112.072948.89901373.imp@bsdimp.com> User-Agent: Mutt/1.4.2i cc: freebsd-acpi@freebsd.org cc: freebsd-mobile@freebsd.org cc: freebsd-stable@freebsd.org cc: nate@root.org Subject: Re: Suspend problem on FreeBSD 5.3-STABLE X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2005 19:39:30 -0000 On Wed, Jan 12, 2005 at 07:29:48AM -0700, M. Warner Losh wrote: > : > FA411 16 bit PCMCIA card after a suspend/resume works as expected. I > : > will try to down the interface and kldunload the dc driver before > : > shutdown to see if that helps. > : > : That fits with my analysis as well. It seems that cardbus handles > : things fine but individual drivers may be lacking in suspend/resume support. > > Cardbus should be detaching and reattaching the device. So that's > clearly a bug in cardbus. Individual drivers have no choice in this > matter, since we can't know if the cards that are there after the > resume were the ones we suspended with. This doesn't matter too much > for NIC cards (but none of the drivers cope with MAC addresses > changing), but matters a great deal for things like flash cards. > > : That's a good testing approach, btw. If you find the dc(4) driver seems > : to be the culprit, the next step is to go through any datasheets and > : other OS drivers to see if you can find what we're doing differently. > > I don't think that it is a dc problem. > After my tests I'm not sure where it is. Here's what I did: o Compiled a kernel without dc support so I could # kldload if_dc o Loaded if_dc.ko as a module o Inserted the card At this time the card was properly probed. o Ran dhclient dc0 and observed the card get an ip address from my dhcp server. o Did some more network tests (hit http://www.ebay.com in firefox...) o Turned off the card nicely prior to detaching it: # ifconfig dc0 down delete o Unplugged the card and observed it detach from the cbb0 "slot". o Unloaded the if_dc driver: # kldunload if_dc o Suspend the laptop to standby mode: # sysctl hw.acpi.lid_switch_state="S3" Close the laptop's lid o Resume: Open the laptop's lid o Reload the driver (kldload if_dc...) o Pluggin the card At this time the cardbus driver reports: "cbb0: CardBus card activation failed" This leads me to believe that either the CardBus handler has a problem attaching an existing "used" dc driver to the card after a suspend/resume or the dc driver has left something in a state after it's detach where a re-attach will not work correctly. Has anyone got any other ideas? -- Chris -- -- Chris Hilton chilton-at-vindaloo-dot-com ------------------------------------------------------------------------ "All I was doing was trying to get home from work!" -- Rosa Parks