Linux MIPS Architecture development
 help / color / mirror / Atom feed
* ide-dma bug
@ 2002-09-11 20:44 Brian Murphy
  2002-09-12 20:15 ` [PATCH 2.4] Re: ide-dma bug (cache flushing) Brian Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Murphy @ 2002-09-11 20:44 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

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

[-- Attachment #2: patch --]
[-- Type: application/x-java-vm, Size: 1741 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2.4] Re: ide-dma bug (cache flushing)
  2002-09-11 20:44 ide-dma bug Brian Murphy
@ 2002-09-12 20:15 ` Brian Murphy
  2002-10-01 10:17   ` Carsten Langgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Murphy @ 2002-09-12 20:15 UTC (permalink / raw)
  To: Brian Murphy; +Cc: linux-mips

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

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

[-- Attachment #2: flush.patch --]
[-- Type: text/plain, Size: 721 bytes --]

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.2 pci.h
--- include/asm-mips/pci.h	19 Aug 2002 18:00:29 -0000	1.1.1.2
+++ include/asm-mips/pci.h	12 Sep 2002 20:06:31 -0000
@@ -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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.4] Re: ide-dma bug (cache flushing)
  2002-09-12 20:15 ` [PATCH 2.4] Re: ide-dma bug (cache flushing) Brian Murphy
@ 2002-10-01 10:17   ` Carsten Langgaard
  2002-10-01 11:15     ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Carsten Langgaard @ 2002-10-01 10:17 UTC (permalink / raw)
  To: Brian Murphy; +Cc: linux-mips, Ralf Baechle

Ralf, could you please apply the patch below.
Please also apply it to include/asm-mips64/pci.h (the 64-bit version).

/Carsten



Brian Murphy wrote:

> 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
> diff -u -r1.1.1.2 pci.h
> --- include/asm-mips/pci.h      19 Aug 2002 18:00:29 -0000      1.1.1.2
> +++ include/asm-mips/pci.h      12 Sep 2002 20:06:31 -0000
> @@ -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;

--
_    _ ____  ___   Carsten Langgaard   Mailto:carstenl@mips.com
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.4] Re: ide-dma bug (cache flushing)
  2002-10-01 10:17   ` Carsten Langgaard
@ 2002-10-01 11:15     ` Ralf Baechle
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2002-10-01 11:15 UTC (permalink / raw)
  To: Carsten Langgaard; +Cc: Brian Murphy, linux-mips

On Tue, Oct 01, 2002 at 12:17:17PM +0200, Carsten Langgaard wrote:

> Ralf, could you please apply the patch below.
> Please also apply it to include/asm-mips64/pci.h (the 64-bit version).

Looks ok.   The 2.5 version also deserves another thought ...

  Ralf

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-01 11:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-11 20:44 ide-dma bug Brian Murphy
2002-09-12 20:15 ` [PATCH 2.4] Re: ide-dma bug (cache flushing) Brian Murphy
2002-10-01 10:17   ` Carsten Langgaard
2002-10-01 11:15     ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox