optimal size of TransferLength in WDF_USB_CONTINUOUS_READER_CONFIG_INIT

Hello,

I have an easy question. What is the expected “optimal” size for
the transfer length within the continous reader setup?
Is it the MaximumTransferSize within the WDF_USB_PIPE_INFORMATION?
Or is it the USB2.0 microframe size (512 bytes)? Or?

I have a USB2.0 scanner and if I set 512 bytes, I get “buffer overflow” on the device
side (FX2 FIFO overrun) if I increase it to let’s say 4k the buffer overflow seems to
be gone.

But I want to be on the safe side and I want to have the biggest throughput
possible from the device to the PC.
So please advice if possible,

Thanks in advance,
t.

There is no generic optimzal size. Certainly you do not want to use a microframe size as the reader buffer size. I would use a multiple of max transfer length, but you know your device best and you know its traffic flow, so if you thinkg 4k is a good value, use that.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@chello.hu
Sent: Wednesday, October 08, 2008 12:23 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] optimal size of TransferLength in WDF_USB_CONTINUOUS_READER_CONFIG_INIT

Hello,

I have an easy question. What is the expected “optimal” size for
the transfer length within the continous reader setup?
Is it the MaximumTransferSize within the WDF_USB_PIPE_INFORMATION?
Or is it the USB2.0 microframe size (512 bytes)? Or?

I have a USB2.0 scanner and if I set 512 bytes, I get “buffer overflow” on the device
side (FX2 FIFO overrun) if I increase it to let’s say 4k the buffer overflow seems to
be gone.

But I want to be on the safe side and I want to have the biggest throughput
possible from the device to the PC.
So please advice if possible,

Thanks in advance,
t.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

xxxxx@chello.hu wrote:

I have an easy question. What is the expected “optimal” size for
the transfer length within the continous reader setup?
Is it the MaximumTransferSize within the WDF_USB_PIPE_INFORMATION?
Or is it the USB2.0 microframe size (512 bytes)? Or?

That’s not the microframe size. That’s the max packet size for a bulk
endpoint.

I have a USB2.0 scanner and if I set 512 bytes, I get “buffer overflow” on the device
side (FX2 FIFO overrun) if I increase it to let’s say 4k the buffer overflow seems to
be gone.

But I want to be on the safe side and I want to have the biggest throughput
possible from the device to the PC.

For maximum throughput, you want the buffer size to be pretty large.
Remember that a bulk pipe can transfer 5k or 6k bytes in a single
microframe, which is 125us. Every time an URB completes, there’s system
overhead to complete the IRP, process it, and resend it. If
sub-millisecond latency is not an issue for you (and I can’t imagine
that it would be with a scanner), use something like 131,072 bytes.
That will carry through about 3ms.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks a lot, will do that!

Guys,

I increased the transfer length to 128k in the creation of the c.r.
Now I have a “strange” problem. Upon the “OnInterrupt” handler of the c.r.
I copy the buffer that was received into my own Collection (thus I create a new WDFMEMORY
with WdfMemoryCreate, and WdfMemoryCopyToBuffer from the received buffer to my own
memory the received bytes and then I add this memory to the collection).
After I’ve increased the length I started to received STATUS_BUFFER_TOO_SMALL from
the WdfMemoryCopyToBuffer. This is the line that fails:

status = WdfMemoryCopyToBuffer (Buffer, 0, pDstBuff, NumBytesTransferred);

The “Buffer” is the arg. of the EvtUsbInterruptPipeReadComplete, the pDstBuff is the pointer
of “my own” memory buffer that was created with WdfMemoryCreate, NumBytesTransferred
is yet again the argument of the EvtUsbInterruptPipeReadComplete.
This is the line to create pDstBuff:

status = WdfMemoryCreate(
&attributes,
NonPagedPool,
POOL_TAG,
NumBytesTransferred,
&memory,
&pDstBuff);

attributes is naturally initialized. I’m a bit lost as I did nothing apart from increasing the transfer
length to 128k.
Couldn’t that be that somewhere in the framework some “length variable” is defined a SHORT
thus unable to use 32-bit (128k) length?
Thanks,

