Exclusive access to MMC device?

We are developing a piece of software which sends low-level commands to the eMMC device in order to access certain special features of the chip. MMC writes and reads are typically a sequence of commands (CMD8, CMD23, etc.).

Often, it seems that our sequence of commands is being interrupted by the OS which does some logging, which is also to the MMC device (our rootfs). During the interruptions, data are written (and maybe read), which gets our own command sequence out-of-sync, including taking the device out of “command” mode.

We have confirmed that if we boot from the SD card (and not the eMMC) we do not have this problem; presumably, the logging happens independently to the SD card, and our own read/writes to MMC are fine. Unfortunately, this is not a viable long-term solution.

So, the question is: how can our program temporarily seize control of the MMC device? Can we temporarily halt OS disk activity? Make our program uninterruptible?

Thank you!