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 Race condition after sleep



Hello Matthew, please try this code to see if it helps.

Wayne

// initialize superclass variables from IOService.h
PMinit();
// register as controlling driver from IOService.h
myValue = registerPowerDriver( this, (IOPMPowerState *)
ourPowerStates,
kNumDTSStates );
if (myValue != kIOReturnSuccess) {
IOLog("%s: Failed to registerPowerDriver.\n", getName());
}
// join the tree from IOService.h
provider->joinPMtree( this);
return res;
}

IOReturn com_DTS_iokit_GenericPCI::setPowerState(unsigned long
whatState, IOService* dontCare){
IOLog("GenericPCI setting power state:%u\n", whatState);
//return kIOReturnSuccess;
return IOPMAckImplied;
}
Step 3 is interesting

On Monday, February 24, 2003, at 06:41 AM, Matthew T. Russotto wrote:

> I have a PCMCIA driver for a network adapter, and I've noticed a race
> condition as follows:
>
> 1) Put machine to sleep
> 2) Wake machine up.
> 3) Insert card while machine is in the midst of waking up
> 4) The driver's "start" routine is called, and at some point the
> driver's "registerWithPolicyMaker" routine is called
> 5) registerWithPolicyMaker calls
> policyMaker->registerPowerDriver(this, myPowerStates,
> myPowerStateCount)
> 6) Before that call returns, the driver's setPowerState is called with
> a power state of 0 (device off)
> 7) setPowerState is not called again.
>
> At this point, the device is an unusable state. Worse, because the
> driver thinks the device is unsafe to access, it's not servicing
> interrupts and the system grinds to a halt constantly responding to
> interrupts which don't get serviced.
>
> Worse, I have a report that in 10.2.4 (my development system is
> 10.2.3) this occurs every time the system is woken with the card in --
> instead of getting setPowerState calls, the system unloads and reloads
> the driver.
>
> Have I find a legitimate bug here, or am I doing something wrong? Any
> workarounds/fixes suggested?
> _______________________________________________
> 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.
>
************************************
Wayne Flansburg, Worldwide Technical Support
Visit our PCI web page at:
http://developer.apple.com/hardware/pci/
************************************
_______________________________________________
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 Race condition after sleep (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.