What does !wdfkd.wdflogdump say? Also, you can add a ref (WdfObjectAddReference) to the
WDFMEMORY passed to your OnInterrupt callback and it will be yours to use and will stay alive until you deref it (WdfObjectDereference). You can use the header and footer lengths in the c.r. config struct to allocate extra room in the buffer so that you do not need to alloc more memory when you get a buffer from the device.

No, the WDFMEMORY’s internal length is not a 16 bit value, it is size_t

d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@chello.hu
Sent: Sunday, October 12, 2008 9:40 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] optimal size of TransferLength in WDF_USB_CONTINUOUS_READER_CONFIG_INIT

Guys,

I increased the transfer length to 128k in the creation of the c.r.
Now I have a “strange” problem. Upon the “OnInterrupt” handler of the c.r.
I copy the buffer that was received into my own Collection (thus I create a new WDFMEMORY
with WdfMemoryCreate, and WdfMemoryCopyToBuffer from the received buffer to my own
memory the received bytes and then I add this memory to the collection).
After I’ve increased the length I started to received STATUS_BUFFER_TOO_SMALL from
the WdfMemoryCopyToBuffer. This is the line that fails:

status = WdfMemoryCopyToBuffer (Buffer, 0, pDstBuff, NumBytesTransferred);

The “Buffer” is the arg. of the EvtUsbInterruptPipeReadComplete, the pDstBuff is the pointer
of “my own” memory buffer that was created with WdfMemoryCreate, NumBytesTransferred
is yet again the argument of the EvtUsbInterruptPipeReadComplete.
This is the line to create pDstBuff:

status = WdfMemoryCreate(
&attributes,
NonPagedPool,
POOL_TAG,
NumBytesTransferred,
&memory,
&pDstBuff);

attributes is naturally initialized. I’m a bit lost as I did nothing apart from increasing the transfer
length to 128k.
Couldn’t that be that somewhere in the framework some “length variable” is defined a SHORT
thus unable to use 32-bit (128k) length?
Thanks,


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Doron,
will check the logdump asap.
Funny thing is that if I replace the WdfMemoryCopyToBuffer with
WdfMemoryCopyFromBuffer (and obviously replace the args) the error is gone, but
I get BSODs from different places (depending on what do I set as TransferLength, i.e.
128k, 65535, 65536, etc.) from the usb stack. After checking those (crash) dumps it seems
like my driver overflows the memory (as if I change the transfer length I change the place
of the BSOD as well)), but that is quite strange, as I only use “safe” copies via Wdf.
Aok, thanks for the hints, will try them out!
t.

Ok, hooked up a serial debugger against the kernel.
Added a Trace message to the OnInterrupt handler to be able to distinguish
which of my 2 c.r. is triggering, the one with the small amount of data (real INT pipe)
or the other with the large amount of data (“virtual” INT pipe, simple bulk-in pipe).
The funny thing is that I don’t even get to OnInterrupt the framework dies before that.
Any idea?

Here are the logs:

Trace format prefix is: %7!u!: %!FUNC! -
TMF file used for formatting IFR log is: C:\WinDDK\6001.18001\tools\tracing\i386\wdf01007.tmf
Log at 82704000
Gather log: Please wait, this may take a moment (reading 4032 bytes).
% read so far … 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
There are 118 log entries
— start of log —
2396002: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396003: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396004: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396005: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396006: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396007: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396008: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396009: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396010: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396011: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396012: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396013: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396014: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396015: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396016: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396017: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396018: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396019: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396020: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396021: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396022: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396023: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396024: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396025: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396026: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396027: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396028: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396029: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396030: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396031: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396032: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396033: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396034: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396035: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396036: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396037: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396038: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396039: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396040: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396041: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396042: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396043: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396044: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396045: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396046: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396047: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396048: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396049: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396050: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396051: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396052: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396053: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396054: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396055: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396056: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396057: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396058: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396059: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396060: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396061: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396062: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396063: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396064: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396065: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396066: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396067: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396068: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396069: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396070: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396071: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396072: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396073: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396074: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396075: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396076: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396077: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396078: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396079: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396080: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396081: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396082: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396083: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396084: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396085: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396086: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396087: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396088: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396089: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396090: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396091: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396092: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396093: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396094: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396095: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396096: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396097: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396098: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396099: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396100: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396101: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396102: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396103: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396104: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396105: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396106: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396107: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396108: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396109: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396110: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396111: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396112: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396113: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396114: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396115: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396116: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396117: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 826C6920
2396118: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8B78, WDFREQUEST 826C6920
2396119: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 826C6920 completed in completion routine
---- end of log ----

