From: dodolemon on
Hi,
recently I wrote a hidmini driver for joystick device and ran sleep stress
with io test. Sometimes it will fail in "The device's Problem Codes (if
any) and... " item. And the error message is "Device is missing!"

But if I doesn't install my mini driver and use microsoft's default
minidriver(usbhid.sys). It can pass all the time.

;;===log message===
Start: The device's Problem Codes (if any) and its Status should not
change throughout this test. ...

Try 0 of 3 failed. Waiting 10 seconds.
CDisplayGatherer::XmlData: Calling Get XML Data
CDisplayGatherer::XmlData: DisplayGetData(ex) succeeded
Try 1 of 3 failed. Waiting 30 seconds.
Try 2 of 3 failed. Waiting 60 seconds.
...
Previous Problem Code: 0
Error: 0xffffffff, Error 0xffffffff
Device is missing!
File=. Line=0
Try 0 of 3 failed. Waiting 10 seconds.
Try 1 of 3 failed. Waiting 30 seconds.
watchdog!WdUpdateRecoveryState: Recovery enabled.
Try 2 of 3 failed. Waiting 60 seconds.

...
Previous Problem Code: 0
Error: 0xffffffff, Error 0xffffffff
Device is missing!
File=. Line=0
End: Fail, The device's Problem Codes (if any) and its Status should not
change throughout this test...

Repro=C:\WTT\JobsWorkingDir\Tasks\WTTJobRun66A425E8-935D-4186-9FCC-35977B664CF6\cscript.exe
(null)
;;====

What "The device's Problem Codes..." will do? And why it will fail
sometimes?

Can someone give me a hand?

Thank you.

dodo



--
Message posted using http://www.talkaboutsoftware.com/group/microsoft.public.development.device.drivers/
More information at http://www.talkaboutsoftware.com/faq.html

From: Abei on
Sleep stress with IO test related with driver's power manager. So please
check this part of your driver code.

--
Abei


"dodolemon" wrote:

> Hi,
> recently I wrote a hidmini driver for joystick device and ran sleep stress
> with io test. Sometimes it will fail in "The device's Problem Codes (if
> any) and... " item. And the error message is "Device is missing!"
>
> But if I doesn't install my mini driver and use microsoft's default
> minidriver(usbhid.sys). It can pass all the time.
>
> ;;===log message===
> Start: The device's Problem Codes (if any) and its Status should not
> change throughout this test. ...
>
> Try 0 of 3 failed. Waiting 10 seconds.
> CDisplayGatherer::XmlData: Calling Get XML Data
> CDisplayGatherer::XmlData: DisplayGetData(ex) succeeded
> Try 1 of 3 failed. Waiting 30 seconds.
> Try 2 of 3 failed. Waiting 60 seconds.
> ...
> Previous Problem Code: 0
> Error: 0xffffffff, Error 0xffffffff
> Device is missing!
> File=. Line=0
> Try 0 of 3 failed. Waiting 10 seconds.
> Try 1 of 3 failed. Waiting 30 seconds.
> watchdog!WdUpdateRecoveryState: Recovery enabled.
> Try 2 of 3 failed. Waiting 60 seconds.
>
> ...
> Previous Problem Code: 0
> Error: 0xffffffff, Error 0xffffffff
> Device is missing!
> File=. Line=0
> End: Fail, The device's Problem Codes (if any) and its Status should not
> change throughout this test...
>
> Repro=C:\WTT\JobsWorkingDir\Tasks\WTTJobRun66A425E8-935D-4186-9FCC-35977B664CF6\cscript.exe
> (null)
> ;;====
>
> What "The device's Problem Codes..." will do? And why it will fail
> sometimes?
>
> Can someone give me a hand?
>
> Thank you.
>
> dodo
>
>
>
> --
> Message posted using http://www.talkaboutsoftware.com/group/microsoft.public.development.device.drivers/
> More information at http://www.talkaboutsoftware.com/faq.html
>
>
From: dodolemon on
Thanks Abei,
but during the test of "The device's Problem Codes (if any) and its Status
should not
change throughout this test. ...", I doesn't see it will send me a irp of
"IRP_MJ_POWER". I put debug code there, and it did not show anything.

And I just pass throught the power irp. use the
...
IoSkipCurrentIrpStackLocation(..)
PoStartNextPowerIrp(..)
PoCallDriver(..)
...

dodo.


--
Message posted using http://www.talkaboutsoftware.com/group/microsoft.public.development.device.drivers/
More information at http://www.talkaboutsoftware.com/faq.html

From: Maxim S. Shatskih on
> IoSkipCurrentIrpStackLocation(..)
> PoStartNextPowerIrp(..)
> PoCallDriver(..)

The correct order is to call PoStartNextPowerIrp before IoSkipCurrentIrpStackLocation.

This is important.

Look at documentation on PoStartNextPowerIrp.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com

From: dodolemon on
Thanks Maxim,
I check the DDK document and it said,
"A driver must call this routine once for each IRP_MN_QUERY_POWER or
IRP_MN_SET_POWER request" but it do not need to call PoStartNextPowerIrp
when handling IRP_MN_WAIT_WAKE or IRP_MN_POWER_SEQUENCE requests."

So do I need to seperate different minor function? like,

;;======================================
ntStatus = IoAcquireRemoveLock(&pdx->RemoveLock, Irp);
if (!NT_SUCCESS (ntStatus))
{
PoStartNextPowerIrp(Irp);
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = ntStatus;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
}
else
{
if ((fcn == IRP_MN_WAIT_WAKE)
|| (fcn == IRP_MN_POWER_SEQUENCE)
)
{
}
else
{
PoStartNextPowerIrp(Irp);
}

IoSkipCurrentIrpStackLocation (Irp);
ntStatus=PoCallDriver(pdo,Irp);

IoReleaseRemoveLock(&pdx->RemoveLock, Irp);

return ntStatus;
}
;;======================================

2nd...
I check the debug code and find why it will show "Device is missing"
during sleep stress with IO test.
Because when power up, fdo will send us HID Read Report Request and I
resend it to PDO. Then sometimes I receive 0xC000009DL from PDO. It will
repeat many times and then I receive IRP_MN_REMOVE_DEVICE to unload
driver. Finally in The device's Problem Codes... it will show "Device is
missing."

Do you know why PDO will send us 0xC000009D, STATUS_DEVICE_NOT_CONNECTED?
Is it a hardware issue? If it is, can you give me some suggests to debug
hardware?

Thank you.

dodo


--
Message posted using http://www.talkaboutsoftware.com/group/microsoft.public.development.device.drivers/
More information at http://www.talkaboutsoftware.com/faq.html