USB is not my forte, so Tim you may tell me to go back to sleep.
However, having had “missed” interrupts and “lost” data on several different
drivers I have written there is one possibility that I have as to see
discussed: Improper handling of the ISR/DPC interface.
Data can very easily be missed or lost when the interrupt service routines
blindly queues a DPC. Since the rule of thumb is only one DPC on the queue
at a time, the first one queued is the one you get and the last one queued
goes into the proverbial bit bucket. Hence, I have found the best way to
handle the ISR/DPC is to queue the volatile data available during the
interrupt so that you never ever loose it. Any resulting request to the DPC
queue will simply mean that the DPC is going to be called at the end of the
interrupt. You can of course check the state of your event queue and NOT
queue the DPC if there is an event in your queue. The DPC will always run
ALL the way to the end of its “event” queue. If the interrupt triggers
during DPC processing you know the last data received will be in the last
item on the DPC’s event queue. Obviously you have to be sensible about what
spinlocks you hold and for how long. Assuming that the data you have in the
ISR is the data you will see in the DPC is folly. It very well may not be,
unless the developer takes to steps to make certain that it is.
Ok … if USB don’t work that way then ignore all the above. And if this has
already been discussed, then ignore the reiteration.
The personal opinion of
Gary G. Little
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Randy Aull
Sent: Friday, September 18, 2009 12:18 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] WDF_USB_CONTINUOUS_READER_CONFIG
Even if it was set to 1 second, the slowest that the existing host
controllers poll is about every 32ms, so that wouldn’t explain the 1/2
second delay.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Thursday, September 17, 2009 2:05 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] WDF_USB_CONTINUOUS_READER_CONFIG
xxxxx@hotmail.com wrote:
I know data is missing because the button can physically be pressed down -
a click can be heard - released and nothing happens. If you press the button
down, and hold it the desired event happens.
If I press the button just as the continiousdata preforms its read the
data is picked up, if I do it a milisecond too late I have to wait until the
next read completion. So the event can be instantinious to being a second
out.
I hope that makes sense.
So, your interrupt pipe has an interval of one second? That’s the
problem, then, isn’t it? Why don’t you set the interval to, say, 10ms?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
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
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
__________ Information from ESET Smart Security, version of virus signature
database 4438 (20090918) __________
The message was checked by ESET Smart Security.
http://www.eset.com
__________ Information from ESET Smart Security, version of virus signature
database 4438 (20090918) __________
The message was checked by ESET Smart Security.
http://www.eset.com