READ_ADDRESS: 425a0094

CURRENT_IRQL: 2

FAULTING_IP:
wdf01000!FxRequestBase::CompleteSubmitted+15
baa55b48 389894000000 cmp byte ptr [eax+94h],bl

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0xD1

PROCESS_NAME: csrss.exe

TRAP_FRAME: f8adcd84 – (.trap 0xfffffffff8adcd84)
ErrCode = 00000000
eax=425a0000 ebx=00000000 ecx=826c6920 edx=00000000 esi=826c6920 edi=baa879f4
eip=baa55b48 esp=f8adcdf8 ebp=f8adce04 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246
wdf01000!FxRequestBase::CompleteSubmitted+0x15:
baa55b48 389894000000 cmp byte ptr [eax+94h],bl ds:0023:425a0094=??
Resetting default scope

LAST_CONTROL_TRANSFER: from 80532747 to 804e3592

STACK_TEXT:
f8adc938 80532747 00000003 f8adcc94 00000000 nt!RtlpBreakWithStatusInstruction
f8adc984 8053321e 00000003 425a0094 baa55b48 nt!KiBugCheckDebugBreak+0x19
f8adcd64 804e187f 0000000a 425a0094 00000002 nt!KeBugCheck2+0x574
f8adcd64 baa55b48 0000000a 425a0094 00000002 nt!KiTrap0E+0x233
f8adce04 baa2d7dd 826c7473 82707480 00000000 wdf01000!FxRequestBase::CompleteSubmitted+0x15
f8adce20 baa2d8bf 016c6920 8278ed98 f8adce4c wdf01000!FxIoTarget::RequestCompletionRoutine+0x195
f8adce30 8050bf61 00000000 826c73b8 826c6920 wdf01000!FxIoTarget::_RequestCompletionRoutine+0x35
f8adce4c 804e3d38 00000000 826c73b8 8278ed98 nt!IopUnloadSafeCompletion+0x1d
f8adce7c f83940d5 826c73b8 826c5008 82e49028 nt!IopfCompleteRequest+0xa2
f8adcee4 f8394d47 826c7b3c 00000000 82e497d8 USBPORT!USBPORT_CompleteTransfer+0x373
f8adcf14 f8395944 026e6f44 82e490e0 82e490e0 USBPORT!USBPORT_DoneTransfer+0x137
f8adcf4c f839713a 82e49028 804e2eb4 82e49230 USBPORT!USBPORT_FlushDoneTransferList+0x16c
f8adcf78 f83a524b 82e49028 804e2eb4 82e49028 USBPORT!USBPORT_DpcWorker+0x224
f8adcfb4 f83a53c2 82e49028 00000001 82db6380 USBPORT!USBPORT_IsrDpcWorker+0x38f
f8adcfd0 804dbbd4 82e4964c 6b755044 00000000 USBPORT!USBPORT_IsrDpc+0x166
f8adcff4 804db89e f87f0404 00000000 00000000 nt!KiRetireDpcList+0x46
f8adcff8 f87f0404 00000000 00000000 00000000 nt!KiDispatchInterrupt+0x2a
WARNING: Frame IP not in any known module. Following frames may be wrong.
804db89e 00000000 00000009 bb835675 00000128 0xf87f0404

STACK_COMMAND: kb

FOLLOWUP_IP:
wdf01000!FxRequestBase::CompleteSubmitted+15
baa55b48 389894000000 cmp byte ptr [eax+94h],bl

SYMBOL_STACK_INDEX: 4

SYMBOL_NAME: wdf01000!FxRequestBase::CompleteSubmitted+15

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: wdf01000

IMAGE_NAME: wdf01000.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 47919015

FAILURE_BUCKET_ID: 0xD1_wdf01000!FxRequestBase::CompleteSubmitted+15

BUCKET_ID: 0xD1_wdf01000!FxRequestBase::CompleteSubmitted+15

Followup: MachineOwner

