Re: mechanism to syncronise device access from user and kernel

From: Robert Hancock
Date: Fri Dec 05 2008 - 20:10:27 EST


Parav Pandit wrote:
Hi,

I have a device whose registers are accessed by driver as well as user space application via mmap() area.

How to synchronize the access (avoid race condition) between user space driver and kernel mode driver, in single CPU and multi-CPU systems?

This doesn't seem like the best idea in the first place.. certainly not if unprivileged processes can get access to the registers, as there's no way to require them to follow the synchronization process. Generally a given set of registers should be driven by a kernel driver or a userspace process, not both.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/