Re: Suspend problem on FreeBSD 5.3-STABLE

Christopher Sean Hilton <[email protected]>
Newsgroups gmane.os.freebsd.devel.acpi,gmane.os.freebsd.devel.mobile,gmane.os.freebsd.stable
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.