Is the framework dying before the first OnInterrupt is called? It does not look that way based on the logs, it looks like a bunch of requests came back to you. You mentioned memory corruption earlier. The callstack you have below does not look like any current issues we have with KMDF, so either you found a bug in KMDF or your memory corruption is now affecting KMDF state/allocations and you are corrupting it. From your end, it is much more actionable to try to isolate corruption issues in your driver. Please turn on both the KMDF and driver verifiers and see what happens. I would also suggest you run prefast for drivers on your code, that may tell you something is amiss.

The “safe” wdf memory APIs are only as safe as the values you pass in. If you pass in a 1 byte buffer and say it is 10 bytes, KMDF has no way of knowing you passed in junk.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@chello.hu
Sent: Monday, October 13, 2008 4:39 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] optimal size of TransferLength in WDF_USB_CONTINUOUS_READER_CONFIG_INIT

Ok, hooked up a serial debugger against the kernel.
Added a Trace message to the OnInterrupt handler to be able to distinguish
which of my 2 c.r. is triggering, the one with the small amount of data (real INT pipe)
or the other with the large amount of data (“virtual” INT pipe, simple bulk-in pipe).
The funny thing is that I don’t even get to OnInterrupt the framework dies before that.
Any idea?

Here are the logs:

Trace format prefix is: %7!u!: %!FUNC! -
TMF file used for formatting IFR log is: C:\WinDDK\6001.18001\tools\tracing\i386\wdf01007.tmf
Log at 82704000
Gather log: Please wait, this may take a moment (reading 4032 bytes).
% read so far … 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
There are 118 log entries
— start of log —
2396002: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396003: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396004: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396005: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396006: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396007: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396008: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396009: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396010: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396011: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396012: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396013: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396014: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396015: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396016: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396017: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396018: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396019: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396020: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396021: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396022: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396023: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396024: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396025: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396026: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396027: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396028: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396029: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396030: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396031: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396032: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396033: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396034: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396035: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396036: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396037: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396038: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396039: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396040: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396041: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396042: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396043: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396044: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396045: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396046: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396047: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396048: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396049: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396050: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396051: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396052: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396053: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396054: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396055: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396056: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396057: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396058: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396059: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396060: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396061: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396062: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396063: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396064: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396065: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396066: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396067: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396068: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396069: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396070: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396071: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396072: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396073: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396074: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396075: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396076: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396077: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396078: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396079: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396080: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396081: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396082: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396083: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396084: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396085: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396086: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396087: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396088: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396089: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396090: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396091: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396092: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396093: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396094: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396095: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396096: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396097: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396098: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396099: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396100: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396101: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396102: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396103: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396104: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396105: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0
2396106: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D9380B0
2396107: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D9380B0 completed in completion routine
2396108: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08
2396109: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D2D8C08
2396110: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D2D8C08 completed in completion routine
2396111: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0
2396112: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F7E08, WDFREQUEST 7D8DCFB0
2396113: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D8DCFB0 completed in completion routine
2396114: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8
2396115: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8A38, WDFREQUEST 7D505CF8
2396116: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7D505CF8 completed in completion routine
2396117: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 826C6920
2396118: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7D8F8B78, WDFREQUEST 826C6920
2396119: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 826C6920 completed in completion routine
---- end of log ----

READ_ADDRESS: 425a0094

CURRENT_IRQL: 2

FAULTING_IP:
wdf01000!FxRequestBase::CompleteSubmitted+15
baa55b48 389894000000 cmp byte ptr [eax+94h],bl

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0xD1

PROCESS_NAME: csrss.exe

TRAP_FRAME: f8adcd84 – (.trap 0xfffffffff8adcd84)
ErrCode = 00000000
eax=425a0000 ebx=00000000 ecx=826c6920 edx=00000000 esi=826c6920 edi=baa879f4
eip=baa55b48 esp=f8adcdf8 ebp=f8adce04 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246
wdf01000!FxRequestBase::CompleteSubmitted+0x15:
baa55b48 389894000000 cmp byte ptr [eax+94h],bl ds:0023:425a0094=??
Resetting default scope

LAST_CONTROL_TRANSFER: from 80532747 to 804e3592

