Temporarily disable memory mappings?

Eugene Crosser (geertj@stack.nl)
Sun, 21 Jun 1998 13:59:49 +0200


Hello,

I'm writing a device driver for the PCI/Highway controller, a card that is
used here at the University for data aquisition. The card uses a mmio
region for controlling the measurement interfaces connected to it and can
do dma to transfer data from such an interface. The mmio region is made
available to the user via read()/write() and mmap().

The problem is this: when doing a dma transfer, the mmio region may not
be accessed. This is a hardware requirement. There's no problem with
read/write because the driver can check for a dma in progress and put
the process onto a wait queue or just fail. However, a process can still
access it via a mmap() mapping.

I'm already allowing only one process to open the device. But, I do want
tosupport multi-threaded environments. Threads should be safe because
they cantake care that they don't access this memory while doing dma but
I wantsome sort of protection.

Is it possible to temporarily disable this io memory and all its mappings
during dma. Preferably I would like to put offending threads on a wait
queue and restart the memory access when dma is done, but this is not
required. Any thoughts?

Please CC via email.

Geert Jansen.

--
  Geert Jansen,                          "Vanity is my favourite sin"...
  Student of Physics.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu