* Darmawan Salihun darmawan.salihun@gmail.com [070724 06:11]:
I'm currently completing the MMIO mapping routine in the device driver, but I have a problem as follows:
The current driver doesn't limit the application to map certain MMIO phy address range even if it's already mapped by another routine in the same application. I actually plan to "lock" the mapped MMIO phy address range so that once it's mapped, it must be unmapped first before another routine can map that range. Actually, this is to avoid two routine from manipulating the same area at the same time.
My question is, do you think we really need the "lock-ing" mechanism in the driver? I just think it is a potential problem if the MMIO access is not "lock-ed".
Since the places where mmap happens are only a few I'd say it is not really "needed". It's a good idea though as it is a safety measure against application bugs.
Another note is: The current driver limits the application capability to map MMIO to the low_1MB address range and (4GB-20MB) to 4GB address range.
This sounds reasonable.
Stefan