I wonder what if ioremap()/iounmap is called by diffrent threads (system calls in to kernels from diffrent processes). Consider example:
1)thread A does addr0=ioremap (address0, len); do something else; sleep. 2)B thread does add1=ioremap(address0, len); do something, then call iounmap(addr1); 3)A does something, then call iounmap(addr0).Does that matter?
Condider a different situation. memory looks like this; add0 ... addr1(addr1=addr0 + l1)
addr2(addr=add0+l0).
1)thread A does addr0=ioremap (address0, l0); do something else; sleep. 2)B thread does add1=ioremap(address0, l1); do something, then call iounmap(addr1); 3)A does something, then call iounmap(addr0).