PCI PME and WaitWakeIRP

hi all,

I am new to WDF power management and have some basic questions:

I enabled S0 Idle and allowed the device to enter D3 (DeviceWakeDepthD3hot), but I see that I have a wait wake IRP request with the ACPI and NOT with the PCI driver. But based on https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/understanding-the-path-of-wait-wake-irps-through-a-device-tree the PCI bus driver is supposed to own the pending IRP.

Hence, when I generate a PME# message to wake the driver, I don’t see it resume the driver. I can also see the PCI PME STATUS is pending in the device’s config space, which seem to imply that the device generated PME correctly but the PCI bus driver didn’t process the signal. Is there something the peripheral driver has to do to enable PCI bus driver to process the wake IRP?

Here are the wdfdevice and wait-wake-irp outputs:

0: kd> !wdfdevice 0x00004f796d133978 ff
Treating handle as a KMDF handle!

Dumping WDFDEVICE 0x00004f796d133978

WDM PDEVICE_OBJECTs: self ffffb08693b9fe20, attached ffffb08680ad7270, pdo ffffb08692952830

Pnp state: 119 ( WdfDevStatePnpStarted )
Power state: 31f ( WdfDevStatePowerDx )
Power Pol state: 53e ( WdfDevStatePwrPolWaitingArmed )

Default WDFIOTARGET: 00004f796c4603a8

Device is the power policy owner for the stack
No pended pnp, power, wait-wake irps
Requested wait-wake !irp 0xffffb0869c786010 (S0)

Pnp state history:
[0] WdfDevStatePnpObjectCreated (0x100)
[1] WdfDevStatePnpInit (0x105)
[2] WdfDevStatePnpInitStarting (0x106)
[3] WdfDevStatePnpHardwareAvailable (0x108)
[4] WdfDevStatePnpEnableInterfaces (0x109)
[5] WdfDevStatePnpStarted (0x119)

Power state history:
[0] WdfDevStatePowerD0StartingDmaEnable (0x311)
[1] WdfDevStatePowerD0StartingStartSelfManagedIo (0x312)
[2] WdfDevStatePowerDecideD0State (0x313)
[3] WdfDevStatePowerD0 (0x307)
[4] WdfDevStatePowerGotoDx (0x31a)
[5] WdfDevStatePowerNotifyingD0ExitToWakeInterrupts (0x359)
[6] WdfDevStatePowerGotoDxIoStopped (0x31c)
[7] WdfDevStatePowerDx (0x31f)

Power policy state history:
[0] WdfDevStatePwrPolWakeCapableDeviceIdle (0x589)
[1] WdfDevStatePwrPolTimerExpiredDecideUsbSS (0x532)
[2] WdfDevStatePwrPolTimerExpiredWakeCapablePowerDown (0x533)
[3] WdfDevStatePwrPolTimerExpiredWakeCapableSendWake (0x534)
[4] WdfDevStatePwrPolTimerExpiredWakeCapableWakeArrived (0x536)
[5] WdfDevStatePwrPolWaitingArmedUsbSS (0x53d)
[6] WdfDevStatePwrPolWaitingArmedQueryIdle (0x53f)
[7] WdfDevStatePwrPolWaitingArmed (0x53e)

Idle state history:
[0] FxIdleTimerRunning (0xa)
[1] FxIdleTimingOut (0xb)
[2] FxIdleTimedOut (0xc)
[3] FxIdleTimedOutPowerDown (0xe)
[4] FxIdleGoingToDx (0x10)
[5] FxIdleInDx (0x11)
[6] FxIdleInDxDisabled (0x15)
[7] FxIdleInDx (0x11)

Power references: 0

S0Idle policy settings:
Idle configured and enabled, User control enabled, S0Wake capable
IdleDxState: PowerDeviceD3
Using driver-managed idle timeout
IdleTimeout: 10000 ms

SxWake policy settings:
SxWake configured and enabled, User control enabled
DxState for Sx: PowerDeviceD3

Power Capabilities:
DeviceWake[PowerSystemWorking]: DeviceWakeDepthD3hot
DeviceWake[PowerSystemSleeping1]: DeviceWakeDepthD3hot
DeviceWake[PowerSystemSleeping2]: DeviceWakeDepthD3hot
DeviceWake[PowerSystemSleeping3]: DeviceWakeDepthD3hot
DeviceWake[PowerSystemHibernate]: DeviceWakeDepthNotWakeable
SystemWake: PowerSystemUnspecified
S-D mapping:
S0->PowerDeviceD0
S1->PowerDeviceUnspecified
S2->PowerDeviceUnspecified
S3->PowerDeviceUnspecified
S4->PowerDeviceD3
S5->PowerDeviceD3
IdealDxStateForSx: PowerDeviceUnspecified

EvtDeviceD0Entry: EthDrv (fffff809bc80dd80)
EvtDeviceD0EntryPostInterruptsEnabled: EthDrv (fffff809bc80de10)
EvtDeviceD0ExitPreInterruptsDisabled: EthDrv (fffff809bc80de80)
EvtDeviceD0Exit: EthDrv (fffff809bc940720)
EvtDevicePrepareHardware: EthDrv (fffff809bc940800)
EvtDeviceReleaseHardware: EthDrv (fffff809bc941020)
EvtDeviceQueryStop: EthDrv (fffff809bc80dff0)
EvtDeviceSurpriseRemoval: EthDrv (fffff809bc80e2d0)
EvtDeviceSelfManagedIoCleanup: EthDrv (fffff809bc80e060)
EvtDeviceSelfManagedIoFlush: EthDrv (fffff809bc80e0c0)
EvtDeviceSelfManagedIoInit: EthDrv (fffff809bc80e120)
EvtDeviceSelfManagedIoSuspend: EthDrv (fffff809bc80e230)
EvtDeviceSelfManagedIoRestart: EthDrv (fffff809bc80e1c0)
EvtDeviceArmWakeFromS0: EthDrv (fffff809bc80dcc0)
EvtDeviceDisarmWakeFromS0: EthDrv (fffff809bc80df30)
EvtDeviceWakeFromS0Triggered: EthDrv (fffff809bc80e320)
EvtDeviceArmWakeFromSx: EthDrv (fffff809bc80dd10)
EvtDeviceDisarmWakeFromSx: EthDrv (fffff809bc80df90)
EvtDeviceWakeFromSxTriggered: EthDrv (fffff809bc80e380)

No file-object callbacks assigned

No in-caller context callbacks assigned

No preprocess callbacks assigned

No dispatch callbacks assigned

WDFCHILDLIST Handles:
!wdfchildlist 0x00004f796c94b488 (static PDO list)

Properties:
SynchronizationScope: WdfSynchronizationScopeDevice
ExecutionLevel: WdfExecutionLevelDispatch
IoType (Read/Write): WdfDeviceIoDirect
FileObjectClass: WdfFileObjectNotRequired
Exclusive: No
AutoForwardCleanupClose: No
DefaultIoPriorityBoost: 0
SymbolicLink: ??\EthDrv

0: kd> !irp 0xffffb0869c786010
Irp is active with 5 stacks 2 is current (= 0xffffb0869c786128)
No Mdl: No System Buffer: Thread 00000000: Irp stack trace.
cmd flg cl Device File Completion-Context
[N/A(0), N/A(0)]
0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[IRP_MJ_POWER(16), IRP_MN_WAIT_WAKE(0)]
0 e1 ffffb08680ad7270 00000000 00000000-00000000 pending
\Driver\ACPI
Args: 00000001 00000000 00000000 00000000
[IRP_MJ_POWER(16), IRP_MN_WAIT_WAKE(0)]
0 0 ffffb08693b9fe20 00000000 00000000-00000000
\Driver\EthDrv
Args: 00000001 00000000 00000000 00000000
[IRP_MJ_POWER(16), IRP_MN_WAIT_WAKE(0)]
0 e0 ffffb08692ec86b0 00000000 fffff801c07a6aa0-ffffb08693e49680 Success Error Cancel
\Driver\EthBus nt!PopRequestCompletion
Args: 00000001 00000000 00000000 00000000
[N/A(0), N/A(0)]
0 0 00000000 00000000 00000000-ffffb08693e49680

Args: 00000000 00000000 00000000 00000000

thanks

What is \Driver\EthBus ? Was it a typo, or there’s another bus driver lurking beneath?

–pa

It’s just a packet filter driver that sits on top of the Ethernet driver. The name definitely needs a serious rethought :slight_smile: