-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libtapasco] Exclusive Access and DMA Buffer allocation wear off after one failed attempt #296
Comments
Could you run the driver in debug mode and post the corresponding |
Sure. This is the corresponding log: |
It might be enough to add a new DMAControl implementation in https://github.com/esa-tu-darmstadt/tapasco/blob/master/runtime/libtapasco/src/dma.rs that simply does nothing and use that by at tapasco/runtime/libtapasco/src/device.rs Line 356 in 8f77c7c
tapasco/runtime/libtapasco/src/device.rs Line 389 in 8f77c7c
tapasco/runtime/libtapasco/src/device.rs Line 400 in 8f77c7c
Lastly, the correct DMA engine has to be loaded and unloaded in tapasco/runtime/libtapasco/src/device.rs Line 484 in 8f77c7c
Otherwise the DMA engine is initialized even for monitor only applications. |
Thank you for your suggestions. I've seen through them and I think I haven't stated the problem clearly enough: The problem is that if a device is exclusively acquired, another application receives the correct |
Implement suggestion of @jahofmann in: esa-tu-darmstadt#296 (comment) When a new device is created a dummy implementation of the DMA Engine is used that simply does nothing. The actual DMA Engine is initialized later when the access mode is changed from monitor to exclusive mode. This is necessary to prevent a monitoring application like `tapasco-debug` to allocate all DMA Buffers of the kernel driver.
I've implemented your suggestions. However, this produces another error message when As in the previous implementation this error wears off after one retry. |
I fear this is a similar problem. When the PEs are created, the runtime will also allocate and register eventfd for interrupt handling. This step needs to be postponed until the access mode is exclusive as monitoring apps should not receive the interrupts. There are also some guards needed around the wait for PE functions to avoid deadlocks if the interrupts have not been set. This should make the runtime play fine with the driver, but all these checks should also be in the driver so it does not simply crash if "held wrong". In any case this is more for future reference than your work ;) |
Also leave some instructions on how to enable it again. Debug mode is currently the same as unsafe mode due to libtapasco not handling this case of access mode. Additionally, the DMA Buffers, Interrupts, etc. are also allocated in Monitor Mode which leads to the problem that you have to start your other runtime twice. For this case I've added a comment in the help section of `tapasco-debug`.
Might be fixed in #328? |
When I'm having one Host application running with exclusive access (in this case tapasco-debug in Debug Mode) and then start another runtime application which tries to acquire exclusive access to the same device this results in the following errors in the first two attempts but then from the third attempt on it succeeds.
The first error comes from
libtapasco
allocating all 32 DMA Buffers from TLKM at initialization time which also happens only once.The text was updated successfully, but these errors were encountered: