[wdmaudiodev] Re: PortCls does not revoke mappings before hibernation

  • From: "Jeff Pages" <barefeet@xxxxxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Fri, 22 Oct 2010 11:33:18 +1100

Hi Eugene,


I just found this comment inside the IMiniportWavePciStream::SetState
function of one of my drivers:


// Normally KSSTATE_STOP won't be entered until all mappings have been

// released or revoked, except when going to sleep. To handle this case,

// we firstly terminate any DMA activity on the stream and then release

// any mappings from the released queue. Any mappings in the waiting

// queue are kept for use when reawakened.


The driver was originally based on the AC97 WavePci example of some ancient
vintage, but I'm not sure whether the comment came from that or is something
I wrote. Anyway, it confirms that mappings aren't revoked before entering
KSSTATE_STOP when going into hibernation.





-----Original Message-----

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Eugene Muzychenko

Sent: Wednesday, 20 October 2010 8:59 PM

To: 'wdmaudiodev@xxxxxxxxxxxxx'

Subject: [wdmaudiodev] PortCls does not revoke mappings before hibernation




MSDN documentation

(http://msdn.microsoft.com/en-us/library/ff536730(VS.85).aspx) states that
PortCls should revoke mappings at KSSTATE_STOP. But for my WavePci
miniports, neither in XP SP3, Vista SP2 nor Win7, PortCls does not revoke
mappings when stream state is changed to KSSTATE_STOP (RevokeMappings is not
called at all when the system is being prepared to hibernation). Thus, a
stream is placed to the STOP state but still has mappings acquired.


AC'97 example (up to Win7 WDK) contains the following comment in
KSSTATE_STOP processing:


// Just pause DMA. If we have mappings left in our queue,

// portcls will call RevokeMappings to destroy them.


Is such behavior a bug of PortCls or is it another "hint" that MS have not
mentioned in their documentation? Should a miniport driver release all
acquired mappings itself on a transition to KSSTATE_STOP? I think a stream
should keep no mappings in the stopped state.







WDMAUDIODEV addresses:

Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx

Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe

Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe

Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx





Other related posts: