synchronization between drivers

Hi all, I’ve a need to synchronize device access between two drivers. The device has two cores and separate drivers. During initialization time, only driver can do certain operation. What are the options? I was looking at IoCreateSynchronizationEvent but confused on the usage.


Totally wrong design…

How can you possibly have two drivers for the same physical device??? If your device exposes two different interface functions drivers for these two functions have to be totally independent from one another and be totally oblivious to the fact that they are located on the same physical device. In such case you would need 3 drivers - one for each exposed function plus the third one for the actual physical device, with the latter acting as a bus driver that creates PDOs, and the other two as function ones that attach their FDOs to their corresponding underlying PDOs created by above mentioned bus driver. If both device cores implement the same functionality/interface the whole thing stays the same - you are going to have a bus driver plus two instances of a function one

Anton Bassov

Hi Anton, this is a unique situation due to known hardware defect. Only option at this point is to implement an workaround which is synchronize the drivers during a particular device access operation at driver initialization.

Read my previous post carefully again…

Even if there is some hardware bug that is yet to get fixed the outlined driver architecture still holds, at least from the software perspective. Concerning your particular request , synchronisation between the cores apparently has to be done by a bus driver using any synch construct that applies in a given situation, which depends on IRQL constraints of the calls (if any) that you make upon initialisation while holding a lock. If you make some calls that require strictly PASSIVE_LEVEL callers (like, for example, Zw… calls) your only option are events and “simple” mutexes. If APC_LEVEL callers are allowed FAST_MUTEX may be an option. If DPC-level callers are allowed ( or if you make no calls at all) you can use a spinlock, but make sure that you don’t hold it for too long. In other words,it depends…

Anton Bassov