tech-kern archive

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

Re: NetBSD 5.0RC2, amd64, XEN_DOM0, panic



On Tue, Mar 24, 2009 at 09:34:31AM +0200, Jukka Marin wrote:
> On Mon, Mar 23, 2009 at 09:35:25PM +0200, Jukka Marin wrote:
> > On Mon, Mar 23, 2009 at 04:25:35PM +0100, Manuel Bouyer wrote:
> > > I can't remember if I asked this: can you try with trimming
> > > the hypervisor memory down to 3Gb (from memory it's mem=3072m on xen.gz's
> > > command line)
> > 
> > No, I hadn't tried that before.  With the 3 GB memory limit, the first build
> > was OK.  I just started another build.
> 
> The third build paniced, the panic is the same as before (some register values
> differ, though).  http://www.jmp.fi/~jmarin/panic090320.tiff

I'm not sure why it would make a difference but you can try the attached
diff

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           
Manuel.Bouyer%lip6.fr@localhost
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: arcmsr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/arcmsr.c,v
retrieving revision 1.22
diff -u -p -u -r1.22 arcmsr.c
--- arcmsr.c    23 Sep 2008 22:22:41 -0000      1.22
+++ arcmsr.c    24 Mar 2009 12:31:57 -0000
@@ -306,7 +306,7 @@ arc_intr(void *arg)
 
                bus_dmamap_sync(sc->sc_dmat, ARC_DMA_MAP(sc->sc_requests),
                    ccb->ccb_offset, ARC_MAX_IOCMDLEN,
-                   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+                   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
                arc_scsi_cmd_done(sc, ccb, reg);
        }
@@ -383,10 +383,10 @@ arc_scsi_cmd(struct scsipi_channel *chan
        cmd->function = 1; /* XXX magic number */
 
        cmd->cdb_len = xs->cmdlen;
-       cmd->sgl_len = ccb->ccb_dmamap->dm_nsegs;
+       cmd->sgl_len = (xs->datalen != 0) ? ccb->ccb_dmamap->dm_nsegs : 0;
        if (xs->xs_control & XS_CTL_DATA_OUT)
                cmd->flags = ARC_MSG_SCSICMD_FLAG_WRITE;
-       if (ccb->ccb_dmamap->dm_nsegs > ARC_SGL_256LEN) {
+       if (cmd->sgl_len > ARC_SGL_256LEN) {
                cmd->flags |= ARC_MSG_SCSICMD_FLAG_SGL_BSIZE_512;
                reg |= ARC_REG_POST_QUEUE_BIGFRAME;
        }
@@ -426,11 +426,14 @@ arc_load_xs(struct arc_ccb *ccb)
 
        if (xs->datalen == 0)
                return 0;
+       KASSERT((xs->xs_control & (XS_CTL_DATA_IN|XS_CTL_DATA_OUT)) != 0);
 
        error = bus_dmamap_load(sc->sc_dmat, dmap,
            xs->data, xs->datalen, NULL,
-           (xs->xs_control & XS_CTL_NOSLEEP) ?
-           BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
+           ((xs->xs_control & XS_CTL_NOSLEEP) ?
+           BUS_DMA_NOWAIT : BUS_DMA_WAITOK) | BUS_DMA_STREAMING |
+           ((xs->xs_control & XS_CTL_DATA_IN) ?
+            BUS_DMA_READ : BUS_DMA_WRITE));
        if (error != 0) {
                aprint_error("%s: error %d loading dmamap\n",
                    device_xname(sc->sc_dev), error);
@@ -533,7 +536,7 @@ arc_complete(struct arc_softc *sc, struc
 
                bus_dmamap_sync(sc->sc_dmat, ARC_DMA_MAP(sc->sc_requests),
                    ccb->ccb_offset, ARC_MAX_IOCMDLEN,
-                   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+                   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
                arc_scsi_cmd_done(sc, ccb, reg);
        } while (nccb != ccb);


Home | Main Index | Thread Index | Old Index