STACK_TEXT:
f8adc938 80532747 00000003 f8adcc94 00000000 nt!RtlpBreakWithStatusInstruction
f8adc984 8053321e 00000003 425a0094 baa55b48 nt!KiBugCheckDebugBreak+0x19
f8adcd64 804e187f 0000000a 425a0094 00000002 nt!KeBugCheck2+0x574
f8adcd64 baa55b48 0000000a 425a0094 00000002 nt!KiTrap0E+0x233
f8adce04 baa2d7dd 826c7473 82707480 00000000 wdf01000!FxRequestBase::CompleteSubmitted+0x15
f8adce20 baa2d8bf 016c6920 8278ed98 f8adce4c wdf01000!FxIoTarget::RequestCompletionRoutine+0x195
f8adce30 8050bf61 00000000 826c73b8 826c6920 wdf01000!FxIoTarget::_RequestCompletionRoutine+0x35
f8adce4c 804e3d38 00000000 826c73b8 8278ed98 nt!IopUnloadSafeCompletion+0x1d
f8adce7c f83940d5 826c73b8 826c5008 82e49028 nt!IopfCompleteRequest+0xa2
f8adcee4 f8394d47 826c7b3c 00000000 82e497d8 USBPORT!USBPORT_CompleteTransfer+0x373
f8adcf14 f8395944 026e6f44 82e490e0 82e490e0 USBPORT!USBPORT_DoneTransfer+0x137
f8adcf4c f839713a 82e49028 804e2eb4 82e49230 USBPORT!USBPORT_FlushDoneTransferList+0x16c
f8adcf78 f83a524b 82e49028 804e2eb4 82e49028 USBPORT!USBPORT_DpcWorker+0x224
f8adcfb4 f83a53c2 82e49028 00000001 82db6380 USBPORT!USBPORT_IsrDpcWorker+0x38f
f8adcfd0 804dbbd4 82e4964c 6b755044 00000000 USBPORT!USBPORT_IsrDpc+0x166
f8adcff4 804db89e f87f0404 00000000 00000000 nt!KiRetireDpcList+0x46
f8adcff8 f87f0404 00000000 00000000 00000000 nt!KiDispatchInterrupt+0x2a
WARNING: Frame IP not in any known module. Following frames may be wrong.
804db89e 00000000 00000009 bb835675 00000128 0xf87f0404

STACK_COMMAND: kb

FOLLOWUP_IP:
wdf01000!FxRequestBase::CompleteSubmitted+15
baa55b48 389894000000 cmp byte ptr [eax+94h],bl

SYMBOL_STACK_INDEX: 4

SYMBOL_NAME: wdf01000!FxRequestBase::CompleteSubmitted+15

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: wdf01000

IMAGE_NAME: wdf01000.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 47919015

FAILURE_BUCKET_ID: 0xD1_wdf01000!FxRequestBase::CompleteSubmitted+15

BUCKET_ID: 0xD1_wdf01000!FxRequestBase::CompleteSubmitted+15

Followup: MachineOwner


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hello Doron,

here is what actually happening (which might not seem to be clear). As I have 2 “interrupt”
endpoints one works flawlessly (generating 4,9 bytes regularly) -> these are the “working”
OnInterrupt calls you see. When the very first “huge” data would arrive I end up at once in
BSOD before the debugger would hit at my OnInterrupt caller.
AOK will check with verifier.exe and prefast.
Thanks

