Debugging LUN reset

What are the best practices to debug a LUN reset (SRB_FUNCTION_RESET_LOGICAL_UNIT) in a storport miniport driver?
Since the LUN reset is issued when the driver didn’t complete some SRB within it’s timeout period, is there any way to find out which SRB actually experienced such timeout?

We are observing a LUN reset during one of our tests. We instrumented our driver by timestamping the arrival and return of each SRB, and comparing the time difference with the SRB timeout value, but none of them exceed the timeout!
The closest we have seen is 107 seconds against the timeout value of 120 seconds, but it is still less than the timeout value. Most of the SRBs anyway get completed within 2 seconds max.

Any pointers will be appreciated.

Regards,
Suresh

StorageKD might help. Set a breakpoint on your reset handler, run !storagekd.help, and start clicking around.

Thanks Scott for the response. We did try that out though but not much luck.
I was hoping that StorageKD somewhere provides the SRB which timed out and caused the LUN Reset. If it did, it would help inspecting that particular SRB and the related internal data structures to probe the reason of timeout.

Regards,
Suresh

If there’s a lost SRB it should show up in the output somewhere. Did you check !storclass as well? And does the adapter log under !storadapter say anything? There’s a link to the appropriate !storloglist command at the end of the !storadapter output.