Subject: Re: Problems with "bus_dmamap_sync()" on sparc64
To: Martin Husemann <martin@duskware.de>
From: Hans Petter Selasky <hselasky@c2i.net>
List: tech-kern
Date: 01/23/2007 19:06:12
On Tuesday 23 January 2007 15:50, Hans Petter Selasky wrote:
> On Tuesday 23 January 2007 14:41, Martin Husemann wrote:
> > On Tue, Jan 23, 2007 at 02:22:17PM +0100, Hans Petter Selasky wrote:
> > > iommu_dvmamap_sync_range() calls iommu_strbuf_flush()
> > >
> > > #define iommu_strbuf_flush(i, v) do {                                  
> > > \ if ((i)->sb_flush)                                              \
> > > bus_space_write_8((i)->sb_is->is_bustag, (i)->sb_sb,    \
> > > STRBUFREG(strbuf_pgflush), (v));                \ } while (0)
> > >
> > >
> > > What I see is that "bus_dmamap_sync()" ends up calling
> > > "bus_space_write_8()" to synchronize the memory.
> >
> > Check the ASI used by the bus handle (from memory I guess that would
> > be something like (i)->sb_sb._asi).
>
> I added:
>
> +       struct psycho_pbm *pp = (struct psycho_pbm *
> (sc->sc_hw_page.tag)->_cookie;
> +
> +       printf("%s:%d: ASI=%d\n",
> +              __FUNCTION__, __LINE__,
> +              pp->pp_sb.sb_sb._asi);
>
>
> ehci_init:352: ASI=0
>
> Does this look ok?
>

Looks like the "_asi" field is set to the memory default value of zero:

psycho_attach():

        pp = sc->sc_psycho_this = malloc(sizeof *pp, M_DEVBUF,
                                         M_NOWAIT | M_ZERO);

But pp->pp_sb.sb_sb._asi is not initialized anywhere, from what I can see. 
What is the correct value of the "_asi" field ?

--HPS