Skip to contentSkip to conversation

mechanism to syncronise device access from user and kernel

DISCUSSION Parav Pandit 3 participants 3 messages Dec 5, 2008 – Dec 6, 2008

lore
Share & tools
lore
#0 lore raw

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?

Regards,
Parav Pandit

#1 lore raw
Quoted 5 lines · Parav Pandit

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.

#2 lore raw
In reply to Parav Pandit
Quoted 5 lines · Parav Pandit

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?

Rewrite userspace to use the kernel driver?

Signature · 1 line
Matthew Garrett | [email protected]