USB driver hang

I am working on UMDF USB driver for a custom device. It is based on the sample umdf\usb\fx2_driver in WinDDK. I built the driver with the latest WDK 7.1

I am facing a strange problem and have not been able to get any clue. Driver works fine for short transactions. But for long ~256 kbyte out transaction driver( or hardware) hangs.
Transaction does not time out and the request on the other endpoint also does not complete indicating the complete hang.

Even if the hardware hangs I expect the driver to timeout.

Device is at customer end and I have not been able to get USB bus trace so far.

I installed Windbg and used wudfext extension to get some info.PnP state looks fine. Device is in active D0 state. Request is not waiting in the Queue and is not owned by user level stack. Requests have been delivered to the kernel level stack.

I have very little experinece on this and I appretiate any help on how to proceed further.

You have several possibilities:

  • get USB bus trace log (preferred)
  • get memory dump in hung state and examine internal state of OS drivers
    (usable probably only for MS devs)
  • enable OS USB drivers ETW logging, capture the log, examine it and
    hope there will be something useful

The 3rd possibility is probably the simplest for you now. Search
archives to see how to enable logging. Works for Win7 only. Are you
using Win7, right?

As you’re working for Intel, you can also ask your coworkers who
invented the fantastic idea with the chipset using integrated STT hubs
:-/

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@intel.com
Sent: Monday, May 03, 2010 7:12 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB driver hang

I am working on UMDF USB driver for a custom device. It is
based on the sample umdf\usb\fx2_driver in WinDDK. I built
the driver with the latest WDK 7.1

I am facing a strange problem and have not been able to get
any clue. Driver works fine for short transactions. But for
long ~256 kbyte out transaction driver( or hardware) hangs.
Transaction does not time out and the request on the other
endpoint also does not complete indicating the complete hang.

Even if the hardware hangs I expect the driver to timeout.

Device is at customer end and I have not been able to get USB
bus trace so far.

I installed Windbg and used wudfext extension to get some
info.PnP state looks fine. Device is in active D0 state.
Request is not waiting in the Queue and is not owned by user
level stack. Requests have been delivered to the kernel level stack.

I have very little experinece on this and I appretiate any
help on how to proceed further.


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

Since this is a UMDF USB driver, most likely you’re using WinUSB. In
addition to core USB ETW, you can record a WinUSB WPP log:
http://blogs.msdn.com/usbcoreblog/archive/2010/02/05/how-to-generate-and-view-a-winusb-debug-trace-log.aspx

Michal Vodicka wrote:

You have several possibilities:

  • get USB bus trace log (preferred)
  • get memory dump in hung state and examine internal state of OS drivers
    (usable probably only for MS devs)
  • enable OS USB drivers ETW logging, capture the log, examine it and
    hope there will be something useful

The 3rd possibility is probably the simplest for you now. Search
archives to see how to enable logging. Works for Win7 only. Are you
using Win7, right?

As you’re working for Intel, you can also ask your coworkers who
invented the fantastic idea with the chipset using integrated STT hubs
:-/

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@intel.com
> Sent: Monday, May 03, 2010 7:12 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] USB driver hang
>
> I am working on UMDF USB driver for a custom device. It is
> based on the sample umdf\usb\fx2_driver in WinDDK. I built
> the driver with the latest WDK 7.1
>
> I am facing a strange problem and have not been able to get
> any clue. Driver works fine for short transactions. But for
> long ~256 kbyte out transaction driver( or hardware) hangs.
> Transaction does not time out and the request on the other
> endpoint also does not complete indicating the complete hang.
>
> Even if the hardware hangs I expect the driver to timeout.
>
> Device is at customer end and I have not been able to get USB
> bus trace so far.
>
> I installed Windbg and used wudfext extension to get some
> info.PnP state looks fine. Device is in active D0 state.
> Request is not waiting in the Queue and is not owned by user
> level stack. Requests have been delivered to the kernel level stack.
>
> I have very little experinece on this and I appretiate any
> help on how to proceed further.
>
> —
> 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
>

One possible reason could be when the data size is an exact multiple of the end point size then the device firmware might not know that the command has got completed. It might be waiting for more data in that case sending an empty frame might help. The device will know the transaction has completed and will send back the reply. I have personally seen a scenario like this.

I do not see this problem when the data size is small even when the data size is not multiple of the end point size.

I am seeing this problem on server 2003 SP2. Both the tracing mechanism suggested by Michal and Philip look to work for Win7 only. Is there is way any other way to debug on server 2003? It looks that ETW tracing exists since win 2000. But I could not find doc on how to get log of the WinUSB for OS other than Win7. I used the onfo from the blog to capture the data but the looks like I need a correct tmf file to view the log. Where can I get it?

One of the blog says “You can develop WinUSB and UMDF drivers for Windows XP and later versions of Windows (not including Windows Server 2003)”. Does MS not recommend using USB UMDF driver on server 2003?

ETW tracing exists long time but (USB) software has to use it which
wasn’t the case till Win7. However, if you were able to capture
something, try to use WinUsb TMF files from the blog and force tools to
use them. AFAIK WinUsb didn’t change so much and it could work.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@intel.com
Sent: Tuesday, May 04, 2010 7:37 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] USB driver hang

I do not see this problem when the data size is small even
when the data size is not multiple of the end point size.

I am seeing this problem on server 2003 SP2. Both the tracing
mechanism suggested by Michal and Philip look to work for
Win7 only. Is there is way any other way to debug on server
2003? It looks that ETW tracing exists since win 2000. But I
could not find doc on how to get log of the WinUSB for OS
other than Win7. I used the onfo from the blog to capture the
data but the looks like I need a correct tmf file to view the
log. Where can I get it?

One of the blog says “You can develop WinUSB and UMDF drivers
for Windows XP and later versions of Windows (not including
Windows Server 2003)”. Does MS not recommend using USB UMDF
driver on server 2003?


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

I have gone through the videos about the UMDF driver debug. But the using that info does not provide any useful info. I can not interpret or conclude any problem from the threads of the wudfhost.exe.

Is there a way to get help from MS engineer on this to debug the problem?

Also as I said earlier when I try to to see the output of the Winusb log I see format error. Is there a diffrent tmf file for server 2003?

Your company is a super-duper-platinum MS partner
and *does* have a way to access premium level of support.
But it is not free. Decide for yourself whether you’re ready to elevate and
pay the bill.

Good luck.
– pa

wrote in message news:xxxxx@ntdev…
> I have gone through the videos about the UMDF driver debug. But the using
> that info does not provide any useful info. I can not interpret or
> conclude any problem from the threads of the wudfhost.exe.
>
> Is there a way to get help from MS engineer on this to debug the problem?
>
> Also as I said earlier when I try to to see the output of the Winusb log I
> see format error. Is there a diffrent tmf file for server 2003?
>