NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/42662: iop driver makes kernel crash or freeze



On Sat, Jan 30, 2010 at 06:42:37PM +0300, Aleksej Saushev wrote:
> Manuel Bouyer <bouyer%antioche.eu.org@localhost> 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@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
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);


Home | Main Index | Thread Index | Old Index