|
From: Rene B. <re...@we...> - 2001-09-26 18:52:45
|
Hi!
I am working hard on the 53c770 driver and there is a cache problem on=20
APUS/PPC. Is here anybody who can tell me how I can allocate some kernel=20
mem which is not cached (for DMA or to communicate with the 53c770)?
I`m using something like this:
np =3D __get_free_pages(GFP_ATOMIC, 1);
cache_push((u_long)virt_to_phys(np), 8192);
cache_clear((u_long)virt_to_phys(np), 8192);
kernel_set_cachemode((np), 8192, IOMAP_NOCACHE_SER);
Then the driver starts a test where the 53c770 is exchanging some 53c770=20
register values with some values in np.
The test fails, because np is cached!
If I explicitly call: flush_dcache_range(np, np + sizeof(np)); before=20
and after this test, the test doesn`t fail.
I also have tried other methods to get some mem which is not cached,=20
i.e. pci_alloc_consistent() (which is based on __get_free_pages()) and=20
manipulating TLB`s as described in Documentation/cachetlb.txt. Without=20
success. All these methods does not help to prevent caching of the=20
allocated region.
Ciao, Ren=E8
|