[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-bugs
Subject:    Re: kern/42662: iop driver makes kernel crash or freeze
From:       Manuel Bouyer <bouyer () antioche ! eu ! org>
Date:       2010-01-30 18:25:01
Message-ID: 20100130182501.C605E63B886 () www ! NetBSD ! org
[Download RAW message or body]

The following reply was made to PR kern/42662; it has been noted by GNATS.

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Aleksej Saushev <asau@inbox.ru>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
        netbsd-bugs@NetBSD.org
Subject: Re: kern/42662: iop driver makes kernel crash or freeze
Date: Sat, 30 Jan 2010 19:21:16 +0100

 --tThc/1wpZn/ma/RB
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Sat, Jan 30, 2010 at 06:42:37PM +0300, Aleksej Saushev wrote:
 > Manuel Bouyer <bouyer@antioche.eu.org> writes:
 > 
 > >  On Fri, Jan 22, 2010 at 05:50:01PM +0000, Aleksej Saushev wrote:
 > >  > 	5.0_STABLE installation kernel panics when initializing iop driver,
 > >  > 	5.99.24 kernel as of 2009-01-21 crashes too,
 > >  > 	5.99.24 kernel as of today doesn't crash, it freezes instead.
 > >  > 
 > >  > 	All diagnostics below corresponds to 5.0_STABLE.
 > >  > 
 > >  > 	Kernel message at panic:
 > >  > 
 > >  > 	iop0 at pci3 dev 3 function 0: I2O adapterpanic: _bus_dmamap_sync: mix PRE and POST
 > >  
 > >  Can you try the attached patch on netbsd-5 ?
 > >  No idea why it hangs on current, more info needed.
 > 
 > I applied it to the current instead, it crashes with the same diagnostic
 > message and similar backtrace, only it seems to do it a bit later.
 > I can try to replace as many instances of the pattern as needed,
 > can you recommend how many of them? All in that subroutine?
 
 All of them, mixing PRE and POST in bus_dma(9) is not allowed.
 I also found one mistake where a PRE should have been a POST.
 Please try the attached patch (still against netbsd-5).
 
 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --
 
 --tThc/1wpZn/ma/RB
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="iop.diff"
 
 Index: iop.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/i2o/iop.c,v
 retrieving revision 1.75
 diff -u -p -u -r1.75 iop.c
 --- iop.c	14 Sep 2008 18:12:16 -0000	1.75
 +++ iop.c	30 Jan 2010 18:19:36 -0000
 @@ -928,7 +928,7 @@ iop_status_get(struct iop_softc *sc, int
  	    BUS_DMASYNC_PREWRITE);
  	memset(st, 0, sizeof(*st));
  	bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*st),
 -	    BUS_DMASYNC_PREREAD|BUS_DMASYNC_POSTWRITE);
 +	    BUS_DMASYNC_POSTWRITE);
  
  	if ((rv = iop_post(sc, (u_int32_t *)&mf)) != 0)
  		return (rv);
 @@ -993,7 +993,7 @@ iop_ofifo_init(struct iop_softc *sc)
  	    BUS_DMASYNC_PREWRITE);
  	*sw = 0;
  	bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw),
 -	    BUS_DMASYNC_PREREAD|BUS_DMASYNC_POSTWRITE);
 +	    BUS_DMASYNC_POSTWRITE);
  
  	if ((rv = iop_post(sc, mb)) != 0)
  		return (rv);
 @@ -1550,7 +1550,7 @@ iop_reset(struct iop_softc *sc)
  	    BUS_DMASYNC_PREWRITE);
  	*sw = htole32(0);
  	bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw),
 -	    BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
 +	    BUS_DMASYNC_POSTWRITE);
  
  	if ((rv = iop_post(sc, (u_int32_t *)&mf)))
  		return (rv);
 
 --tThc/1wpZn/ma/RB--
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic