Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PCMCIA eject while sleeping issues



matthew,

the message "IOPCCard: socket 0 did not terminate cleanly, state = 0x4." is a perfectly healthy thing to see in the this situation and your analysis of why it is occurring is also correct.

There may be issues with inserting a card to quickly in this case. The linux code that this code is based off of issues beeps on inserting and removal of a card which appears to be a great way to keep users from thrashing their pc cards in and out of their laptops (I have a bug on that failing after a while too). I haven't looked at this section of code in while, if you think you know what the problem this is one of the few truly live open source projects in darwin and I am more than willing to accept good diffs and integrate them. And if it is a generic bug, it will most likely end up going in the linux sources as well. Just think of glory, the prestige of being able to claim you fixed a bug in two OSes at once!

-rick

On Tuesday, February 25, 2003, at 12:02 PM, Matthew T. Russotto wrote:

I've gotten a little further with this race condition.

Here's some interesting log entries:

Feb 21 13:45:00 mtr-powerbook mach_kernel: System Sleep
Feb 21 13:45:00 mtr-powerbook mach_kernel: System Wake
Feb 21 13:45:00 mtr-powerbook mach_kernel: Wake event 0001
Feb 21 13:45:00 mtr-powerbook mach_kernel: enableClockSpreading returned with 0
Feb 21 13:45:00 mtr-powerbook mach_kernel: AppleNMI unmask NMI
Feb 21 13:45:00 mtr-powerbook mach_kernel: net_russotto_AtmelWirelessDriver::me\
ssage, nub=0x1f9f500, card services event CS_EVENT_CARD_REMOVAL.
Feb 21 13:45:00 mtr-powerbook mach_kernel: IOPCCard: shutting down socket 0.
Feb 21 13:45:00 mtr-powerbook mach_kernel: IOPCCard: calling terminate on socke\
t 0 function 0 nub 0x1f9f500.
Feb 21 13:45:00 mtr-powerbook mach_kernel: net_russotto_AtmelWirelessDriver::st\
op(provider=0x1f9f500, this=0x5810000) stopping
Feb 21 13:45:00 mtr-powerbook mach_kernel: net_russotto_AtmelWirelessDriver: un\
mapping window index 0, size = 0x20
Feb 21 13:45:00 mtr-powerbook mach_kernel: IOPCCard notice: PCCardExpert0: Rele\
aseConfiguration: Bad handle
Feb 21 13:45:00 mtr-powerbook mach_kernel: IOPCCard16Device: releasing socket 0\
function 0 from card services.
Feb 21 13:45:00 mtr-powerbook mach_kernel: IOPCCard: socket 0 did not terminate\
cleanly, state = 0x4.

This occurs when I eject the card while the system is asleep. What appears to happen is the Card Services ReleaseConfiguration is called when the system sleeps. When the system wakes back up, it notices the card gone and calls PCCardBridge::unconfigureSocket. This calls ReleaseConfiguration again, but that returns an error because the socket isn't configured. The error prevents the socket state from being set to unconfigured, which causes a problem if the card is re-inserted quickly. (It doesn't happen if I wait a while, so I assume card services eventually cleans up the mess)

I still don't see how this leads to a setPowerState with 0 on the re-inserted card, but I suspect it's related.
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.

__
rick sulack
darwin core os group
apple computer, inc
--------------------------------------------------------------
"More computing sins are committed in the name of efficiency (without necessarily achieving it)
than for any other single reason - including blind stupidity" -Wulf 1972
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.
References: 
 >PCMCIA eject while sleeping issues (From: "Matthew T. Russotto" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.