Re: Regarding consistent_alloc

4 messages, 3 authors, 2002-12-06 · open the first message on its own page

Re: Regarding consistent_alloc

From: Matt Porter <hidden>
Date: 2002-12-06 18:30:07

On Fri, Dec 06, 2002 at 05:08:22PM +0100, Joakim Tjernlund wrote:
quoted
On Fri, Dec 06, 2002 at 03:25:48PM +0100, Joakim Tjernlund wrote:
quoted
If you implement the performance improvement I suggested earlier, I don't think
you need them. Another thing with consistent_xxx() is that you can not use
__pa() and __va() on addresses returned by the consistent_alloc et. al.
Um, well if you are doing a consistent_alloc() then surely you are
keeping the dma_handle around which is your physical address.  If you
want the kernel virtual address then you can apply __va to that.  So,
you have the cache inhibited mapping in vmalloc space returned to you,
the physical address provided in dma_handle, and a kernel virtual address
that can be trivially generated.
m8xx_cpm_hostalloc() does not keep the DMA handle and __pa() does not work
on addresses returned by m8xx_cpm_hostalloc(). I just found that out the
hard way when upgrading from MV 2.4.2 to linuxppc_2_4_devel 2.4.20. My SPI driver
that's a problem with m8xx_cpm_hostalloc() (or how you are using it) if
it doesn't keep around the values you need.

--
Matt Porter
porter@cox.net
This is Linux Country. On a quiet night, you can hear Windows reboot.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

RE: Regarding consistent_alloc

From: Joakim Tjernlund <hidden>
Date: 2002-12-06 18:15:15

On Fri, Dec 06, 2002 at 05:08:22PM +0100, Joakim Tjernlund wrote:
quoted
quoted
On Fri, Dec 06, 2002 at 03:25:48PM +0100, Joakim Tjernlund wrote:
quoted
If you implement the performance improvement I suggested earlier, I don't think
you need them. Another thing with consistent_xxx() is that you can not use
__pa() and __va() on addresses returned by the consistent_alloc et. al.
Um, well if you are doing a consistent_alloc() then surely you are
keeping the dma_handle around which is your physical address.  If you
want the kernel virtual address then you can apply __va to that.  So,
you have the cache inhibited mapping in vmalloc space returned to you,
the physical address provided in dma_handle, and a kernel virtual address
that can be trivially generated.
m8xx_cpm_hostalloc() does not keep the DMA handle and __pa() does not work
on addresses returned by m8xx_cpm_hostalloc(). I just found that out the
hard way when upgrading from MV 2.4.2 to linuxppc_2_4_devel 2.4.20. My SPI driver
that's a problem with m8xx_cpm_hostalloc() (or how you are using it) if
it doesn't keep around the values you need.
Yes and no, someone changed the m8xx_cpm_hostalloc() implementation and now
it does not behave as it used to. Earlier both __pa(adr) and __va(__pa(adr))
worked on addresses returned by m8xx_cpm_hostalloc().

I think in it's current form it's useless and should either be changed back to what
it was or die.

   Jocke


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: Regarding consistent_alloc

From: Dan Malek <hidden>
Date: 2002-12-06 19:59:08

Joakim Tjernlund wrote:
Yes and no, someone changed the m8xx_cpm_hostalloc() implementation and now
it does not behave as it used to. Earlier both __pa(adr) and __va(__pa(adr))
worked on addresses returned by m8xx_cpm_hostalloc().
I changed it a while back so single large pages could be used to map the
kernel space.  Just use iopa() on the virtual address to get the physical
address.  I don't understand the current condition of commproc.c today, but
I'm not the only one that updates it anymore.  The bk comments are quite
useless since all they indicate is some obscure patch was applied.
I think in it's current form it's useless and should either be changed back to what
it was or die.
It seems quite useful to the drivers that currently use it.........It's
only purpose is to provide small non-cached objects like uart fifos and control
areas.  Don't try to use it for things not intended.


	-- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: Regarding consistent_alloc

From: Joakim Tjernlund <hidden>
Date: 2002-12-06 22:11:11

Joakim Tjernlund wrote:
quoted
Yes and no, someone changed the m8xx_cpm_hostalloc() implementation and now
it does not behave as it used to. Earlier both __pa(adr) and __va(__pa(adr))
worked on addresses returned by m8xx_cpm_hostalloc().
I changed it a while back so single large pages could be used to map the
kernel space.  Just use iopa() on the virtual address to get the physical
address.  I don't understand the current condition of commproc.c today, but
I'm not the only one that updates it anymore.  The bk comments are quite
useless since all they indicate is some obscure patch was applied.
quoted
I think in it's current form it's useless and should either be changed back to what
it was or die.
It seems quite useful to the drivers that currently use it.........It's
only purpose is to provide small non-cached objects like uart fifos and control
areas.  Don't try to use it for things not intended.
Exacly, I was using it as a small fifo for my SPI driver(not really mine, I found it on the net).
Since  __pa() and __va() doesn't work anymore, it should be documented becauase I think
most people expect __pa() and __va() to work on kernel memory and it did work in 2.4.2.

Anyway, I have fixed my driver now so this is not a problem for me anymore.

 Jocke

PS.
   Dan, are you still working/testing my 8xx_io/enet.c patch?


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help