Do not disable DMA in destructor

The "puzzlecmd" tool needs to create multiple instances
of PuzzleFwDevice, one for the data server and one for
simple register commands. We don't want these instances
fighting over the state of the DMA engine.
This commit is contained in:
Joris van Rantwijk 2024-09-19 22:55:31 +02:00
parent 30939214df
commit 12413ba041
2 changed files with 3 additions and 7 deletions

View File

@ -160,9 +160,6 @@ puzzlefw::PuzzleFwDevice::PuzzleFwDevice()
/* Destructor. */ /* Destructor. */
puzzlefw::PuzzleFwDevice::~PuzzleFwDevice() puzzlefw::PuzzleFwDevice::~PuzzleFwDevice()
{ {
// Disable DMA engine.
set_dma_enabled(false);
// Unmap memory regions. // Unmap memory regions.
munmap((void*)m_regs, puzzlefw::REGS_SIZE); munmap((void*)m_regs, puzzlefw::REGS_SIZE);
munmap((void*)m_dma_buf, m_dma_buf_size); munmap((void*)m_dma_buf, m_dma_buf_size);

View File

@ -108,14 +108,13 @@ struct VersionInfo {
* This class uses the UIO driver framework and the custom PuzzleFW Linux * This class uses the UIO driver framework and the custom PuzzleFW Linux
* kernel driver to access the PuzzleFW firmware. * kernel driver to access the PuzzleFW firmware.
* *
* Only a single instance of this class should exist at any time in any
* process on the system. Creating multiple instances, even in separate
* processes, may cause the firmware to function incorrectly.
*
* Methods of this class may throw exceptions to report error conditions. * Methods of this class may throw exceptions to report error conditions.
* "std::invalid_argument" is used to report invalid arguments. * "std::invalid_argument" is used to report invalid arguments.
* "std::runtime_error" is used to report errors during opening of the device. * "std::runtime_error" is used to report errors during opening of the device.
* *
* It is generally not safe to access the firmware concurrently
* through multiple instances of this class, even from separate processes.
*
* Unless stated otherwise, the methods of this class must not be called * Unless stated otherwise, the methods of this class must not be called
* concurrently from multiple threads without explicit synchronization. * concurrently from multiple threads without explicit synchronization.
*/ */