linux cache routines for Write-back cache policy on MIPS24KE
Hi,
I have ported Linux-2.6.18 kernel on MIPS24KE processor. I am using write back cache policy.
Could you please guide me under what cases the below cache API's are being used:
- dma_cache_wback_inv() : Could you explain what exactly this function does
- dma_cache_wback() : This function write back the cache data to memory
- dma_cache_inv : This function invalidate the cache tags. so subsequent access will fetch from memory.
Once I looked the above function definitions in linux-2.6.18/arch/mips/mm/c-r4k.c.
All these function's implemetation are same except bc_wbak_inv() is called in both dma_cache_wback-inv() and dma_cache_wback(), where as bc_inv() is called in case of dma_cache_inv.
Also, bc_inv()/bc_wbak_inv are define as null implementation for R4000.
That means all three functions are doing same functionality in case of R4000.
What are the difference between these three functions. Under what cases these functions are used.
Please guide me if you have any links which will explain these API's.
Thanks in advance.
Regards,
Veerasena.
Forgot the famous last words? Access your message archive online at http://in.messenger.yahoo.com/webmessengerpromo.php
Quoted 7 lines · veerasena reddy
I have ported Linux-2.6.18 kernel on MIPS24KE
processor. I am using write back cache policy.Could you please guide me under what cases the below cache API's are being used:
-dma_cache_wback_inv(): Could you explain what exactly this function does
It does both write back and invalidate.
Quoted 4 lines
-
dma_cache_wback(): This function write back the cache data to memory
-dma_cache_inv: This function invalidate the cache tags. so subsequent access will fetch from memory.
Note that 2.6.18 is old. The above functions are intended to be removed.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Hi Geert,
Thanks for your repsonse.
In linux-2.6.18 (for MIPS24KE processor):
suppose if i want to do flush only then which API i should use?
Similarly, if i want to do invalidation only which API i should use?
Thanks again.
Regards,
Veerasena.
Quoted 29 lines · --- Geert Uytterhoeven
Quoted 4 lines · veerasena reddy
I have ported Linux-2.6.18 kernel on MIPS24KE
processor. I am using write back cache policy.Could you please guide me under what cases the
below
Quoted 3 lines
cache API's are being used:
-dma_cache_wback_inv(): Could you explain what
exactly this function doesIt does both write back and invalidate.
Quoted 3 lines
-
dma_cache_wback(): This function write back the cache data to memory
-dma_cache_inv: This function invalidate thecache
Quoted 1 line
tags. so subsequent access will fetch from memory.
Note that 2.6.18 is old. The above functions are intended to be removed.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
Quoted 6 lines
In personal conversations with technical people, I
call myself a hacker. But
when I'm talking to journalists I just say
"programmer" or something like that.
-- Linus Torvalds
Get the freedom to save as many mails as you wish. To know how, go to http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html
Quoted 3 lines · veerasena reddy
In linux-2.6.18 (for MIPS24KE processor):
suppose if i want to do flush only then which API i should use?
`flush' is fuzzy terminology: some people mean invalidate, others mean write back, others mean both.
Quoted 2 lines
Similarly, if i want to do invalidation only which API i should use?
dma_cache_inv().
Quoted 14 lines
Quoted 12 lines · --- Geert Uytterhoeven
Quoted 4 lines · veerasena reddy
I have ported Linux-2.6.18 kernel on MIPS24KE
processor. I am using write back cache policy.Could you please guide me under what cases the
below
Quoted 3 lines
cache API's are being used:
-dma_cache_wback_inv(): Could you explain what
exactly this function doesIt does both write back and invalidate.
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
-
dma_cache_wback(): This function write back the cache data to memory
-dma_cache_inv: This function invalidate thecache
Quoted 1 line
tags. so subsequent access will fetch from memory.
Note that 2.6.18 is old. The above functions are
intended to be removed.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
hi Geert,
here i mean 'flush' is 'write-back only'
Regards,
Veerasena.
Quoted 52 lines · --- Geert Uytterhoeven
Quoted 2 lines · veerasena reddy
In linux-2.6.18 (for MIPS24KE processor):
suppose if i want to do flush only then which APIi
Quoted 1 line
should use?
`flush' is fuzzy terminology: some people mean invalidate, others mean
write back, others mean both.Quoted 1 line
Similarly, if i want to do invalidation only which
API
Quoted 1 line
i should use?
dma_cache_inv().Quoted 1 line
--- Geert Uytterhoeven <[email protected]>
Quoted 9 lines · wrote:
Quoted 9 lines · veerasena reddy
Quoted 4 lines
I have ported Linux-2.6.18 kernel on MIPS24KE
processor. I am using write back cache policy.Could you please guide me under what cases the
below
Quoted 2 lines
cache API's are being used:
-dma_cache_wback_inv(): Could you explainwhat
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
exactly this function does
It does both write back and invalidate.
Quoted 1 line
-
dma_cache_wback(): This function write backthe
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
cache data to memory
-dma_cache_inv: This function invalidatethe
Quoted 2 lines
Quoted 2 lines
cache
Quoted 1 line
tags. so subsequent access will fetch from
memory.
Quoted 3 lines
Quoted 3 lines
Note that 2.6.18 is old. The above functions are
intended to be removed.Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
Quoted 7 lines
In personal conversations with technical people, I
call myself a hacker. But
when I'm talking to journalists I just say
"programmer" or something like that.
-- Linus Torvalds
Forgot the famous last words? Access your message archive online at http://in.messenger.yahoo.com/webmessengerpromo.php
Quoted 19 lines · veerasena reddy
I have ported Linux-2.6.18 kernel on MIPS24KE processor. I am using write back cache policy.
Could you please guide me under what cases the below cache API's are being used:
-dma_cache_wback_inv(): Could you explain what exactly this function does
-dma_cache_wback(): This function write back the cache data to memory
-dma_cache_inv: This function invalidate the cache tags. so subsequent access will fetch from memory.Once I looked the above function definitions in
linux-2.6.18/arch/mips/mm/c-r4k.c.
All these function's implemetation are same exceptbc_wbak_inv()is called in both dma_cache_wback-inv() anddma_cache_wback(), where asbc_inv()is called in case ofdma_cache_inv.
Quoted 7 lines
Also, bc_inv()/bc_wbak_inv are define as null implementation for R4000.
That means all three functions are doing same functionality in case of R4000.What are the difference between these three functions. Under what cases these functions are used.
An internal only interface to be used with I/O cache coherency.
Quoted 2 lines
Please guide me if you have any links which will explain these API's.
Easy answer, don't use them, for 2.6.24 I've queued a patch to kill this API. Documentation/DMA-API.txt documents how to properly deal with I/O coherency in Linux.
Ralf
Hi Ralf,
Thanks for the reply.
Is there any problem if we use the below API's in linxu-2.6.18
- dma_cache_wback_inv()
- dma_cache_wback()
- dma_cache_inv()
functionality wise, especially in r4k.c i dont see any difference between the implementation of these APIs.
Can we apply the 2.6.24 patch to kill these APIs on 2.6.18 kernel? In this case what APIs i can use for writeback, invalidation or both?
I couldn't find any info. related to the above API in DMA-API.txt. Could you please give some pointers on the usage/working of these APIs.
Regards,
Veerasena.
Quoted 41 lines · --- Ralf Baechle
Quoted 4 lines · veerasena reddy
I have ported Linux-2.6.18 kernel on MIPS24KE processor. I am using write back cache policy.
Could you please guide me under what cases the
below
Quoted 6 lines
cache API's are being used:
-dma_cache_wback_inv(): Could you explain what exactly this function does
-dma_cache_wback(): This function write back the cache data to memory
-dma_cache_inv: This function invalidate thecache
Quoted 6 lines
tags. so subsequent access will fetch from memory.
Once I looked the above function definitions in
linux-2.6.18/arch/mips/mm/c-r4k.c.
All these function's implemetation are same exceptbc_wbak_inv()is called in bothdma_cache_wback-inv()
Quoted 1 line
and
dma_cache_wback(), where asbc_inv()is calledin
Quoted 8 lines
case of
dma_cache_inv.Also, bc_inv()/bc_wbak_inv are define as null implementation for R4000.
That means all three functions are doing same functionality in case of R4000.What are the difference between these three
functions.
Quoted 1 line
Under what cases these functions are used.
An internal only interface to be used with I/O cache coherency.
Quoted 2 lines
Please guide me if you have any links which will explain these API's.
Quoted 8 lines
Easy answer, don't use them, for 2.6.24 I've queued a patch to kill this
API.Documentation/DMA-API.txtdocuments how to properly deal with I/O
coherency in Linux.Ralf
Save all your chat conversations. Find them online at http://in.messenger.yahoo.com/webmessengerpromo.php
Quoted 9 lines · veerasena reddy
Is there any problem if we use the below API's in linxu-2.6.18
-dma_cache_wback_inv()
-dma_cache_wback()
-dma_cache_inv()functionality wise, especially in
r4k.ci dont see any difference between the implementation of these APIs.
Quoted 7 lines
Can we apply the 2.6.24 patch to kill these APIs on 2.6.18 kernel? In this case what APIs i can use for writeback, invalidation or both?
I couldn't find any info. related to the above API in DMA-API.txt. Could you please give some pointers on the usage/working of these APIs.
dma_cache_* were never documented. They respresent the earliest attempt at coming up with an API that enables portable drivers and it has a few shortcomings and like so many early things it was never formally documented, so don't expect any well defined semantics. The functions never got formally retired probably because it somehow managed to stay under the radar.
Any drivers should use the APIs documented in Documentation/DMA-API.txt only. The almost equivalent operation for dma_cache_* would be dma_sync_single and dma_sync_sg.
Don't even dream about using dma_cache_* for anything but DMA coherency. They're all internal low level APIs which know nothing about Linux's virtual memory system.
Anyway, it would be much easier to help you if we knew what you are trying to achieve with these functions.
Ralf
Ralf,
thanks for the detailed information.
Quoted 3 lines
Anyway, it would be much easier to help you if we
knew what you are trying
to achieve with these functions.
Basically our target has a MIPS24KE host processor on which Linux runs and a networking processor (NP) which sits between the EMAC contoller and the host processor to receive/transmit the data/packets.
This peripheral networking processor uses the physical addresses only. We are using write-back caching policy on MIPS24KE. So,
1. when we want to transmit the packet from the host to peripheral processor, we need to convert packet buffer into physical address (CPHYSADDR) and put it into the NP's Tx queue, which will be sent to EMAC. Before converting into physical address we need to flush the corresponding cache entries.
Which API should be used to achieve the above functionlaity in Linux-2.6.18 kernel?
2.Similarly in receivng path, the peripheral processor gives the physical address of the buffer containing the received packet. So, on host we need to convert this physical address into cached address (KSEG0ADDR). Before converting to cached address we need to invalidate the corresponding cache entries.
Which API should be used to achieve the above functionlaity in Linux-2.6.18 kernel?
currently we are using dma_cache_wback_inv() to achieve above two functionalities.
Could you please suggest us the right API to be used?
Thanks in advance.
Regards,
Veerasena.
Quoted 50 lines · --- Ralf Baechle
Quoted 7 lines · veerasena reddy
Is there any problem if we use the below API's in
linxu-2.6.18
-dma_cache_wback_inv()
-dma_cache_wback()
-dma_cache_inv()functionality wise, especially in
r4k.ci dont seeany
Quoted 1 line
difference between the implementation of these
APIs.
Quoted 2 lines
Can we apply the 2.6.24 patch to kill these APIs
on
Quoted 1 line
2.6.18 kernel? In this case what APIs i can use
for
Quoted 3 lines
writeback, invalidation or both?
I couldn't find any info. related to the above API
in
Quoted 1 line
DMA-API.txt. Could you please give some pointers
on
Quoted 1 line
the usage/working of these APIs.
dma_cache_* were never documented. They respresent the earliest attempt
at coming up with an API that enables portable drivers and it has a few
shortcomings and like so many early things it was never formally documented,
so don't expect any well defined semantics. The functions never got
formally retired probably because it somehow managed to stay under the
radar.Any drivers should use the APIs documented in
Documentation/DMA-API.txt
only. The almost equivalent operation for
dma_cache_* would bedma_sync_singleanddma_sync_sg.Don't even dream about using dma_cache_* for
anything but DMA coherency.
They're all internal low level APIs which know
nothing about Linux's
virtual memory system.
Quoted 6 lines
Anyway, it would be much easier to help you if we
knew what you are trying
to achieve with these functions.Ralf
Chat on a cool, new interface. No download required. Go to http://in.messenger.yahoo.com/webmessengerpromo.php