Subject: Re: BUS-DMA functions
To: None <thorpej@nas.nasa.gov, mark@causality.com>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-arm32
Date: 03/02/1999 20:06:55
In <199902211832.KAA15801@lestat.nas.nasa.gov>
thorpej@nas.nasa.gov wrote:

>  > scsibus0 at pcscp0: 8 targets, 8 luns per target
>  > probe(pcscp0:1:0): max sync rate 10.00Mb/s
>  > sd0 at scsibus0 targ 1 lun 0: <, , > SCSI0 0/direct fixed
>  > sd0: 1919MB, 3900 cyl, 16 head, 63 sec, 512 bytes/sect x 3931200 sectors

> This is due to a bug in the arm32 bus_dma routines.  The Alpha had the
> same problem at one point when I did the original bus_dma work.  Basically,
> if you have KVAs which don't appear in the kernel pmap (such that
> pmap_extract() will return an error), this can happen.  In this case,
> it's probably the kernel text/data segments aren't mapped in the kernel
> pmap.  (The inquiry buffer used by the SCSI code is a static buffer,
> not on the stack or malloc'd.)

When I remove `static' from the inquiry buffer (line 588
in /sys/dev/scsipi/scsiconf.c), the kernel prints inquiry
message correctly. I don't know why both pmap_extract() and
vtophys() return wrong address, but I guess there are
some problems with DMA transfer to kernel static buffers. 
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp