I got the issue on Windows 7 with my driver when system shutdown. It’s racing condition and just happen one time around 200 cycles of warm boot.
I know one or more IRPs was in pending state when system shutdown and they were prevent system down and make BSOD but I don’t know exactly where is it.
I used some I/O as: WdfIoTargetSendIoctlSynchronously, KeWaitForSingleObject and already set timeout for them.
I also had a class driver above mshidkmdf, it’s top level of stack . Might the driver raise the issue? The issue is random so it’s difficult to trace. Any suggestion?
Thanks.
DEBUG:
0: kd> !analyze -v
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************
DRIVER_POWER_STATE_FAILURE (9f)
A driver has failed to complete a power IRP within a specific time.
Arguments:
Arg1: 0000000000000003, A device object has been blocking an Irp for too long a time
Arg2: fffffa8009760520, Physical Device Object of the stack
Arg3: fffff80000b9a3d8, nt!TRIAGE_9F_POWER on Win7 and higher, otherwise the Functional Device Object of the stack
Arg4: fffffa800bde75d0, The blocked IRP
STACK_TEXT:
fffff80000b9a388 fffff800
02f45b92 : 000000000000009f 00000000
00000003 fffffa8009760520 fffff800
00b9a3d8 : nt!KeBugCheckEx
fffff80000b9a390 fffff800
02ee0cfc : fffff80000b9a4c0 fffff800
00b9a4c0 0000000000000000 00000000
00000001 : nt! ?? ::FNODOBFM::string'+0x33af0 fffff800
00b9a430 fffff80002ee0b96 : fffff800
03087140 000000000000b0fc 00000000
00000000 0000000000000000 : nt!KiProcessTimerDpcTable+0x6c fffff800
00b9a4a0 fffff80002ee0a7e : 00000001
a54b9192 fffff80000b9ab18 00000000
0000b0fc fffff80003056208 : nt!KiProcessExpiredTimerList+0xc6 fffff800
00b9aaf0 fffff80002ee0867 : 00000000
397ee2c1 000000000000b0fc 00000000
397ee2e6 00000000000000fc : nt!KiTimerExpiration+0x1be fffff800
00b9ab90 fffff80002eccbca : fffff800
03051e80 fffff8000305fcc0 00000000
00000002 fffff88000000000 : nt!KiRetireDpcList+0x277 fffff800
00b9ac40 0000000000000000 : fffff800
00b9b000 fffff80000b95000 fffff800
00b9ac00 00000000`00000000 : nt!KiIdleLoop+0x5a
0: kd> !devstack fffffa8009760520
!DevObj !DrvObj !DevExt ObjectName
fffffa8009777060 \Driver\mshidkmdf fffffa80097771b0 _HID00000000
fffffa8009776650 \Driver\delli2chid fffffa80097752b0
fffffa8009760520 \Driver\ACPI fffffa80068a7010 0000007f
!DevNode fffffa8009779900 :
DeviceInst is “ACPI\SMO91D0\1”
ServiceName is “mshidkmdf”
0: kd> !thread fffffa80066ca660
THREAD fffffa80066ca660 Cid 0004.0014 Teb: 0000000000000000 Win32Thread: 0000000000000000 WAIT: (Executive) KernelMode Non-Alertable
fffffa8009830f58 NotificationEvent
Not impersonating
DeviceMap fffff8a000008c10
Owning Process fffffa80066ba5f0 Image: System
Attached Process N/A Image: N/A
Wait Start TickCount 6720 Ticks: 38588 (0:00:10:01.976)
Context Switch Count 50 IdealProcessor: 0
UserTime 00:00:00.000
KernelTime 00:00:00.015
Win32 Start Address nt!PopIrpWorker (0xfffff80002ff1da0)
Stack Init fffff88003114c70 Current fffff88003114720
Base fffff88003115000 Limit fffff8800310f000 Call 0
Priority 13 BasePriority 13 UnusualBoost 0 ForegroundBoost 0 IoPriority 2 PagePriority 5
Child-SP RetAddr : Args to Child : Call Site
fffff88003114760 fffff800
02eda0f2 : 0000000000000000 fffffa80
066ca660 0000000000000006 fffffa80
0000000d : nt!KiSwapContext+0x7a
fffff880031148a0 fffff800
02edc90f : fffffa80071cc640 fffff880
00f453f1 0f440f6800000000 fffff880
031149b0 : nt!KiCommitThreadWait+0x1d2
fffff88003114930 fffff880
078d6042 : fffffa8009830f00 00000000
00000000 0000000000000000 fffff880
03114a00 : nt!KeWaitForSingleObject+0x19f
fffff880031149d0 fffff880
078d9ec9 : fffffa800bde78e0 00000000
80000000 fffffa80097771d0 fffffa80
0bde75d0 : HIDCLASS!CancelAllPingPongIrps+0x122
fffff88003114a10 fffff880
078da207 : fffffa80097771b0 fffffa80
0bde78e0 fffff880078dd400 fffffa80
097771b0 : HIDCLASS!HidpFdoPower+0x105
fffff88003114a70 fffff880
078d385b : fffff880078de3b8 fffff880
078dd4f0 fffffa80097771b0 00000000
00000000 : HIDCLASS!HidpIrpMajorPower+0x153
fffff88003114ae0 fffff800
02ff2165 : 0000000000000000 00000000
00000001 0000000000000000 fffffa80
0bde7678 : HIDCLASS!HidpMajorHandler+0x14b
fffff88003114b50 fffff800
03173b8a : 0000000000000000 fffffa80
066ca660 0000000000000080 00000000
00000000 : nt!PopIrpWorker+0x3c5
fffff88003114c00 fffff800
02ec68e6 : fffff88003116180 fffffa80
066ca660 fffff88003120fc0 00000000
00000000 : nt!PspSystemThreadStartup+0x5a
fffff88003114c40 00000000
00000000 : fffff88003115000 00000000
00000000 0000000000000000 00000000
00000000 : nt!KxStartSystemThread+0x16