ide-dma bug
If I use the ide-dma.c from the current cvs (2.4 branch) then I get an error from ext2 when it tries to mount the root filesystem along the lines of
ext2_check_page: bad entry in directory #2
By applying the attached patch I can continue (it reverses part of the change from the yesterday to today), i.e. I can boot the system. I may have time at some point to look at this problem, but it should not be isolated to mips(el) as far as I can see, so some experts are probably working at it as I write.
/Brian
[PATCH 2.4] Re: ide-dma bug (cache flushing)
It seems like this problem is (yet again) caused by lack of cache flushing. The attached patch adds a dma_cache_wback_inv to pci_map_sg in pci.h to the if fork in which sg->address is not set.
This fixes my problem.
Can someone with commit access please apply this patch?
/Brian
Index: include/asm-mips/pci.h
===================================================================
RCS file: /cvs/linux-mips/include/asm-mips/pci.h,v retrieving revision 1.1.1.2
asm-mips/pci.h +5 -1
@@ -200,9 +200,13 @@dma_cache_wback_inv ((unsigned long )sg->address, sg->length); sg->dma_address =bus_to_baddr (hwdev,__pa (sg->address)); - }else + }else { sg->dma_address =page_to_bus (sg->page) + sg->offset; +dma_cache_wback_inv ( + (unsigned long )(page_address (sg->page)+ + sg->offset), sg->length); + } }return nents;
Re: [PATCH 2.4] Re: ide-dma bug (cache flushing)
Ralf, could you please apply the patch below.
Please also apply it to include/asm-mips64/pci.h (the 64-bit version).
/Carsten
Quoted 23 lines · Brian Murphy
It seems like this problem is (yet again) caused by lack of cache flushing. The attached patch adds a
dma_cache_wback_invtopci_map_sginpci.hto the if fork in whichsg->addressis not set.This fixes my problem.
Can someone with commit access please apply this patch?
/Brian
------------------------------------------------------------------------
Index:include/asm-mips/pci.h
===================================================================
RCS file: /cvs/linux-mips/include/asm-mips/pci.h,v retrieving revision 1.1.1.2
diff -u -r1.1.1.2pci.hasm-mips/pci.h 12 Sep 2002 20:06:31 -0000 renamed from asm-mips/pci.h 19 Aug 2002 18:00:29 -0000 1.1.1.2 +0
-1@@ -200,9 +200,13 @@ dma_cache_wback_inv((unsigned long)sg->address, sg->length); sg->dma_address = bus_to_baddr(hwdev, __pa(sg->address)); - } else
asm-mips/pci.h 12 Sep 2002 20:06:31 -0000 line 212
Quoted 10 lines
asm-mips/pci.h 12 Sep 2002 20:06:31 -0000 renamed from asm-mips/pci.h 19 Aug 2002 18:00:29 -0000 1.1.1.2 +5
-0+ } else { sg->dma_address = page_to_bus(sg->page) + sg->offset; + dma_cache_wback_inv( + (unsigned long)(page_address(sg->page)+ + sg->offset), sg->length); + } } return nents;
--
_ _ ____ ___ Carsten Langgaard Mailto:[email protected] |\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527 | \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555 TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556 Denmark http://www.mips.com
Re: [PATCH 2.4] Re: ide-dma bug (cache flushing)
Quoted 2 lines · Carsten Langgaard
Ralf, could you please apply the patch below.
Please also apply it toinclude/asm-mips64/pci.h(the 64-bit version).
Looks ok. The 2.5 version also deserves another thought ...
Ralf