Hi all,
I'm using the continous reader functions in KMDF for a bulk read transfer on
a device that has a serial (CAN) bus. It's important that the data comes in
order in the driver's buffer, but I've seen issues on multi processor
machines. I know that the callback can run at the same time on different
processors, but how can I make sure to lock so all read buffer is processed
in the right order?
Currently, I use a spinlock in the beginning of the callback, but that is
not theoretically safe, as the thread can be interrupted before the spinlock
is acquired and the next callback eventually runs on the other processor
(or?). I've seen it happend when we used very small buffers for the usb
transfer (to get low bus latency). I use several queued reads, up to ten is
supported I suppose.
Regards,
Carl-Magnus Segerlund