* RE: problem with pci_alloc_consistent (it does work)
@ 2002-09-17 18:24 Waqar Ahmad
2002-09-17 23:16 ` Matt Porter
0 siblings, 1 reply; 2+ messages in thread
From: Waqar Ahmad @ 2002-09-17 18:24 UTC (permalink / raw)
To: linuxppc-embedded
Found the problem I was using phys_to_virt(..) to convert the physical address to virtual. Once I fixed that everything seems to be working now. so
Waqar
> -----Original Message-----
> From: owner-linuxppc-embedded@lists.linuxppc.org
> [mailto:owner-linuxppc-embedded@lists.linuxppc.org]On Behalf Of wahmad
> Sent: Monday, September 16, 2002 6:38 PM
> To: linuxppc-embedded@lists.linuxppc.org
> Subject: problem with pci_alloc_consistent
>
>
>
> I am using pci_alloc_consistent() for obtaining contiguous
> memory that is
> cache safe. Here is how I am calling the routine
>
> pci_alloc_consistent(NULL,size,&dummy).
> Note I am throwing away the bus address.
>
> The memory that I get does not seem to be cache safe. My
> device doesn't see
> the data untill I add flush_dcache_range(..). It is very
> undesirable for me
> to add flushes and invalidates. I will appreciate any help in
> this matter.
>
> I am using kernel version 2.4.20-pre5 for IBM PPC405GP and
> using version
> 2.95.3 for gcc on an x86 as a cross compiler.
>
> I also have CONFIG_NOT_COHERENT_CACHE defined.
>
> Thanks
>
> Waqar
>
>
>
>
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: problem with pci_alloc_consistent (it does work)
2002-09-17 18:24 problem with pci_alloc_consistent (it does work) Waqar Ahmad
@ 2002-09-17 23:16 ` Matt Porter
0 siblings, 0 replies; 2+ messages in thread
From: Matt Porter @ 2002-09-17 23:16 UTC (permalink / raw)
To: Waqar Ahmad; +Cc: linuxppc-embedded
On Tue, Sep 17, 2002 at 02:24:35PM -0400, Waqar Ahmad wrote:
> Found the problem I was using phys_to_virt(..) to convert the
> physical address to virtual. Once I fixed that everything seems
> to be working now. so
Anybody confused by this should read and understand
Documentation/IO-mapping.txt. virt_to_phys/phys_to_virt
and virt_to_bus/bus_to_virt are only defined for usage on
system memory. This means statically mapped kernel memory.
The only way to reliably (cross platform) get a physical
address from pci_alloc_consistent is to hold on to your
dma_handle. This has been covered a number of times on lkml
with DavidM and might even be in the current DMA-mapping.txt
by now...but I doubt it. :)
Regards,
--
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-17 23:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-17 18:24 problem with pci_alloc_consistent (it does work) Waqar Ahmad
2002-09-17 23:16 ` Matt Porter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).