Let both Prefast and SDV through my driver they found not much (apart from badly decorated functions, problems in WDF .H-s, complaining in the EvtFileRead that the request might not complete in some code paths (which is funny, while it is the merely the copy-paste of the Microsoft example). Could not run (yet) verifier, as it slows down the system+driver on the test machine so that the test application always times out, thus unable to download the firmware into the
target FX2 device.
Cheers,

Guys, currently I am retesting the problem. I get the following BSOD with 128k transfer length:

bugcheck 0xFE, BUGCODE_USB_DRIVER:
param1 = 0x05, param2=0x82cc60e0, param3=0x808624cd, param4=0x82e8c180

According to MSDN:
if param1=0x5
param2=Device extension pointer of the host controller PCI vendor
param3=product id for the controller
param4=Pointer to endpoint data structure

A hardware failure has occurred due to a bad physical address found in a hardware data structure. This is not due to a driver bug.

I also get the following “!analyze -v”:

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0xFE

PROCESS_NAME: TraceView.exe

LAST_CONTROL_TRANSFER: from f7e96e7b to 80533806

STACK_TEXT:
f8b65dbc f7e96e7b 000000fe 00000005 82cc60e0 nt!KeBugCheckEx+0x1b
f8b65ddc f7ea37b9 82cc6028 00000fd0 82a9f000 USBPORT!USBPORT_BugCheck+0x2d
f8b65e10 f8a3dc69 5650706d 82cc69dc 82e8c180 USBPORT!USBPORTSVC_MapHwPhysicalToVirtual+0x11d
f8b65e34 f8a3e192 82cc69dc 82e8c180 82e8c180 usbehci!EHCI_PollActiveAsyncEndpoint+0x37
f8b65e90 f8a3ff1d 82cc69dc 82e8c180 f8b65ec0 usbehci!EHCI_PollAsyncEndpoint+0x98
f8b65ea0 f7e904aa 82cc69dc 82e8c180 804e2eb4 usbehci!EHCI_PollEndpoint+0x1f
f8b65ec0 f7e91768 026c6f50 804e2eb4 82e8c008 USBPORT!USBPORT_PollEndpoint+0xe8
f8b65ee8 f7e94204 82cc6028 50457270 82cc60e0 USBPORT!USBPORT_CoreEndpointWorker+0x2be
f8b65f48 f7e950a8 02e8c008 ffffffff 804e2eb4 USBPORT!USBPORT_FlushPendingList+0x2dc
f8b65f78 f7ea324b 82cc6028 804e2eb4 82cc6028 USBPORT!USBPORT_DpcWorker+0x192
f8b65fb4 f7ea33c2 82cc6028 00000001 82d2bd98 USBPORT!USBPORT_IsrDpcWorker+0x38f
f8b65fd0 804dbbd4 82cc664c 6b755044 00000000 USBPORT!USBPORT_IsrDpc+0x166
f8b65ff4 804db89e edd2e2d4 00000000 00000000 nt!KiRetireDpcList+0x46
f8b65ff8 edd2e2d4 00000000 00000000 00000000 nt!KiDispatchInterrupt+0x2a
WARNING: Frame IP not in any known module. Following frames may be wrong.
804db89e 00000000 00000009 bb835675 00000128 0xedd2e2d4

STACK_COMMAND: kb

FOLLOWUP_IP:
usbehci!EHCI_PollActiveAsyncEndpoint+37
f8a3dc69 50 push eax

SYMBOL_STACK_INDEX: 3

SYMBOL_NAME: usbehci!EHCI_PollActiveAsyncEndpoint+37

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: usbehci

IMAGE_NAME: usbehci.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 480254ce

FAILURE_BUCKET_ID: 0xFE_usbehci!EHCI_PollActiveAsyncEndpoint+37

BUCKET_ID: 0xFE_usbehci!EHCI_PollActiveAsyncEndpoint+37

Followup: MachineOwner

What the heck does that mean?

Hi Tibor,

First thing I would do is install checked builds of USBHUB.SYS, USBPORT.SYS and USBEHCI.SYS and see if your driver is triggering any assertions.

From my experience, the one time I’ve seen this particular USB bugcheck is when my USB device was sending back high speed endpoint descriptors (i.e. with a wMaxPacketSize value of 512) but the device had only connected at full speed. My firmware was getting the wrong value for the current bus speed. With the checked builds of those drivers, I did see several assertions that tipped me off:

*** Assertion failed: lengthThisTd <= MAX_ASYNC_PACKET_SIZE
*** Source File: d:\xpsprtm\drivers\wdm\usb\hcd\miniport\usbuhci\async.c, line 417

(or something like that.) Your call stack looks much like mine as well, with USBPORTSVC_MapHwPhysicalToVirtual eventually calling USBPORT_BugCheck and then the dreaded KeBugCheckEx.

Good luck,
Curtis Petersen

----- Original Message ----

bugcheck 0xFE, BUGCODE_USB_DRIVER:
param1 = 0x05, param2=0x82cc60e0, param3=0x808624cd, param4=0x82e8c180

According to MSDN:
if param1=0x5
param2=Device extension pointer of the host controller PCI vendor
param3=product id for the controller
param4=Pointer to endpoint data structure

Wow! That’s promising. But where can I get the checked build of XP? I can’t see it on MSDN/subscriptions. Is it available at all? Or is it renamed to “Embedded Standard” as XP is
dead?