From: Brian Kuschak <hidden> Date: 2003-09-08 21:36:38
I think the virt_to_phys() function is incorrect for
PPC440. It should call iopa for all 4xx, not only the
405. By chance, it happens to work currently if the
address is in SDRAM, but is always incorrect for
ioremapped addresses. virt_to_bus() does the right
thing.
Also, to be correct, shouldn't this function return a
phys_addr_t rather than an unsigned long, as the
physical address is >32 bits on 44x?
Regards,
Brian
From: Dan Malek <hidden> Date: 2003-09-08 22:03:48
Brian Kuschak wrote:
I think the virt_to_phys() function is incorrect for
PPC440. It should call iopa for all 4xx, not only the
405.
You won't get any argument for me, but everyone else
will argue with us. A long, long time ago I got spoiled
using, designing, and implementing orthogonal VM functions.
When I bring up this discussion I'm continually reminded
that Linux isn't this way, it's supposed to be lightweight
and fast.....meaning you have to use different functions
to manage different memory regions with subtle side effects.
.... By chance, it happens to work currently if the
address is in SDRAM, but is always incorrect for
ioremapped addresses. virt_to_bus() does the right
thing.
It will likely always be this way. You have to keep track
of your own mappings and compute what you need from that,
especially when mapping things for DMA.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
I think the virt_to_phys() function is incorrect for
PPC440. It should call iopa for all 4xx, not only the
405. By chance, it happens to work currently if the
address is in SDRAM, but is always incorrect for
ioremapped addresses. virt_to_bus() does the right
thing.
No, it shouldn't call iopa even for 405. Look at 2.6 version for example.
virt_to_phys is used only for directly mapped addresses not for ioremaped
peripherals or vmalloc space.
Also, to be correct, shouldn't this function return a
phys_addr_t rather than an unsigned long, as the
physical address is >32 bits on 44x?
440 cannot handle more than 2G of RAM, so physaddr_t is not needed.
Eugene.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/